!function(){this.MooTools={version:"1.6.0",build:"529422872adfff401b901b8b6c7ca5114ee95e2b"};var e=this.typeOf=function(e){if(null==e)return"null";if(null!=e.$family)return e.$family();if(e.nodeName){if(1==e.nodeType)return"element";if(3==e.nodeType)return/\S/.test(e.nodeValue)?"textnode":"whitespace"}else if("number"==typeof e.length){if("callee"in e)return"arguments";if("item"in e)return"collection"}return typeof e},t=this.instanceOf=function(e,t){if(null==e)return!1;for(var n=e.$constructor||e.constructor;n;){if(n===t)return!0;n=n.parent}return!!e.hasOwnProperty&&e instanceof t},n=Object.prototype.hasOwnProperty,i=!0;for(var r in{toString:1})i=null;function o(e,t,r){if(i)for(var o=i.length;o--;){var s=i[o];n.call(e,s)&&t.call(r,s,e[s])}}i&&(i=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]);var s=this.Function;s.prototype.overloadSetter=function(e){var t=this;return function(n,i){if(null==n)return this;if(e||"string"!=typeof n){for(var r in n)t.call(this,r,n[r]);o(n,t,this)}else t.call(this,n,i);return this}},s.prototype.overloadGetter=function(e){var t=this;return function(n){var i,r;if("string"!=typeof n?i=n:arguments.length>1?i=arguments:e&&(i=[n]),i){r={};for(var o=0;o>>0;n>>0;r>>0,i=t<0?Math.max(0,n+t):t||0;i>>0,i=Array(n),r=0;r>>0;n1?Array.slice(arguments,1):null,i=function(){},r=function(){var o=e,s=arguments.length;this instanceof r&&(i.prototype=t.prototype,o=new i);var a=n||s?t.apply(o,n&&s?n.concat(Array.slice(arguments)):n||arguments):t.call(o);return o==e?a:o};return r},pass:function(e,t){var n=this;return null!=e&&(e=Array.convert(e)),function(){return n.apply(t,e||arguments)}},delay:function(e,t,n){return setTimeout(this.pass(null==n?[]:n,t),e)},periodical:function(e,t,n){return setInterval(this.pass(null==n?[]:n,t),e)}}),delete Function.prototype.bind,Function.implement({create:function(e){var t=this;return e=e||{},function(n){var i=e.arguments;i=null!=i?Array.convert(i):Array.slice(arguments,e.event?1:0),e.event&&i.unshift(n||window.event);var r=function(){return t.apply(e.bind||null,i)};return e.delay?setTimeout(r,e.delay):e.periodical?setInterval(r,e.periodical):e.attempt?Function.attempt(r):r()}},bind:function(e,t){var n=this;return null!=t&&(t=Array.convert(t)),function(){return n.apply(e,t||arguments)}},bindWithEvent:function(e,t){var n=this;return null!=t&&(t=Array.convert(t)),function(i){return n.apply(e,null==t?arguments:[i].concat(t))}},run:function(e,t){return this.apply(t,Array.convert(e))}}),Object.create==Function.prototype.create&&(Object.create=null);var $try=Function.attempt;Number.implement({limit:function(e,t){return Math.min(t,Math.max(e,this))},round:function(e){return e=Math.pow(10,e||0).toFixed(e<0?-e:0),Math.round(this*e)/e},times:function(e,t){for(var n=0;n-1},test:function(e,t){return("regexp"==typeOf(e)?e:new RegExp(""+e,t)).test(this)},trim:function(){return String(this).replace(/^\s+|\s+$/g,"")},clean:function(){return String(this).replace(/\s+/g," ").trim()},camelCase:function(){return String(this).replace(/-\D/g,function(e){return e.charAt(1).toUpperCase()})},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(e){return"-"+e.charAt(0).toLowerCase()})},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(e){return parseInt(this,e||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(e){var t=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return t?t.slice(1).hexToRgb(e):null},rgbToHex:function(e){var t=String(this).match(/\d{1,3}/g);return t?t.rgbToHex(e):null},substitute:function(e,t){return String(this).replace(t||/\\?\{([^{}]+)\}/g,function(t,n){return"\\"==t.charAt(0)?t.slice(1):null!=e[n]?e[n]:""})}}),String.prototype.contains=function(e,t){return t?(t+this+t).indexOf(t+e+t)>-1:String(this).indexOf(e)>-1},function(){var e=this.document,t=e.window=this,n=function(e,t){e=e.toLowerCase(),t=t?t.toLowerCase():"";var n=e.match(/(edge)[\s\/:]([\w\d\.]+)/);return n||(n=e.match(/(opera|ie|firefox|chrome|trident|crios|version)[\s\/:]([\w\d\.]+)?.*?(safari|(?:rv[\s\/:]|version[\s\/:])([\w\d\.]+)|$)/)||[null,"unknown",0]),"trident"==n[1]?(n[1]="ie",n[4]&&(n[2]=n[4])):"crios"==n[1]&&(n[1]="chrome"),"win"==(t=e.match(/ip(?:ad|od|hone)/)?"ios":(e.match(/(?:webos|android)/)||e.match(/mac|win|linux/)||["other"])[0])&&(t="windows"),{extend:Function.prototype.extend,name:"version"==n[1]?n[3]:n[1],version:parseFloat("opera"==n[1]&&n[4]?n[4]:n[2]),platform:t}},i=this.Browser=n(navigator.userAgent,navigator.platform);"ie"==i.name&&e.documentMode&&(i.version=e.documentMode),i.extend({Features:{xpath:!!e.evaluate,air:!!t.runtime,query:!!e.querySelector,json:!!t.JSON},parseUA:n}),i[i.name]=!0,i[i.name+parseInt(i.version,10)]=!0,"ie"==i.name&&i.version>="11"&&delete i.ie;var r,o,s,a=i.platform;"windows"==a&&(a="win"),i.Platform={name:a},i.Platform[a]=!0,i.Request=(r=function(){return new XMLHttpRequest},o=function(){return new ActiveXObject("MSXML2.XMLHTTP")},s=function(){return new ActiveXObject("Microsoft.XMLHTTP")},Function.attempt(function(){return r(),r},function(){return o(),o},function(){return s(),s})),i.Features.xhr=!!i.Request;var l=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);if(i.Plugins={Flash:{version:Number(l[0]||"0."+l[1])||0,build:Number(l[2])||0}},i.exec=function(n){if(!n)return n;if(t.execScript)t.execScript(n);else{var i=e.createElement("script");i.setAttribute("type","text/javascript"),i.text=n,e.head.appendChild(i),e.head.removeChild(i)}return n},String.implement("stripScripts",function(e){var t="",n=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(e,n){return t+=n+"\n",""});return!0===e?i.exec(t):"function"==typeOf(e)&&e(t,n),n}),i.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}),this.Window=this.$constructor=new Type("Window",function(){}),this.$family=Function.convert("window").hide(),Window.mirror(function(e,n){t[e]=n}),this.Document=e.$constructor=new Type("Document",function(){}),e.$family=Function.convert("document").hide(),Document.mirror(function(t,n){e[t]=n}),e.html=e.documentElement,e.head||(e.head=e.getElementsByTagName("head")[0]),e.execCommand)try{e.execCommand("BackgroundImageCache",!1,!0)}catch(e){}if(this.attachEvent&&!this.addEventListener){var u=function(){this.detachEvent("onunload",u),e.head=e.html=e.window=null,t=this.Window=e=null};this.attachEvent("onunload",u)}var c=Array.convert;try{c(e.html.childNodes)}catch(e){Array.convert=function(e){if("string"!=typeof e&&Type.isEnumerable(e)&&"array"!=typeOf(e)){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}return c(e)};var p=Array.prototype,h=p.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var t=p[e];Array[e]=function(e){return t.apply(Array.convert(e),h.call(arguments,1))}})}i.Platform.ios&&(i.Platform.ipod=!0),i.Engine={};var d=function(e,t){i.Engine.name=e,i.Engine[e+t]=!0,i.Engine.version=t};if(i.ie)switch(i.Engine.trident=!0,i.version){case 6:d("trident",4);break;case 7:d("trident",5);break;case 8:d("trident",6)}if(i.firefox&&(i.Engine.gecko=!0,i.version>=3?d("gecko",19):d("gecko",18)),i.safari||i.chrome)switch(i.Engine.webkit=!0,i.version){case 2:d("webkit",419);break;case 3:d("webkit",420);break;case 4:d("webkit",525)}if(i.opera&&(i.Engine.presto=!0,i.version>=9.6?d("presto",960):i.version>=9.5?d("presto",950):d("presto",925)),"unknown"==i.name)switch((navigator.userAgent.toLowerCase().match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":i.Engine.webkit=!0;break;case"gecko":i.Engine.gecko=!0}this.$exec=i.exec}(),function(){var e=this.Class=new Type("Class",function(i){instanceOf(i,Function)&&(i={initialize:i});var r=function(){if(n(this),r.$prototyping)return this;this.$caller=null,this.$family=null;var e=this.initialize?this.initialize.apply(this,arguments):this;return this.$caller=this.caller=null,e}.extend(this).implement(i);return r.$constructor=e,r.prototype.$constructor=r,r.prototype.parent=t,r}),t=function(){if(!this.$caller)throw new Error('The method "parent" cannot be called.');var e=this.$caller.$name,t=this.$caller.$owner.parent,n=t?t.prototype[e]:null;if(!n)throw new Error('The method "'+e+'" has no parent.');return n.apply(this,arguments)},n=function(e){for(var t in e){var i=e[t];switch(typeOf(i)){case"object":var r=function(){};r.prototype=i,e[t]=n(new r);break;case"array":e[t]=i.clone()}}return e},i=function(t,n,i){if(e.Mutators.hasOwnProperty(t)&&null==(n=e.Mutators[t].call(this,n)))return this;if("function"==typeOf(n)){if(n.$hidden)return this;this.prototype[t]=i?n:function(e,t,n){n.$origin&&(n=n.$origin);var i=function(){if(n.$protected&&null==this.$caller)throw new Error('The method "'+t+'" cannot be called.');var e=this.caller,r=this.$caller;this.caller=r,this.$caller=i;var o=n.apply(this,arguments);return this.$caller=r,this.caller=e,o}.extend({$owner:e,$origin:n,$name:t});return i}(this,t,n)}else Object.merge(this.prototype,t,n);return this};e.implement("implement",i.overloadSetter()),e.Mutators={Extends:function(e){this.parent=e,this.prototype=function(e){e.$prototyping=!0;var t=new e;return delete e.$prototyping,t}(e)},Implements:function(e){Array.convert(e).each(function(e){var t=new e;for(var n in t)i.call(this,n,t[n],!0)},this)}}}(),function(){this.Chain=new Class({$chain:[],chain:function(){return this.$chain.append(Array.flatten(arguments)),this},callChain:function(){return!!this.$chain.length&&this.$chain.shift().apply(this,arguments)},clearChain:function(){return this.$chain.empty(),this}});var e=function(e){return e.replace(/^on([A-Z])/,function(e,t){return t.toLowerCase()})};this.Events=new Class({$events:{},addEvent:function(t,n,i){return t=e(t),n==$empty?this:(this.$events[t]=(this.$events[t]||[]).include(n),i&&(n.internal=!0),this)},addEvents:function(e){for(var t in e)this.addEvent(t,e[t]);return this},fireEvent:function(t,n,i){t=e(t);var r=this.$events[t];return r?(n=Array.convert(n),r.each(function(e){i?e.delay(i,this,n):e.apply(this,n)},this),this):this},removeEvent:function(t,n){t=e(t);var i=this.$events[t];if(i&&!n.internal){var r=i.indexOf(n);-1!=r&&delete i[r]}return this},removeEvents:function(t){var n;if("object"==typeOf(t)){for(n in t)this.removeEvent(n,t[n]);return this}for(n in t&&(t=e(t)),this.$events)if(!t||t==n)for(var i=this.$events[n],r=i.length;r--;)r in i&&this.removeEvent(n,i[r]);return this}}),this.Options=new Class({setOptions:function(){var e=this.options=Object.merge.apply(null,[{},this.options].append(arguments));if(this.addEvent)for(var t in e)"function"==typeOf(e[t])&&/^on[A-Z]/.test(t)&&(this.addEvent(t,e[t]),delete e[t]);return this}})}(),function(){var e,t=0,n=1,i=2,r=Class.Thenable=new Class({$thenableState:t,$thenableResult:null,$thenableReactions:[],resolve:function(e){return o(this,e),this},reject:function(e){return a(this,e),this},getThenableState:function(){switch(this.$thenableState){case t:return"pending";case n:return"fulfilled";case i:return"rejected"}},resetThenable:function(e){var n;return a(this,e),(n=this).$thenableState!==t&&(n.$thenableResult=null,n.$thenableState=t),this},then:function(e,n){"function"!=typeof e&&(e="Identity"),"function"!=typeof n&&(n="Thrower");var i=new r;return this.$thenableReactions.push({thenable:i,fulfillHandler:e,rejectHandler:n}),this.$thenableState!==t&&l(this),i},catch:function(e){return this.then(null,e)}});function o(n,i){if(n.$thenableState===t)if(n===i)a(n,new TypeError("Tried to resolve a thenable with itself."));else if(!i||"object"!=typeof i&&"function"!=typeof i)s(n,i);else{var r;try{r=i.then}catch(e){a(n,e)}if("function"==typeof r){var l=!1;e(function(){try{r.call(i,function(e){l||(l=!0,o(n,e))},function(e){l||(l=!0,a(n,e))})}catch(e){l||(l=!0,a(n,e))}})}else s(n,i)}}function s(e,i){e.$thenableState===t&&(e.$thenableResult=i,e.$thenableState=n,l(e))}function a(e,n){e.$thenableState===t&&(e.$thenableResult=n,e.$thenableState=i,l(e))}function l(t){var r,s=t.$thenableState,l=t.$thenableResult,u=t.$thenableReactions;s===n?(t.$thenableReactions=[],r="fulfillHandler"):s==i&&(t.$thenableReactions=[],r="rejectHandler"),r&&e(function(e,t,n){for(var i=0,r=t.length;i+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+c(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])"));function h(r,o,a,u,p,h,d,f,y,m,g,_,v,b,x,w){if((o||-1===t)&&(e.expressions[++t]=[],n=-1,o))return"";if(a||u||-1===n){a=a||" ";var k=e.expressions[t];i&&k[n]&&(k[n].reverseCombinator=l(a)),k[++n]={combinator:a,tag:"*"}}var S=e.expressions[t][n];if(p)S.tag=p.replace(s,"");else if(h)S.id=h.replace(s,"");else if(d)d=d.replace(s,""),S.classList||(S.classList=[]),S.classes||(S.classes=[]),S.classList.push(d),S.classes.push({value:d,regexp:new RegExp("(^|\\s)"+c(d)+"(\\s|$)")});else if(v)w=(w=w||x)?w.replace(s,""):null,S.pseudos||(S.pseudos=[]),S.pseudos.push({key:v.replace(s,""),value:w,type:1==_.length?"class":"element"});else if(f){var C,T;switch(f=f.replace(s,""),g=(g||"").replace(s,""),y){case"^=":T=new RegExp("^"+c(g));break;case"$=":T=new RegExp(c(g)+"$");break;case"~=":T=new RegExp("(^|\\s)"+c(g)+"(\\s|$)");break;case"|=":T=new RegExp("^"+c(g)+"(-|$)");break;case"=":C=function(e){return g==e};break;case"*=":C=function(e){return e&&e.indexOf(g)>-1};break;case"!=":C=function(e){return g!=e};break;default:C=function(e){return!!e}}""==g&&/^[*$^]=$/.test(y)&&(C=function(){return!1}),C||(C=function(e){return e&&T.test(e)}),S.attributes||(S.attributes=[]),S.attributes.push({key:f,operator:y,value:g,test:C})}return""}var d=this.Slick||{};d.parse=function(e){return a(e)},d.escapeRegExp=c,this.Slick||(this.Slick=d)}.apply("undefined"!=typeof exports?exports:this),function(){var e={},t={},n=Object.prototype.toString;e.isNativeCode=function(e){return/\{\s*\[native code\]\s*\}/.test(""+e)},e.isXML=function(e){return!!e.xmlVersion||!!e.xml||"[object XMLDocument]"==n.call(e)||9==e.nodeType&&"HTML"!=e.documentElement.nodeName},e.setDocument=function(e){var n=e.nodeType;if(9==n);else if(n)e=e.ownerDocument;else{if(!e.navigator)return;e=e.document}if(this.document!==e){this.document=e;var i,r=e.documentElement,o=this.getUIDXML(r),s=t[o];if(s)for(i in s)this[i]=s[i];else{var a,l,u,c,p;(s=t[o]={}).root=r,s.isXMLDocument=this.isXML(e),s.brokenStarGEBTN=s.starSelectsClosedQSA=s.idGetsName=s.brokenMixedCaseQSA=s.brokenGEBCN=s.brokenCheckedQSA=s.brokenEmptyAttributeQSA=s.isHTMLDocument=s.nativeMatchesSelector=!1;var h,d="slick_uniqueid",f=e.createElement("div"),y=e.body||e.getElementsByTagName("body")[0]||r;y.appendChild(f);try{f.innerHTML='',s.isHTMLDocument=!!e.getElementById(d)}catch(e){}if(s.isHTMLDocument){f.style.display="none",f.appendChild(e.createComment("")),l=f.getElementsByTagName("*").length>1;try{f.innerHTML="foo",a=(h=f.getElementsByTagName("*"))&&!!h.length&&"/"==h[0].nodeName.charAt(0)}catch(e){}s.brokenStarGEBTN=l||a;try{f.innerHTML='',s.idGetsName=e.getElementById(d)===f.firstChild}catch(e){}if(f.getElementsByClassName){try{f.innerHTML='',f.getElementsByClassName("b").length,f.firstChild.className="b",c=2!=f.getElementsByClassName("b").length}catch(e){}try{f.innerHTML='',u=2!=f.getElementsByClassName("a").length}catch(e){}s.brokenGEBCN=c||u}if(f.querySelectorAll){try{f.innerHTML="foo",h=f.querySelectorAll("*"),s.starSelectsClosedQSA=h&&!!h.length&&"/"==h[0].nodeName.charAt(0)}catch(e){}try{f.innerHTML='',s.brokenMixedCaseQSA=!f.querySelectorAll(".MiX").length}catch(e){}try{f.innerHTML='',s.brokenCheckedQSA=0==f.querySelectorAll(":checked").length}catch(e){}try{f.innerHTML='',s.brokenEmptyAttributeQSA=0!=f.querySelectorAll('[class*=""]').length}catch(e){}}try{f.innerHTML='
',p="s"!=f.firstChild.getAttribute("action")}catch(e){}if(s.nativeMatchesSelector=r.matches||r.mozMatchesSelector||r.webkitMatchesSelector,s.nativeMatchesSelector)try{s.nativeMatchesSelector.call(r,":slick"),s.nativeMatchesSelector=null}catch(e){}}try{r.slick_expando=1,delete r.slick_expando,s.getUID=this.getUIDHTML}catch(e){s.getUID=this.getUIDXML}y.removeChild(f),f=h=y=null,s.getAttribute=s.isHTMLDocument&&p?function(e,t){var n=this.attributeGetters[t];if(n)return n.call(e);var i=e.getAttributeNode(t);return i?i.nodeValue:null}:function(e,t){var n=this.attributeGetters[t];return n?n.call(e):e.getAttribute(t)},s.hasAttribute=r&&this.isNativeCode(r.hasAttribute)?function(e,t){return e.hasAttribute(t)}:function(e,t){return!(!(e=e.getAttributeNode(t))||!e.specified&&!e.nodeValue)};var m=r&&this.isNativeCode(r.contains),g=e&&this.isNativeCode(e.contains);for(i in s.contains=m&&g?function(e,t){return e.contains(t)}:m&&!g?function(t,n){return t===n||(t===e?e.documentElement:t).contains(n)}:r&&r.compareDocumentPosition?function(e,t){return e===t||!!(16&e.compareDocumentPosition(t))}:function(e,t){if(t)do{if(t===e)return!0}while(t=t.parentNode);return!1},s.documentSorter=r.compareDocumentPosition?function(e,t){return e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t)?-1:e===t?0:1:0}:"sourceIndex"in r?function(e,t){return e.sourceIndex&&t.sourceIndex?e.sourceIndex-t.sourceIndex:0}:e.createRange?function(e,t){if(!e.ownerDocument||!t.ownerDocument)return 0;var n=e.ownerDocument.createRange(),i=t.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,0),i.setStart(t,0),i.setEnd(t,0),n.compareBoundaryPoints(Range.START_TO_END,i)}:null,r=null,s)this[i]=s[i]}}};var i=/^([#.]?)((?:[\w-]+|\*))$/,r=/\[.+[*$^]=(?:""|'')?\]/,o={};e.search=function(e,t,n,s){var a=this.found=s?null:n||[];if(!e)return a;if(e.navigator)e=e.document;else if(!e.nodeType)return a;var l,u,c,h,d,f,y,m,g,_,v,b,x,w,k=this.uniques={},S=!(!n||!n.length),C=9==e.nodeType;if(this.document!==(C?e:e.ownerDocument)&&this.setDocument(e),S)for(u=a.length;u--;)k[this.getUID(a[u])]=!0;if("string"==typeof t){var T=t.match(i);e:if(T){var E=T[1],L=T[2];if(E){if("#"==E){if(!this.isHTMLDocument||!C)break e;if(!(c=e.getElementById(L)))return a;if(this.idGetsName&&c.getAttributeNode("id").nodeValue!=L)break e;if(s)return c||null;S&&k[this.getUID(c)]||a.push(c)}else if("."==E){if(!this.isHTMLDocument||(!e.getElementsByClassName||this.brokenGEBCN)&&e.querySelectorAll)break e;if(e.getElementsByClassName&&!this.brokenGEBCN){if(h=e.getElementsByClassName(L),s)return h[0]||null;for(u=0;c=h[u++];)S&&k[this.getUID(c)]||a.push(c)}else{var M=new RegExp("(^|\\s)"+p.escapeRegExp(L)+"(\\s|$)");for(h=e.getElementsByTagName("*"),u=0;c=h[u++];)if(className=c.className,className&&M.test(className)){if(s)return c;S&&k[this.getUID(c)]||a.push(c)}}}}else{if("*"==L&&this.brokenStarGEBTN)break e;if(h=e.getElementsByTagName(L),s)return h[0]||null;for(u=0;c=h[u++];)S&&k[this.getUID(c)]||a.push(c)}return S&&this.sort(a),s?null:a}e:if(e.querySelectorAll){if(!this.isHTMLDocument||o[t]||this.brokenMixedCaseQSA||this.brokenCheckedQSA&&t.indexOf(":checked")>-1||this.brokenEmptyAttributeQSA&&r.test(t)||!C&&t.indexOf(",")>-1||p.disableQSA)break e;var A,O=t,P=e;C||(A=P.getAttribute("id"),slickid="slickid__",P.setAttribute("id",slickid),O="#"+slickid+" "+O,e=P.parentNode);try{if(s)return e.querySelector(O)||null;h=e.querySelectorAll(O)}catch(e){o[t]=1;break e}finally{C||(A?P.setAttribute("id",A):P.removeAttribute("id"),e=P)}if(this.starSelectsClosedQSA)for(u=0;c=h[u++];)!(c.nodeName>"@")||S&&k[this.getUID(c)]||a.push(c);else for(u=0;c=h[u++];)S&&k[this.getUID(c)]||a.push(c);return S&&this.sort(a),a}if(!(l=this.Slick.parse(t)).length)return a}else{if(null==t)return a;if(!t.Slick)return this.contains(e.documentElement||e,t)?(a?a.push(t):a=t,a):a;l=t}this.posNTH={},this.posNTHLast={},this.posNTHType={},this.posNTHTypeLast={},this.push=!S&&(s||1==l.length&&1==l.expressions[0].length)?this.pushArray:this.pushUID,null==a&&(a=[]);var R,j,N,I,D=l.expressions;e:for(u=0;j=D[u];u++)for(d=0;N=j[d];d++){if(!this[m="combinator:"+N.combinator])continue e;if(g=this.isXMLDocument?N.tag:N.tag.toUpperCase(),_=N.id,v=N.classList,b=N.classes,x=N.attributes,w=N.pseudos,I=d===j.length-1,this.bitUniques={},I?(this.uniques=k,this.found=a):(this.uniques={},this.found=[]),0===d){if(this[m](e,g,_,b,x,w,v),s&&I&&a.length)break e}else if(s&&I){for(f=0,y=R.length;f1)&&this.sort(a),s?a[0]||null:a},e.uidx=1,e.uidk="slick-uniqueid",e.getUIDXML=function(e){var t=e.getAttribute(this.uidk);return t||(t=this.uidx++,e.setAttribute(this.uidk,t)),t},e.getUIDHTML=function(e){return e.uniqueNumber||(e.uniqueNumber=this.uidx++)},e.sort=function(e){return this.documentSorter?(e.sort(this.documentSorter),e):e},e.cacheNTH={},e.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/,e.parseNTHArgument=function(e){var t=e.match(this.matchNTH);if(!t)return!1;var n=t[2]||!1,i=t[1]||1;"-"==i&&(i=-1);var r=+t[3]||0;return t="n"==n?{a:i,b:r}:"odd"==n?{a:2,b:1}:"even"==n?{a:2,b:0}:{a:0,b:i},this.cacheNTH[e]=t},e.createNTHPseudo=function(e,t,n,i){return function(r,o){var s=this.getUID(r);if(!this[n][s]){var a=r.parentNode;if(!a)return!1;var l=a[e],u=1;if(i){var c=r.nodeName;do{l.nodeName==c&&(this[n][this.getUID(l)]=u++)}while(l=l[t])}else do{1==l.nodeType&&(this[n][this.getUID(l)]=u++)}while(l=l[t])}o=o||"n";var p=this.cacheNTH[o]||this.parseNTHArgument(o);if(!p)return!1;var h=p.a,d=p.b,f=this[n][s];if(0==h)return d==f;if(h>0){if(f":function(e,t,n,i,r,o){if(e=e.firstChild)do{1==e.nodeType&&this.push(e,t,n,i,r,o)}while(e=e.nextSibling)},"+":function(e,t,n,i,r,o){for(;e=e.nextSibling;)if(1==e.nodeType){this.push(e,t,n,i,r,o);break}},"^":function(e,t,n,i,r,o){(e=e.firstChild)&&(1==e.nodeType?this.push(e,t,n,i,r,o):this["combinator:+"](e,t,n,i,r,o))},"~":function(e,t,n,i,r,o){for(;e=e.nextSibling;)if(1==e.nodeType){var s=this.getUID(e);if(this.bitUniques[s])break;this.bitUniques[s]=!0,this.push(e,t,n,i,r,o)}},"++":function(e,t,n,i,r,o){this["combinator:+"](e,t,n,i,r,o),this["combinator:!+"](e,t,n,i,r,o)},"~~":function(e,t,n,i,r,o){this["combinator:~"](e,t,n,i,r,o),this["combinator:!~"](e,t,n,i,r,o)},"!":function(e,t,n,i,r,o){for(;e=e.parentNode;)e!==this.document&&this.push(e,t,n,i,r,o)},"!>":function(e,t,n,i,r,o){(e=e.parentNode)!==this.document&&this.push(e,t,n,i,r,o)},"!+":function(e,t,n,i,r,o){for(;e=e.previousSibling;)if(1==e.nodeType){this.push(e,t,n,i,r,o);break}},"!^":function(e,t,n,i,r,o){(e=e.lastChild)&&(1==e.nodeType?this.push(e,t,n,i,r,o):this["combinator:!+"](e,t,n,i,r,o))},"!~":function(e,t,n,i,r,o){for(;e=e.previousSibling;)if(1==e.nodeType){var s=this.getUID(e);if(this.bitUniques[s])break;this.bitUniques[s]=!0,this.push(e,t,n,i,r,o)}}};for(var a in s)e["combinator:"+a]=s[a];var l={empty:function(e){var t=e.firstChild;return!(t&&1==t.nodeType||(e.innerText||e.textContent||"").length)},not:function(e,t){return!this.matchNode(e,t)},contains:function(e,t){return(e.innerText||e.textContent||"").indexOf(t)>-1},"first-child":function(e){for(;e=e.previousSibling;)if(1==e.nodeType)return!1;return!0},"last-child":function(e){for(;e=e.nextSibling;)if(1==e.nodeType)return!1;return!0},"only-child":function(e){for(var t=e;t=t.previousSibling;)if(1==t.nodeType)return!1;for(var n=e;n=n.nextSibling;)if(1==n.nodeType)return!1;return!0},"nth-child":e.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":e.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":e.createNTHPseudo("firstChild","nextSibling","posNTHType",!0),"nth-last-of-type":e.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",!0),index:function(e,t){return this["pseudo:nth-child"](e,""+(t+1))},even:function(e){return this["pseudo:nth-child"](e,"2n")},odd:function(e){return this["pseudo:nth-child"](e,"2n+1")},"first-of-type":function(e){for(var t=e.nodeName;e=e.previousSibling;)if(e.nodeName==t)return!1;return!0},"last-of-type":function(e){for(var t=e.nodeName;e=e.nextSibling;)if(e.nodeName==t)return!1;return!0},"only-of-type":function(e){for(var t=e,n=e.nodeName;t=t.previousSibling;)if(t.nodeName==n)return!1;for(var i=e;i=i.nextSibling;)if(i.nodeName==n)return!1;return!0},enabled:function(e){return!e.disabled},disabled:function(e){return e.disabled},checked:function(e){return e.checked||e.selected},focus:function(e){return this.isHTMLDocument&&this.document.activeElement===e&&(e.href||e.type||this.hasAttribute(e,"tabindex"))},root:function(e){return e===this.root},selected:function(e){return e.selected}};for(var u in l)e["pseudo:"+u]=l[u];var c=e.attributeGetters={for:function(){return"htmlFor"in this?this.htmlFor:this.getAttribute("for")},href:function(){return"href"in this?this.getAttribute("href",2):this.getAttribute("href")},style:function(){return this.style?this.style.cssText:this.getAttribute("style")},tabindex:function(){var e=this.getAttributeNode("tabindex");return e&&e.specified?e.nodeValue:null},type:function(){return this.getAttribute("type")},maxlength:function(){var e=this.getAttributeNode("maxLength");return e&&e.specified?e.nodeValue:null}};c.MAXLENGTH=c.maxLength=c.maxlength;var p=e.Slick=this.Slick||{};p.version="1.1.7",p.search=function(t,n,i){return e.search(t,n,i)},p.find=function(t,n){return e.search(t,n,null,!0)},p.contains=function(t,n){return e.setDocument(t),e.contains(t,n)},p.getAttribute=function(t,n){return e.setDocument(t),e.getAttribute(t,n)},p.hasAttribute=function(t,n){return e.setDocument(t),e.hasAttribute(t,n)},p.match=function(t,n){return!(!t||!n)&&(!n||n===t||(e.setDocument(t),e.matchNode(t,n)))},p.defineAttributeGetter=function(t,n){return e.attributeGetters[t]=n,this},p.lookupAttributeGetter=function(t){return e.attributeGetters[t]},p.definePseudo=function(t,n){return e["pseudo:"+t]=function(e,t){return n.call(e,t)},this},p.lookupPseudo=function(t){var n=e["pseudo:"+t];return n?function(e){return n.call(this,e)}:null},p.override=function(t,n){return e.override(t,n),this},p.isXML=e.isXML,p.uidOf=function(t){return e.getUIDHTML(t)},this.Slick||(this.Slick=p)}.apply("undefined"!=typeof exports?exports:this);var Element=this.Element=function(e,t){var n=Element.Constructors[e];if(n)return n(t);if("string"!=typeof e)return document.id(e).set(t);if(t||(t={}),!/^[\w-]+$/.test(e)){var i=Slick.parse(e).expressions[0][0];e="*"==i.tag?"div":i.tag,i.id&&null==t.id&&(t.id=i.id);var r=i.attributes;if(r)for(var o,s=0,a=r.length;s=this.length;)delete this[e--];return n}.protect()),Array.forEachMethod(function(e,t){Elements.implement(t,e)}),Array.mirror(Elements);try{e="x"==document.createElement("").name}catch(e){}var i=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""")},r=function(){var e=document.createElement("style"),t=!1;try{e.innerHTML="#justTesing{margin: 0px;}",t=!!e.innerHTML}catch(e){}return t}();Document.implement({newElement:function(t,n){if(n){if(null!=n.checked&&(n.defaultChecked=n.checked),"checkbox"!=n.type&&"radio"!=n.type||null!=n.value||(n.value="on"),!r&&"style"==t){var o=document.createElement("style");return o.setAttribute("type","text/css"),n.type&&delete n.type,this.id(o).set(n)}e&&(t="<"+t,n.name&&(t+=' name="'+i(n.name)+'"'),n.type&&(t+=' type="'+i(n.type)+'"'),t+=">",delete n.name,delete n.type)}return this.id(this.createElement(t)).set(n)}})}(),function(){var e;Slick.uidOf(window),Slick.uidOf(document),Document.implement({newTextNode:function(e){return this.createTextNode(e)},getDocument:function(){return this},getWindow:function(){return this.window},id:(e={string:function(t,n,i){return(t=Slick.find(i,"#"+t.replace(/(\W)/g,"\\$1")))?e.element(t,n):null},element:function(e,t){if(Slick.uidOf(e),!t&&!e.$family&&!/^(?:object|embed)$/i.test(e.tagName)){var n=e.fireEvent;e._fireEvent=function(e,t){return n(e,t)},Object.append(e,Element.Prototype)}return e},object:function(t,n,i){return t.toElement?e.element(t.toElement(i),n):null}},e.textnode=e.whitespace=e.window=e.document=function(e){return e},function(t,n,i){if(t&&t.$family&&t.uniqueNumber)return t;var r=typeOf(t);return e[r]?e[r](t,n,i||document):null})}),null==window.$&&Window.implement("$",function(e,t){return document.id(e,t,this.document)}),Window.implement({getDocument:function(){return this.document},getWindow:function(){return this}}),[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements)},getElement:function(e){return document.id(Slick.find(this,e))}});var t={contains:function(e){return Slick.contains(this,e)}};document.contains||Document.implement(t),document.createElement("div").contains||Element.implement(t),Element.implement("hasChild",function(e){return this!==e&&this.contains(e)}),function(e,t,n){this.Selectors={};var i=this.Selectors.Pseudo=new Hash,r=function(){for(var e in i)i.hasOwnProperty(e)&&(Slick.definePseudo(e,i[e]),delete i[e])};Slick.search=function(t,n,i){return r(),e.call(this,t,n,i)},Slick.find=function(e,n){return r(),t.call(this,e,n)},Slick.match=function(e,t){return r(),n.call(this,e,t)}}(Slick.search,Slick.find,Slick.match);var n=function(e,t){if(!e)return t;for(var n=(e=Object.clone(Slick.parse(e))).expressions,i=n.length;i--;)n[i][0].combinator=t;return e};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,t){Element.implement(t,function(t){return this.getElement(n(t,e))})}),Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,t){Element.implement(t,function(t){return this.getElements(n(t,e))})}),Element.implement({getFirst:function(e){return document.id(Slick.search(this,n(e,">"))[0])},getLast:function(e){return document.id(Slick.search(this,n(e,">")).getLast())},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1")))},match:function(e){return!e||Slick.match(this,e)}}),null==window.$$&&Window.implement("$$",function(e){var t=new Elements;if(1==arguments.length&&"string"==typeof e)return Slick.search(this.document,e,t);for(var n=Array.flatten(arguments),i=0,r=n.length;i',1!=y.cloneNode(!0).firstChild.childNodes.length),_=!!document.createElement("div").classList,v=function(e){var t={};return(e||"").clean().split(" ").filter(function(e){if(""!==e&&!t[e])return t[e]=e})},b=function(e){this.classList.add(e)},x=function(e){this.classList.remove(e)};Element.implement({setProperty:function(e,t){var n,i=s[e.toLowerCase()];i?i(this,t):(m&&(n=this.retrieve("$attributeWhiteList",{})),null==t?(this.removeAttribute(e),m&&delete n[e]):(this.setAttribute(e,""+t),m&&(n[e]=!0)));return this},setProperties:function(e){for(var t in e)this.setProperty(t,e[t]);return this},getProperty:function(e){var t=o[e.toLowerCase()];if(t)return t(this);if(m){var n=this.getAttributeNode(e),i=this.retrieve("$attributeWhiteList",{});if(!n)return null;if(n.expando&&!i[e]){var r=this.outerHTML;if(r.substr(0,r.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(e)<0)return null;i[e]=!0}}var s=Slick.getAttribute(this,e);return s||Slick.hasAttribute(this,e)?s:null},getProperties:function(){var e=Array.convert(arguments);return e.map(this.getProperty,this).associate(e)},removeProperty:function(e){return this.setProperty(e,null)},removeProperties:function(){return Array.each(arguments,this.removeProperty,this),this},set:function(e,t){var n=Element.Properties[e];n&&n.set?n.set.call(this,t):this.setProperty(e,t)}.overloadSetter(),get:function(e){var t=Element.Properties[e];return t&&t.get?t.get.apply(this):this.getProperty(e)}.overloadGetter(),erase:function(e){var t=Element.Properties[e];return t&&t.erase?t.erase.apply(this):this.removeProperty(e),this},hasClass:_?function(e){return this.classList.contains(e)}:function(e){return v(this.className).contains(e)},addClass:_?function(e){return v(e).forEach(b,this),this}:function(e){return this.className=v(e+" "+this.className).join(" "),this},removeClass:_?function(e){return v(e).forEach(x,this),this}:function(e){var t=v(this.className);return v(e).forEach(t.erase,t),this.className=t.join(" "),this},toggleClass:function(e,t){return null==t&&(t=!this.hasClass(e)),t?this.addClass(e):this.removeClass(e)},adopt:function(){var e,t=this,n=Array.flatten(arguments),i=n.length;i>1&&(t=e=document.createDocumentFragment());for(var r=0;r1){o=document.createDocumentFragment();for(var s=0,a=r.length;s",!(M=1==R.childNodes.length)){var j="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");for(P=document.createDocumentFragment(),l=j.length;l--;)P.createElement(j[l])}R=null,A=Function.attempt(function(){return document.createElement("table").innerHTML="",!0});var N,I,D=document.createElement("tr");D.innerHTML="",O=""==D.innerHTML,D=null,A&&O&&M||(Element.Properties.html.set=(N=Element.Properties.html.set,(I={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}).thead=I.tfoot=I.tbody,function(e){if(this.styleSheet)return N.call(this,e);var t=I[this.get("tag")];if(t||M||(t=[0,"",""]),!t)return N.call(this,e);var n=t[0],i=document.createElement("div"),r=i;for(M||P.appendChild(i),i.innerHTML=[t[1],e,t[2]].flatten().join("");n--;)r=r.firstChild;this.empty().adopt(r.childNodes),M||P.removeChild(i),i=null}));var z=document.createElement("form");z.innerHTML="","s"!=z.firstChild.value&&(Element.Properties.value={set:function(e){if("select"!=this.get("tag"))return this.setProperty("value",e);var t=this.getElements("option");e=String(e);for(var n=0;n111&&o<124?this.key="f"+(o-111):o>95&&o<106&&(this.key=o-96)),null==this.key&&(this.key=String.fromCharCode(o).toLowerCase())}else if("click"==i||"dblclick"==i||"contextmenu"==i||"wheel"==i||"DOMMouseScroll"==i||0==i.indexOf("mouse")){var s=n.document;if(s=s.compatMode&&"CSS1Compat"!=s.compatMode?s.body:s.html,this.page={x:null!=t.pageX?t.pageX:t.clientX+s.scrollLeft,y:null!=t.pageY?t.pageY:t.clientY+s.scrollTop},this.client={x:null!=t.pageX?t.pageX-n.pageXOffset:t.clientX,y:null!=t.pageY?t.pageY-n.pageYOffset:t.clientY},"DOMMouseScroll"!=i&&"wheel"!=i&&"mousewheel"!=i||(this.wheel=function(e){var t;if(e.wheelDelta)t=e.wheelDelta%120==0?e.wheelDelta/120:e.wheelDelta/12;else{var n=e.deltaY||e.detail||0;t=-(n%3==0?n/3:10*n)}return t}(t)),this.rightClick=3==t.which||2==t.button,"mouseover"==i||"mouseout"==i||"mouseenter"==i||"mouseleave"==i){for(var a="mouseover"==i||"mouseenter"==i,l=t.relatedTarget||t[(a?"from":"to")+"Element"];l&&3==l.nodeType;)l=l.parentNode;this.relatedTarget=document.id(l)}}else if(0==i.indexOf("touch")||0==i.indexOf("gesture")){this.rotation=t.rotation,this.scale=t.scale,this.targetTouches=t.targetTouches,this.changedTouches=t.changedTouches;var u=this.touches=t.touches;if(u&&u[0]){var c=u[0];this.page={x:c.pageX,y:c.pageY},this.client={x:c.clientX,y:c.clientY}}}this.client||(this.client={}),this.page||(this.page={})});t.implement({stop:function(){return this.preventDefault().stopPropagation()},stopPropagation:function(){return this.event.stopPropagation?this.event.stopPropagation():this.event.cancelBubble=!0,this},preventDefault:function(){return this.event.preventDefault?this.event.preventDefault():this.event.returnValue=!1,this}}),t.defineKey=function(t,n){return e[t]=n,this},t.defineKeys=t.defineKey.overloadSetter(!0),t.defineKeys({38:"up",40:"down",37:"left",39:"right",27:"esc",32:"space",8:"backspace",9:"tab",46:"delete",13:"enter"})}();var Event=this.Event=DOMEvent;Event.Keys={},Event.Keys=new Hash(Event.Keys),function(){Element.Properties.events={set:function(e){this.addEvents(e)}},[Element,Window,Document].invoke("implement",{addEvent:function(e,t){var n=this.retrieve("events",{});if(n[e]||(n[e]={keys:[],values:[]}),n[e].keys.contains(t))return this;n[e].keys.push(t);var i=e,r=Element.Events[e],o=t,s=this;r&&(r.onAdd&&r.onAdd.call(this,t,e),r.condition&&(o=function(n){return!r.condition.call(this,n,e)||t.call(this,n)}),r.base&&(i=Function.convert(r.base).call(this,e)));var a=function(){return t.call(s)},l=Element.NativeEvents[i];return l&&(2==l&&(a=function(e){e=new DOMEvent(e,s.getWindow()),!1===o.call(s,e)&&e.stop()}),this.addListener(i,a,arguments[2])),n[e].values.push(a),this},removeEvent:function(e,t){var n=this.retrieve("events");if(!n||!n[e])return this;var i=n[e],r=i.keys.indexOf(t);if(-1==r)return this;var o=i.values[r];delete i.keys[r],delete i.values[r];var s=Element.Events[e];return s&&(s.onRemove&&s.onRemove.call(this,t,e),s.base&&(e=Function.convert(s.base).call(this,e))),Element.NativeEvents[e]?this.removeListener(e,o,arguments[2]):this},addEvents:function(e){for(var t in e)this.addEvent(t,e[t]);return this},removeEvents:function(e){var t;if("object"==typeOf(e)){for(t in e)this.removeEvent(t,e[t]);return this}var n=this.retrieve("events");if(!n)return this;if(e)n[e]&&(n[e].keys.each(function(t){this.removeEvent(e,t)},this),delete n[e]);else{for(t in n)this.removeEvents(t);this.eliminate("events")}return this},fireEvent:function(e,t,n){var i=this.retrieve("events");return i&&i[e]?(t=Array.convert(t),i[e].keys.each(function(e){n?e.delay(n,this,t):e.apply(this,t)},this),this):this},cloneEvents:function(e,t){var n=(e=document.id(e)).retrieve("events");if(!n)return this;if(t)n[t]&&n[t].keys.each(function(e){this.addEvent(t,e)},this);else for(var i in n)this.cloneEvents(e,i);return this}}),Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,wheel:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,hashchange:1,popstate:2,pageshow:2,pagehide:2,error:1,abort:1,scroll:1,message:2},Element.Events={mousewheel:{base:"onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll"}};var e=function(e){var t=e.relatedTarget;return null==t||!!t&&(t!=this&&"xul"!=t.prefix&&"document"!=typeOf(this)&&!this.contains(t))};"onmouseenter"in document.documentElement?(Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2,Element.MouseenterCheck=e):(Element.Events.mouseenter={base:"mouseover",condition:e},Element.Events.mouseleave={base:"mouseout",condition:e}),window.addEventListener||(Element.NativeEvents.propertychange=2,Element.Events.change={base:function(){var e=this.type;return"input"!=this.get("tag")||"radio"!=e&&"checkbox"!=e?"change":"propertychange"},condition:function(e){return"propertychange"!=e.type||"checked"==e.event.propertyName}}),Element.Events=new Hash(Element.Events)}(),function(){var e=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var t=function(e,t,n,i,r){for(;r&&r!=e;){if(t(r,i))return n.call(r,i,r);r=document.id(r.parentNode)}},n={mouseenter:{base:"mouseover",condition:Element.MouseenterCheck},mouseleave:{base:"mouseout",condition:Element.MouseenterCheck},focus:{base:"focus"+(e?"":"in"),capture:!0},blur:{base:e?"blur":"focusout",capture:!0}},i="$delegation:",r=function(e){return{base:"focusin",remove:function(t,n){var r=t.retrieve(i+e+"listeners",{})[n];if(r&&r.forms)for(var o=r.forms.length;o--;)r.forms[o].removeEvent&&r.forms[o].removeEvent(e,r.fns[o])},listen:function(n,r,o,s,a,l){var u="form"==a.get("tag")?a:s.target.getParent("form");if(u){var c=n.retrieve(i+e+"listeners",{}),p=c[l]||{forms:[],fns:[]},h=p.forms,d=p.fns;if(-1==h.indexOf(u)){h.push(u);var f=function(e){t(n,r,o,e,a)};u.addEvent(e,f),d.push(f),c[l]=p,n.store(i+e+"listeners",c)}}}}},o=function(e){return{base:"focusin",listen:function(n,i,r,o,s){var a={blur:function(){this.removeEvents(a)}};a[e]=function(e){t(n,i,r,e,s)},o.target.addEvents(a)}}};e||Object.append(n,{submit:r("submit"),reset:r("reset"),change:o("change"),select:o("select")});var s=Element.prototype,a=s.addEvent,l=s.removeEvent,u=function(e,t){return function(n,i,r){if(-1==n.indexOf(":relay"))return e.call(this,n,i,r);var o=Slick.parse(n).expressions[0][0];if("relay"!=o.pseudos[0].key)return e.call(this,n,i,r);var s=o.tag;return o.pseudos.slice(1).each(function(e){s+=":"+e.key+(e.value?"("+e.value+")":"")}),e.call(this,n,i),t.call(this,s,o.pseudos[0].value,i)}},c={addEvent:function(e,i,r){var o=this.retrieve("$delegates",{}),s=o[e];if(s)for(var l in s)if(s[l].fn==r&&s[l].match==i)return this;var u=e,c=i,p=r,h=n[e]||{};e=h.base||u,i=function(e){return Slick.match(e,c)};var d=Element.Events[u];if(h.condition||d&&d.condition){var f=i,y=h.condition||d.condition;i=function(t,n){return f(t,n)&&y.call(t,n,e)}}var m=this,g=String.uniqueID(),_=h.listen?function(e,t){!t&&e&&e.target&&(t=e.target),t&&h.listen(m,i,r,e,t,g)}:function(e,n){!n&&e&&e.target&&(n=e.target),n&&t(m,i,r,e,n)};return s||(s={}),s[g]={match:c,fn:p,delegator:_},o[u]=s,a.call(this,e,_,h.capture)},removeEvent:function(e,t,i,r){var o,s,a=this.retrieve("$delegates",{}),u=a[e];if(!u)return this;if(r){var p=e,h=u[r].delegator,d=n[e]||{};return e=d.base||p,d.remove&&d.remove(this,r),delete u[r],a[p]=u,l.call(this,e,h,d.capture)}if(i){for(o in u)if((s=u[o]).match==t&&s.fn==i)return c.removeEvent.call(this,e,t,i,o)}else for(o in u)(s=u[o]).match==t&&c.removeEvent.call(this,e,t,s.fn,o);return this}};[Element,Window,Document].invoke("implement",{addEvent:u(a,c.addEvent),removeEvent:u(l,c.removeEvent)})}(),function(){var e,t=document.html;(e=document.createElement("div")).style.color="red",e.style.color=null;var n="red"==e.style.color;e.style.border="1px solid #123abc";var i="1px solid #123abc"!=e.style.border;e=null;var r=!!window.getComputedStyle,o=null!=document.createElement("div").style.borderRadius;Element.Properties.styles={set:function(e){this.setStyles(e)}};var s=null!=t.style.opacity,a=null!=t.style.filter,l=/alpha\(opacity=([\d.]+)\)/i,u=function(e,t){e.store("$opacity",t),e.style.visibility=t>0||null==t?"visible":"hidden"},c=function(e,t,n){var i=e.style,r=i.filter||e.getComputedStyle("filter")||"";i.filter=(t.test(r)?r.replace(t,n):r+" "+n).trim(),i.filter||i.removeAttribute("filter")},p=s?function(e,t){e.style.opacity=t}:a?function(e,t){e.currentStyle&&e.currentStyle.hasLayout||(e.style.zoom=1),null==t||1==t?(c(e,l,""),1==t&&1!=h(e)&&c(e,l,"alpha(opacity=100)")):c(e,l,"alpha(opacity="+(100*t).limit(0,100).round()+")")}:u,h=s?function(e){var t=e.style.opacity||e.getComputedStyle("opacity");return""==t?1:t.toFloat()}:a?function(e){var t,n=e.style.filter||e.getComputedStyle("filter");return n&&(t=n.match(l)),null==t||null==n?1:t[1]/100}:function(e){var t=e.retrieve("$opacity");return null==t&&(t="hidden"==e.style.visibility?0:1),t},d=null==t.style.cssFloat?"styleFloat":"cssFloat",f={left:"0%",top:"0%",center:"50%",right:"100%",bottom:"100%"},y=null!=t.style.backgroundPositionX,m=/^-(ms)-/,g=function(e){return e.replace(m,"$1-").camelCase()};Element.implement({getComputedStyle:function(e){if(!r&&this.currentStyle)return this.currentStyle[g(e)];var t=Element.getDocument(this).defaultView,n=t?t.getComputedStyle(this,null):null;return n?n.getPropertyValue(e==d?"float":e.hyphenate()):""},setStyle:function(e,t){if("opacity"==e)return null!=t&&(t=parseFloat(t)),p(this,t),this;if(e=g("float"==e?d:e),"string"!=typeOf(t)){var i=(Element.Styles[e]||"@").split(" ");t=Array.convert(t).map(function(e,t){return i[t]?"number"==typeOf(e)?i[t].replace("@",Math.round(e)):e:""}).join(" ")}else t==String(Number(t))&&(t=Math.round(t));return this.style[e]=t,(""==t||null==t)&&n&&this.style.removeAttribute&&function(e,t){"backgroundPosition"==t&&(e.removeAttribute(t+"X"),t+="Y"),e.removeAttribute(t)}(this.style,e),this},getStyle:function(e){if("opacity"==e)return h(this);if(e=g("float"==e?d:e),o&&-1!=e.indexOf("borderRadius"))return["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"].map(function(e){return this.style[e]||"0px"},this).join(" ");var t=this.style[e];if(!t||"zIndex"==e){if(Element.ShortStyles.hasOwnProperty(e)){for(var n in t=[],Element.ShortStyles[e])t.push(this.getStyle(n));return t.join(" ")}t=this.getComputedStyle(e)}if(y&&/^backgroundPosition[XY]?$/.test(e))return t.replace(/(top|right|bottom|left)/g,function(e){return f[e]})||"0px";if(!t&&"backgroundPosition"==e)return"0px 0px";if(t){var s=(t=String(t)).match(/rgba?\([\d\s,]+\)/);s&&(t=t.replace(s[0],s[0].rgbToHex()))}if(!r&&!this.style[e]){if(/^(height|width)$/.test(e)&&!/px$/.test(t)){var a=0;return("width"==e?["left","right"]:["top","bottom"]).each(function(e){a+=this.getStyle("border-"+e+"-width").toInt()+this.getStyle("padding-"+e).toInt()},this),this["offset"+e.capitalize()]-a+"px"}if(/^border(.+)Width|margin|padding/.test(e)&&isNaN(parseFloat(t)))return"0px"}return i&&/^border(Top|Right|Bottom|Left)?$/.test(e)&&/^#/.test(t)?t.replace(/^(.+)\s(.+)\s(.+)$/,"$2 $3 $1"):t},setStyles:function(e){for(var t in e)this.setStyle(t,e[t]);return this},getStyles:function(){var e={};return Array.flatten(arguments).each(function(t){e[t]=this.getStyle(t)},this),e}}),Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundSize:"@px",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@",borderRadius:"@px @px @px @px"},Element.implement({setOpacity:function(e){return p(this,e),this},getOpacity:function(){return h(this)}}),Element.Properties.opacity={set:function(e){p(this,e),u(this,e)},get:function(){return h(this)}},Element.Styles=new Hash(Element.Styles),Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}},["Top","Right","Bottom","Left"].each(function(e){var t=Element.ShortStyles,n=Element.Styles;["margin","padding"].each(function(i){var r=i+e;t[i][r]=n[r]="@px"});var i="border"+e;t.border[i]=n[i]="@px @ rgb(@, @, @)";var r=i+"Width",o=i+"Style",s=i+"Color";t[i]={},t.borderWidth[r]=t[i][r]=n[r]="@px",t.borderStyle[o]=t[i][o]=n[o]="@",t.borderColor[s]=t[i][s]=n[s]="rgb(@, @, @)"}),y&&(Element.ShortStyles.backgroundPosition={backgroundPositionX:"@",backgroundPositionY:"@"})}(),function(){var e=document.createElement("div"),t=document.createElement("div");e.style.height="0",e.appendChild(t);var n=t.offsetParent===e;e=t=null;var i=["height","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],r=["width","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],o=function(e){return"static"!=a(e,"position")||h(e)},s=function(e){return o(e)||/^(?:table|td|th)$/i.test(e.tagName)};Element.implement({scrollTo:function(e,t){return h(this)?this.getWindow().scrollTo(e,t):(this.scrollLeft=e,this.scrollTop=t),this},getSize:function(){if(h(this))return this.getWindow().getSize();if(!window.getComputedStyle)return{x:this.offsetWidth,y:this.offsetHeight};if("svg"==this.get("tag"))return function(e){var t=window.getComputedStyle(e),n={x:0,y:0};return i.each(function(e){n.y+=parseFloat(t[e])}),r.each(function(e){n.x+=parseFloat(t[e])}),n}(this);try{var e=this.getBoundingClientRect();return{x:e.width,y:e.height}}catch(e){return{x:0,y:0}}},getScrollSize:function(){return h(this)?this.getWindow().getScrollSize():{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){return h(this)?this.getWindow().getScroll():{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){for(var e=this.parentNode,t={x:0,y:0};e&&!h(e);)t.x+=e.scrollLeft,t.y+=e.scrollTop,e=e.parentNode;return t},getOffsetParent:n?function(){var e=this;if(h(e)||"fixed"==a(e,"position"))return null;for(var t="static"==a(e,"position")?s:o;e=e.parentNode;)if(t(e))return e;return null}:function(){if(h(this)||"fixed"==a(this,"position"))return null;try{return this.offsetParent}catch(e){}return null},getOffsets:function(){var e=this.getBoundingClientRect;if(e=e&&!Browser.Platform.ios){var t=this.getBoundingClientRect(),n=document.id(this.getDocument().documentElement),i=n.getScroll(),r=this.getScrolls(),o="fixed"==a(this,"position");return{x:t.left.toFloat()+r.x+(o?0:i.x)-n.clientLeft,y:t.top.toFloat()+r.y+(o?0:i.y)-n.clientTop}}var s=this,l={x:0,y:0};if(h(this))return l;for(;s&&!h(s);){if(l.x+=s.offsetLeft,l.y+=s.offsetTop,Browser.firefox){u(s)||(l.x+=p(s),l.y+=c(s));var d=s.parentNode;d&&"visible"!=a(d,"overflow")&&(l.x+=p(d),l.y+=c(d))}else s!=this&&Browser.safari&&(l.x+=p(s),l.y+=c(s));s=s.offsetParent}return Browser.firefox&&!u(this)&&(l.x-=p(this),l.y-=c(this)),l},getPosition:function(e){var t=this.getOffsets(),n=this.getScrolls(),i={x:t.x-n.x,y:t.y-n.y};if(e&&(e=document.id(e))){var r=e.getPosition();return{x:i.x-r.x-p(e),y:i.y-r.y-c(e)}}return i},getCoordinates:function(e){if(h(this))return this.getWindow().getCoordinates();var t=this.getPosition(e),n=this.getSize(),i={left:t.x,top:t.y,width:n.x,height:n.y};return i.right=i.left+i.width,i.bottom=i.top+i.height,i},computePosition:function(e){return{left:e.x-l(this,"margin-left"),top:e.y-l(this,"margin-top")}},setPosition:function(e){return this.setStyles(this.computePosition(e))}}),[Document,Window].invoke("implement",{getSize:function(){var e=d(this);return{x:e.clientWidth,y:e.clientHeight}},getScroll:function(){var e=this.getWindow(),t=d(this);return{x:e.pageXOffset||t.scrollLeft,y:e.pageYOffset||t.scrollTop}},getScrollSize:function(){var e=d(this),t=this.getSize(),n=this.getDocument().body;return{x:Math.max(e.scrollWidth,n.scrollWidth,t.x),y:Math.max(e.scrollHeight,n.scrollHeight,t.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var e=this.getSize();return{top:0,left:0,bottom:e.y,right:e.x,height:e.y,width:e.x}}});var a=Element.getComputedStyle;function l(e,t){return a(e,t).toInt()||0}function u(e){return"border-box"==a(e,"-moz-box-sizing")}function c(e){return l(e,"border-top-width")}function p(e){return l(e,"border-left-width")}function h(e){return/^(?:body|html)$/i.test(e.tagName)}function d(e){var t=e.getDocument();return t.compatMode&&"CSS1Compat"!=t.compatMode?t.body:t.html}}(),Element.alias({position:"setPosition"}),[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}}),function(){var e=this.Fx=new Class({Implements:[Chain,Events,Options,Class.Thenable],options:{fps:60,unit:!1,duration:500,frames:null,frameSkip:!0,link:"ignore"},initialize:function(e){this.subject=this.subject||this,this.setOptions(e)},getTransition:function(){return function(e){return-(Math.cos(Math.PI*e)-1)/2}},step:function(e){if(this.options.frameSkip){var t=(null!=this.time?e-this.time:0)/this.frameInterval;this.time=e,this.frame+=t}else this.frame++;if(this.frame-1&&-1==t.indexOf(document.domain))){var n=e.rules||e.cssRules;i(n)}}),Fx.CSS.Cache[e]=t}}),Fx.CSS.Cache={},Fx.CSS.Parsers={Color:{parse:function(e){return e.match(/^#[0-9a-f]{3,6}$/i)?e.hexToRgb(!0):!!(e=e.match(/(\d+),\s*(\d+),\s*(\d+)/))&&[e[1],e[2],e[3]]},compute:function(e,t,n){return e.map(function(i,r){return Math.round(Fx.compute(e[r],t[r],n))})},serve:function(e){return e.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(e,t){return t?e+t:e}},String:{parse:Function.convert(!1),compute:function(e,t){return t},serve:function(e){return e}}},Fx.CSS.Parsers=new Hash(Fx.CSS.Parsers),Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(e,t){this.element=this.subject=document.id(e),this.parent(t)},set:function(e){for(var t in"string"==typeof e&&(e=this.search(e)),e)this.render(this.element,t,e[t],this.options.unit);return this},compute:function(e,t,n){var i={};for(var r in e)i[r]=this.parent(e[r],t[r],n);return i},start:function(e){if(!this.check(e))return this;"string"==typeof e&&(e=this.search(e));var t={},n={};for(var i in e){var r=this.prepare(this.element,i,e[i]);t[i]=r.from,n[i]=r.to}return this.parent(t,n)}}),Element.Properties.morph={set:function(e){return this.get("morph").cancel().setOptions(e),this},get:function(){var e=this.retrieve("morph");return e||(e=new Fx.Morph(this,{link:"cancel"}),this.store("morph",e)),e}},Element.implement({morph:function(e){return this.get("morph").start(e),this}}),Fx.implement({getTransition:function(){var e=this.options.transition||Fx.Transitions.Sine.easeInOut;if("string"==typeof e){var t=e.split(":");e=(e=Fx.Transitions)[t[0]]||e[t[0].capitalize()],t[1]&&(e=e["ease"+t[1].capitalize()+(t[2]?t[2].capitalize():"")])}return e}}),Fx.Transition=function(e,t){t=Array.convert(t);var n=function(n){return e(n,t)};return Object.append(n,{easeIn:n,easeOut:function(n){return 1-e(1-n,t)},easeInOut:function(n){return(n<=.5?e(2*n,t):2-e(2*(1-n),t))/2}})},Fx.Transitions={linear:function(e){return e}},Fx.Transitions=new Hash(Fx.Transitions),Fx.Transitions.extend=function(e){for(var t in e)Fx.Transitions[t]=new Fx.Transition(e[t])},Fx.Transitions.extend({Pow:function(e,t){return Math.pow(e,t&&t[0]||6)},Expo:function(e){return Math.pow(2,8*(e-1))},Circ:function(e){return 1-Math.sin(Math.acos(e))},Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Back:function(e,t){return t=t&&t[0]||1.618,Math.pow(e,2)*((t+1)*e-t)},Bounce:function(e){for(var t,n=0,i=1;;n+=i,i/=2)if(e>=(7-4*n)/11){t=i*i-Math.pow((11-6*n-11*e)/4,2);break}return t},Elastic:function(e,t){return Math.pow(2,10*--e)*Math.cos(20*e*Math.PI*(t&&t[0]||1)/3)}}),["Quad","Cubic","Quart","Quint"].each(function(e,t){Fx.Transitions[e]=new Fx.Transition(function(e){return Math.pow(e,t+2)})}),Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(e,t){this.element=this.subject=document.id(e),this.parent(t)},set:function(e,t){return 1==arguments.length&&(t=e,e=this.property||this.options.property),this.render(this.element,e,t,this.options.unit),this},start:function(e,t,n){if(!this.check(e,t,n))return this;var i=Array.flatten(arguments);this.property=this.options.property||i.shift();var r=this.prepare(this.element,this.property,i);return this.parent(r.from,r.to)}}),Element.Properties.tween={set:function(e){return this.get("tween").cancel().setOptions(e),this},get:function(){var e=this.retrieve("tween");return e||(e=new Fx.Tween(this,{link:"cancel"}),this.store("tween",e)),e}},Element.implement({tween:function(e,t,n){return this.get("tween").start(e,t,n),this},fade:function(){var e,t,n=this.get("tween"),i=["opacity"].append(arguments);switch(null==i[1]&&(i[1]="toggle"),i[1]){case"in":e="start",i[1]=1;break;case"out":e="start",i[1]=0;break;case"show":e="set",i[1]=1;break;case"hide":e="set",i[1]=0;break;case"toggle":var r=this.retrieve("fade:flag",1==this.getStyle("opacity"));e="start",i[1]=r?0:1,this.store("fade:flag",!r),t=!0;break;default:e="start"}t||this.eliminate("fade:flag"),n[e].apply(n,i);var o=i[i.length-1];return"set"==e?this.setStyle("visibility",0==o?"hidden":"visible"):0!=o?n.$chain.length?n.chain(function(){this.element.setStyle("visibility","visible"),this.callChain()}):this.setStyle("visibility","visible"):n.chain(function(){this.element.getStyle("opacity")||(this.element.setStyle("visibility","hidden"),this.callChain())}),this},highlight:function(e,t){t||(t="transparent"==(t=this.retrieve("highlight:original",this.getStyle("background-color")))?"#fff":t);var n=this.get("tween");return n.start("background-color",e||"#ffff88",t).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")),n.callChain()}.bind(this)),this}}),function(){var e=function(){},t="onprogress"in new Browser.Request,n=this.Request=new Class({Implements:[Chain,Events,Options,Class.Thenable],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:!0,format:!1,method:"post",link:"ignore",isSuccess:null,emulation:!0,urlEncoded:!0,encoding:"utf-8",evalScripts:!1,evalResponse:!1,timeout:0,noCache:!1},initialize:function(e){this.xhr=new Browser.Request,this.setOptions(e),this.headers=this.options.headers},onStateChange:function(){var n=this.xhr;4==n.readyState&&this.running&&(this.running=!1,this.status=0,Function.attempt(function(){var e=n.status;this.status=1223==e?204:e}.bind(this)),n.onreadystatechange=e,t&&(n.onprogress=n.onloadstart=e),this.timer&&(clearTimeout(this.timer),delete this.timer),this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML},this.options.isSuccess.call(this,this.status)?this.success(this.response.text,this.response.xml):this.failure())},isSuccess:function(){var e=this.status;return e>=200&&e<300},isRunning:function(){return!!this.running},processScripts:function(e){return this.options.evalResponse||/(ecma|java)script/.test(this.getHeader("Content-type"))?Browser.exec(e):e.stripScripts(this.options.evalScripts)},success:function(e,t){this.onSuccess(this.processScripts(e),t),this.resolve({text:e,xml:t})},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure(),this.reject({reason:"failure",xhr:this.xhr})},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr])},progress:function(e){this.fireEvent("progress",[e,this.xhr])},timeout:function(){this.fireEvent("timeout",this.xhr),this.reject({reason:"timeout",xhr:this.xhr})},setHeader:function(e,t){return this.headers[e]=t,this},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e)}.bind(this))},check:function(){if(!this.running)return!0;switch(this.options.link){case"cancel":return this.cancel(),!0;case"chain":return this.chain(this.caller.pass(arguments,this)),!1}return!1},send:function(e){if(!this.check(e))return this;this.options.isSuccess=this.options.isSuccess||this.isSuccess,this.running=!0;var n=typeOf(e);"string"!=n&&"element"!=n||(e={data:e});var i=this.options,r=(e=Object.append({data:i.data,url:i.url,method:i.method},e)).data,o=String(e.url),s=e.method.toLowerCase();switch(typeOf(r)){case"element":r=document.id(r).toQueryString();break;case"object":case"hash":r=Object.toQueryString(r)}if(this.options.format){var a="format="+this.options.format;r=r?a+"&"+r:a}if(this.options.emulation&&!["get","post"].contains(s)){var l="_method="+s;r=r?l+"&"+r:l,s="post"}if(this.options.urlEncoded&&["post","put"].contains(s)){var u=this.options.encoding?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+u}o||(o=document.location.pathname);var c=o.lastIndexOf("/");c>-1&&(c=o.indexOf("#"))>-1&&(o=o.substr(0,c)),this.options.noCache&&(o+=(o.indexOf("?")>-1?"&":"?")+String.uniqueID()),!r||"get"!=s&&"delete"!=s||(o+=(o.indexOf("?")>-1?"&":"?")+r,r=null);var p=this.xhr;return t&&(p.onloadstart=this.loadstart.bind(this),p.onprogress=this.progress.bind(this)),p.open(s.toUpperCase(),o,this.options.async,this.options.user,this.options.password),(this.options.user||this.options.withCredentials)&&"withCredentials"in p&&(p.withCredentials=!0),p.onreadystatechange=this.onStateChange.bind(this),Object.each(this.headers,function(e,t){try{p.setRequestHeader(t,e)}catch(n){this.fireEvent("exception",[t,e]),this.reject({reason:"exception",xhr:p,exception:n})}},this),"pending"!==this.getThenableState()&&this.resetThenable({reason:"send"}),this.fireEvent("request"),p.send(r),this.options.async?this.options.timeout&&(this.timer=this.timeout.delay(this.options.timeout,this)):this.onStateChange(),this},cancel:function(){if(!this.running)return this;this.running=!1;var n=this.xhr;return n.abort(),this.timer&&(clearTimeout(this.timer),delete this.timer),n.onreadystatechange=e,t&&(n.onprogress=n.onloadstart=e),this.xhr=new Browser.Request,this.fireEvent("cancel"),this.reject({reason:"cancel",xhr:n}),this}}),i={};["get","post","put","delete","patch","head","GET","POST","PUT","DELETE","PATCH","HEAD"].each(function(e){i[e]=function(t){var n={method:e};return null!=t&&(n.data=t),this.send(n)}}),n.implement(i),Element.Properties.send={set:function(e){return this.get("send").cancel().setOptions(e),this},get:function(){var e=this.retrieve("send");return e||(e=new n({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}),this.store("send",e)),e}},Element.implement({send:function(e){var t=this.get("send");return t.send({data:this,url:e||t.options.url}),this}})}(),Request.HTML=new Class({Extends:Request,options:{update:!1,append:!1,evalScripts:!0,filter:!1,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var t=this.options,n=this.response;n.html=e.stripScripts(function(e){n.javascript=e});var i=n.html.match(/]*>([\s\S]*?)<\/body>/i);i&&(n.html=i[1]);var r=new Element("div").set("html",n.html);if(n.tree=r.childNodes,n.elements=r.getElements(t.filter||"*"),t.filter&&(n.tree=n.elements),t.update){var o=document.id(t.update).empty();t.filter?o.adopt(n.elements):o.set("html",n.html)}else if(t.append){var s=document.id(t.append);t.filter?n.elements.reverse().inject(s):s.adopt(r.getChildren())}t.evalScripts&&Browser.exec(n.javascript),this.onSuccess(n.tree,n.elements,n.html,n.javascript),this.resolve({tree:n.tree,elements:n.elements,html:n.html,javascript:n.javascript})}}),Element.Properties.load={set:function(e){return this.get("load").cancel().setOptions(e),this},get:function(){var e=this.retrieve("load");return e||(e=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}),this.store("load",e)),e}},Element.implement({load:function(){return this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})),this}}),"undefined"==typeof JSON&&(this.JSON={}),JSON=new Hash({stringify:JSON.stringify,parse:JSON.parse}),function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},escape=function(e){return special[e]||"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)};JSON.validate=function(e){return e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""),/^[\],:{}\s]*$/.test(e)},JSON.encode=JSON.stringify?function(e){return JSON.stringify(e)}:function(e){switch(e&&e.toJSON&&(e=e.toJSON()),typeOf(e)){case"string":return'"'+e.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+e.map(JSON.encode).clean()+"]";case"object":case"hash":var t=[];return Object.each(e,function(e,n){var i=JSON.encode(e);i&&t.push(JSON.encode(n)+":"+i)}),"{"+t+"}";case"number":case"boolean":return""+e;case"null":return"null"}return null},JSON.secure=!0,JSON.secure=!1,JSON.decode=function(string,secure){if(!string||"string"!=typeOf(string))return null;if(null==secure&&(secure=JSON.secure),secure){if(JSON.parse)return JSON.parse(string);if(!JSON.validate(string))throw new Error("JSON could not decode the input; security is enabled and the value is not secure.")}return eval("("+string+")")}}(),Request.JSON=new Class({Extends:Request,options:{secure:!0},initialize:function(e){this.parent(e),Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"})},success:function(e){var t;try{t=this.response.json=JSON.decode(e,this.options.secure)}catch(t){return void this.fireEvent("error",[e,t])}null==t?this.failure():(this.onSuccess(t,e),this.resolve({json:t,text:e}))}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:!1,duration:!1,secure:!1,document:document,encode:!0,httpOnly:!1},initialize:function(e,t){this.key=e,this.setOptions(t)},write:function(e){if(this.options.encode&&(e=encodeURIComponent(e)),this.options.domain&&(e+="; domain="+this.options.domain),this.options.path&&(e+="; path="+this.options.path),this.options.duration){var t=new Date;t.setTime(t.getTime()+24*this.options.duration*60*60*1e3),e+="; expires="+t.toGMTString()}return this.options.secure&&(e+="; secure"),this.options.httpOnly&&(e+="; HttpOnly"),this.options.document.cookie=this.key+"="+e,this},read:function(){var e=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return e?decodeURIComponent(e[1]):null},dispose:function(){return new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write(""),this}});Cookie.write=function(e,t,n){return new Cookie(e,n).write(t)},Cookie.read=function(e){return new Cookie(e).read()},Cookie.dispose=function(e,t){return new Cookie(e,t).dispose()},function(e,t){var n,i,r,o,s=[],a=t.createElement("div"),l=function(){clearTimeout(o),n||(Browser.loaded=n=!0,t.removeListener("DOMContentLoaded",l).removeListener("readystatechange",u),t.fireEvent("domready"),e.fireEvent("domready")),t=e=a=null},u=function(){for(var e=s.length;e--;)if(s[e]())return l(),!0;return!1},c=function(){clearTimeout(o),u()||(o=setTimeout(c,10))};t.addListener("DOMContentLoaded",l);var p=function(){try{return a.doScroll(),!0}catch(e){}return!1};a.doScroll&&!p()&&(s.push(p),r=!0),t.readyState&&s.push(function(){var e=t.readyState;return"loaded"==e||"complete"==e}),"onreadystatechange"in t?t.addListener("readystatechange",u):r=!0,r&&c(),Element.Events.domready={onAdd:function(e){n&&e.call(this)}},Element.Events.load={base:"load",onAdd:function(t){i&&this==e&&t.call(this)},condition:function(){return this==e&&(l(),delete Element.Events.load),!0}},e.addEvent("load",function(){i=!0})}(window,document),MooTools.More={version:"1.6.0",build:"45b71db70f879781a7e0b0d3fb3bb1307c2521eb"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||["tween","morph","reveal"]).each(function(e){(e=this.get(e))&&e.setOptions({link:"chain"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||"tween").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement("initialize",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){var n=(t=document.id(t||this.element)).retrieve(e||this.property);return n&&!this.occluded?this.occluded=n:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,n){var i=e.prototype[n];i=i&&i.$origin||i||function(){},e.implement(n,"function"==typeof t?function(){var e=this.previous;this.previous=i;var n=t.apply(this,arguments);return this.previous=e,n}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,n=new Class(e);return function(){if(t)return t;(t=Object.append({},n.prototype)).constructor=n;var e=n.apply(t,arguments);return t="object"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,n){var i=function(e){return{store:e.store?function(t,n){e.store("_monitorEvents:"+t,n)}:function(t,n){(e._monitorEvents||(e._monitorEvents={}))[t]=n},retrieve:e.retrieve?function(t,n){return e.retrieve("_monitorEvents:"+t,n)}:function(t,n){return e._monitorEvents&&e._monitorEvents[t]||n}}},r=function(t){if(-1==t.indexOf(":")||!e)return null;for(var n=Slick.parse(t).expressions[0][0],i=n.pseudos,r=i.length,o=[];r--;){var s=i[r].key,a=e[s];null!=a&&o.push({event:n.tag,value:i[r].value,pseudo:s,original:t,listener:a})}return o.length?o:null};return{addEvent:function(e,n,o){var s=r(e);if(!s)return t.call(this,e,n,o);var a=i(this),l=a.retrieve(e,[]),u=s[0].event,c=Array.slice(arguments,2),p=n,h=this;return s.each(function(e){var t=e.listener,n=p;0==t?u+=":"+e.pseudo+"("+e.value+")":p=function(){t.call(h,e,n,arguments,p)}}),l.include({type:u,event:n,monitor:p}),a.store(e,l),e!=u&&t.apply(this,[e,n].concat(c)),t.apply(this,[u,p].concat(c))},removeEvent:function(e,t){if(!r(e))return n.call(this,e,t);var o=i(this),s=o.retrieve(e);if(!s)return this;var a=Array.slice(arguments,2);return n.apply(this,[e,t].concat(a)),s.each(function(e,i){t&&e.event!=t||n.apply(this,[e.type,e.monitor].concat(a)),delete s[i]},this),o.store(e,s),this}}};var e={once:function(e,t,n,i){t.apply(this,n),this.removeEvent(e.event,i).removeEvent(e.original,t)},throttle:function(e,t,n){t._throttled||(t.apply(this,n),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,n){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,n)}};Events.definePseudo=function(t,n){return e[t]=n,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),["Request","Fx"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(t){if(e(this))return t.call(this);for(var n=this.getParent(),i=[];!e(n)&&n!=document.body;)i.push(n.expose()),n=n.getParent();var r=this.expose(),o=t.call(this);return r(),i.each(function(e){e()}),o},expose:function(){if("none"!=this.getStyle("display"))return function(){};var e=this.style.cssText;return this.setStyles({display:"block",position:"absolute",visibility:"hidden"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},n=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},i=this.getParent("body");if(i&&"none"==this.getStyle("display"))t=this.measure(function(){return n(this,e)});else if(i)try{t=n(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(e){e&&e.plains&&(e.planes=e.plains);var t,n={},i={width:0,height:0};return"vertical"==(e=Object.merge({styles:["padding","border"],planes:{height:["top","bottom"],width:["left","right"]},mode:"both"},e)).mode?(delete i.width,delete e.planes.width):"horizontal"==e.mode&&(delete i.height,delete e.planes.height),function(e,t){var n=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){n.push(e+"-"+t+("border"==e?"-width":""))})})}),n}(e.styles,e.planes).each(function(e){n[e]=this.getStyle(e).toInt()},this),Object.each(e.planes,function(e,r){var o=r.capitalize(),s=this.getStyle(r);"auto"!=s||t||(t=this.getDimensions()),s=n[r]="auto"==s?t[r]:s.toInt(),i["total"+o]=s,e.each(function(e){var t=function(e,t){var n=0;return Object.each(t,function(t,i){i.test(e)&&(n+=t.toInt())}),n}(e,n);i["computed"+e.capitalize()]=t,i["total"+o]+=t})},this),Object.append(i,n)}})}(),function(){for(var e={relay:!1},t=["once","throttle","pause"],n=t.length;n--;)e[t[n]]=Events.lookupPseudo(t[n]);DOMEvent.definePseudo=function(t,n){return e[t]=n,this};var i=Element.prototype;[Element,Window,Document].invoke("implement",Events.Pseudos(e,i.addEvent,i.removeEvent))}(),DOMEvent.definePseudo("keys",function(e,t,n){var i=n[0],r=[],o=this.retrieve("$moo:keys-pressed",[]),s=e.value;if("+"!=s?r.append(s.replace("++",function(){return r.push("+"),""}).split("+")):r=["+"],o.include(i.key),r.every(function(e){return o.contains(e)})&&t.apply(this,n),this.store("$moo:keys-pressed",o),!this.retrieve("$moo:keys-keyup")){var a=function(e){(function(){o=this.retrieve("$moo:keys-pressed",[]).erase(e.key),this.store("$moo:keys-pressed",o)}).delay(0,this)};this.store("$moo:keys-keyup",a).addEvent("keyup",a)}}),DOMEvent.defineKeys({16:"shift",17:"control",18:"alt",20:"capslock",33:"pageup",34:"pagedown",35:"end",36:"home",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",107:"+",109:"-",189:"-"}),function(){var e={a:/[àáâãäåăą]/g,A:/[ÀÁÂÃÄÅĂĄ]/g,c:/[ćčç]/g,C:/[ĆČÇ]/g,d:/[ďđ]/g,D:/[ĎÐ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ğ]/g,G:/[Ğ]/g,i:/[ìíîï]/g,I:/[ÌÍÎÏ]/g,l:/[ĺľł]/g,L:/[ĹĽŁ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[ššş]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,u:/[ùúûůüµ]/g,U:/[ÙÚÛŮÜ]/g,y:/[ÿý]/g,Y:/[ŸÝ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ð]/g,ss:/[ß]/g,oe:/[œ]/g,OE:/[Œ]/g,ae:/[æ]/g,AE:/[Æ]/g},t={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"»":/[\uFFFD]/g},n={ms:1,s:1e3,m:6e4,h:36e5},i=/(\d*.?\d+)([msh]+)/,r=function(e,t){var n,i=e;for(n in t)i=i.replace(t[n],n);return i},o=function(e,t){return e=e||(t?"":"\\w+"),new RegExp(t?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)":"|<"+e+"[\\s|/][^>]*>","gi")};String.implement({standardize:function(){return r(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,n){if(this.length>=e)return this;var i=(null==t?" ":""+t).repeat(e-this.length).substr(0,e-this.length);return n&&"right"!=n?"left"==n?i+this:i.substr(0,(i.length/2).floor())+this+i.substr(0,(i.length/2).ceil()):this+i},getTags:function(e,t){return this.match(o(e,t))||[]},stripTags:function(e,t){return this.replace(o(e,t),"")},tidy:function(){return r(this,t)},truncate:function(e,t,n){var i=this;if(null==t&&1==arguments.length&&(t="…"),i.length>e){if(i=i.substring(0,e),n){var r=i.lastIndexOf(n);-1!=r&&(i=i.substr(0,r))}t&&(i+=t)}return i},ms:function(){var e=i.exec(this);return null==e?Number(this):Number(e[1])*n[e[2]]}})}(),Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(e,t){return this.get("value").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var n=t.duplicate();if("text"==this.type)e.start=0-n.moveStart("character",-1e5),e.end=e.start+t.text.length;else{var i=this.get("value"),r=i.length;n.moveToElementText(this),n.setEndPoint("StartToEnd",t),n.text.length&&(r-=i.match(/[\n\r]*$/)[0].length),e.end=r-n.text.length,n.setEndPoint("StartToStart",t),e.start=r-n.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return"end"==e&&(e=this.get("value").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var n=this.get("value"),i=n.substr(e,t-e).replace(/\r/g,"").length;e=n.substr(0,e).replace(/\r/g,"").length;var r=this.createTextRange();r.collapse(!0),r.moveEnd("character",e+i),r.moveStart("character",e),r.select()}return this},insertAtCursor:function(e,t){var n=this.getSelectedRange(),i=this.get("value");return this.set("value",i.substring(0,n.start)+e+i.substring(n.end,i.length)),!1!==t?this.selectRange(n.start,n.start+e.length):this.setCaretPosition(n.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:"",defaultMiddle:"",after:""},e);var n=this.getSelectedText()||e.defaultMiddle,i=this.getSelectedRange(),r=this.get("value");if(i.start==i.end)this.set("value",r.substring(0,i.start)+e.before+n+e.after+r.substring(i.end,r.length)),this.selectRange(i.start+e.before.length,i.end+e.before.length+n.length);else{var o=r.substring(i.start,i.end);this.set("value",r.substring(0,i.start)+e.before+o+e.after+r.substring(i.end,r.length));var s=i.start+e.before.length;!1!==t?this.selectRange(s,s+o.length):this.setCaretPosition(s+r.length)}return this}}),function(){var e=!1,t=!1;Element.implement({pin:function(n,i){var r;if(t||(r=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body),e=0===r.offsetTop,r.dispose(),t=!0),"none"==this.getStyle("display"))return this;var o,s,a,l=window.getScroll();if(!1!==n){if(o=this.getPosition(),!this.retrieve("pin:_pinned")){var u={top:o.y-l.y,left:o.x-l.x,margin:"0px",padding:"0px"};if(e&&!i)this.setStyle("position","fixed").setStyles(u);else{s=this.getOffsetParent();var c=this.getPosition(s),p=this.getStyles("left","top");(s&&"auto"==p.left||"auto"==p.top)&&this.setPosition(c),"static"==this.getStyle("position")&&this.setStyle("position","absolute"),c={x:p.left.toInt()-l.x,y:p.top.toInt()-l.y},a=function(){if(this.retrieve("pin:_pinned")){var e=window.getScroll();this.setStyles({left:c.x+e.x,top:c.y+e.y})}}.bind(this),this.store("pin:_scrollFixer",a),window.addEvent("scroll",a)}this.store("pin:_pinned",!0)}}else{if(!this.retrieve("pin:_pinned"))return this;"static"!=(s=this.getParent()).getComputedStyle("position")||s.getOffsetParent();o=this.getPosition(),this.store("pin:_pinned",!1),(a=this.retrieve("pin:_scrollFixer"))?(this.store("pin:_scrollFixer",null),window.removeEvent("scroll",a)):this.setStyles({position:"absolute",top:o.y+l.y,left:o.x+l.x}),this.removeClass("isPinned")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve("pin:_pinned"))}}),Element.alias("togglepin","togglePin")}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(e,n){return n=Object.merge({},t.options,n),t.setPositionOption(n),t.setEdgeOption(n),t.setOffsetOption(e,n),t.setDimensionsOption(e,n),n},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var n=t.getCoordinateFromValue(e.edge);e.edge=n||("center"==e.position.x&&"center"==e.position.y?{x:"center",y:"center"}:{x:"left",y:"top"})},setOffsetOption:function(e,t){var n,i,r=e.measure(function(){return document.id(this.getOffsetParent())});r&&r!=e.getDocument().body&&(i=r.getScroll(),n=r.measure(function(){var e=this.getPosition();if("fixed"==this.getStyle("position")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:r!=document.id(t.relativeTo),x:t.offset.x-n.x+i.x,y:t.offset.y-n.y+i.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:["padding","border","margin"]})},getPosition:function(e,n){var i={};n=t.getOptions(e,n);var r=document.id(n.relativeTo)||document.body;t.setPositionCoordinates(n,i,r),n.edge&&t.toEdge(i,n);var o=n.offset;return i.left=(i.x>=0||o.parentPositioned||n.allowNegative?i.x:0).toInt(),i.top=(i.y>=0||o.parentPositioned||n.allowNegative?i.y:0).toInt(),t.toMinMax(i,n),(n.relFixedPosition||"fixed"==r.getStyle("position"))&&t.toRelFixedPosition(r,i),n.ignoreScroll&&t.toIgnoreScroll(r,i),n.ignoreMargins&&t.toIgnoreMargins(i,n),i.left=Math.ceil(i.left),i.top=Math.ceil(i.top),delete i.x,delete i.y,i},setPositionCoordinates:function(e,t,n){var i=e.offset.y,r=e.offset.x,o=n==document.body?window.getScroll():n.getPosition(),s=o.y,a=o.x,l=window.getSize();switch(e.position.x){case"left":t.x=a+r;break;case"right":t.x=a+r+n.offsetWidth;break;default:t.x=a+(n==document.body?l.x:n.offsetWidth)/2+r}switch(e.position.y){case"top":t.y=s+i;break;case"bottom":t.y=s+i+n.offsetHeight;break;default:t.y=s+(n==document.body?l.y:n.offsetHeight)/2+i}},toMinMax:function(e,t){var n,i={left:"x",top:"y"};["minimum","maximum"].each(function(r){["left","top"].each(function(o){null!=(n=t[r]?t[r][i[o]]:null)&&("minimum"==r?e[o]n)&&(e[o]=n)})})},toRelFixedPosition:function(e,t){var n=window.getScroll();t.top+=n.y,t.left+=n.x},toIgnoreScroll:function(e,t){var n=e.getScroll();t.top-=n.y,t.left-=n.x},toIgnoreMargins:function(e,t){e.left+="right"==t.edge.x?t.dimensions["margin-right"]:"center"!=t.edge.x?-t.dimensions["margin-left"]:-t.dimensions["margin-left"]+(t.dimensions["margin-right"]+t.dimensions["margin-left"])/2,e.top+="bottom"==t.edge.y?t.dimensions["margin-bottom"]:"center"!=t.edge.y?-t.dimensions["margin-top"]:-t.dimensions["margin-top"]+(t.dimensions["margin-bottom"]+t.dimensions["margin-top"])/2},toEdge:function(e,t){var n={},i=t.dimensions,r=t.edge;switch(r.x){case"left":n.x=0;break;case"right":n.x=-i.x-i.computedRight-i.computedLeft;break;default:n.x=-Math.round(i.totalWidth/2)}switch(r.y){case"top":n.y=0;break;case"bottom":n.y=-i.y-i.computedTop-i.computedBottom;break;default:n.y=-Math.round(i.totalHeight/2)}e.x+=n.x,e.y+=n.y},getCoordinateFromValue:function(e){return"string"!=typeOf(e)?e:{x:(e=e.toLowerCase()).test("left")?"left":e.test("right")?"right":"center",y:e.test(/upper|top/)?"top":e.test("bottom")?"bottom":"center"}}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var n=this.setStyle("position","absolute").calculatePosition(t);return t&&t.returnPos?n:this.setStyles(n)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return"none"!=this.getStyle("display")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||"none"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var e;try{e=this.getStyle("display")}catch(e){}return"none"==e?this:this.store("element:_originalDisplay",e||"").setStyle("display","none")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve("element:_originalDisplay")||"block",this.setStyle("display","none"==e?"block":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var n,i=e.match(/^\s*(?:\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(i){n=new Element("table");var r=i[1].toLowerCase();["td","th","tr"].contains(r)&&(n=new Element("tbody").inject(n),"tr"!=r&&(n=new Element("tr").inject(n)))}return(n||new Element("div")).set("html",e).getChildren()},function(){var e=function(e){return decodeURIComponent(e.replace(/\+/g," "))};String.implement({parseQueryString:function(t,n){null==t&&(t=!0),null==n&&(n=!0);var i=this.split(/[&;]/),r={};return i.length?(i.each(function(i){var o=i.indexOf("=")+1,s=o?i.substr(o):"",a=o?i.substr(0,o-1).match(/([^\]\[]+|(\B)(?=\]))/g):[i],l=r;a&&(n&&(s=e(s)),a.each(function(n,i){t&&(n=e(n));var r=l[n];ithis.options.zIndex?this.options.zIndex:e-1)<0&&(e=1),this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:e,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},class:this.options.className}).store("IframeShim",this);var i=function(){this.shim.inject(this.element,"after"),this[this.options.display?"show":"hide"](),this.fireEvent("inject")}.bind(this);t.ready?i():window.addEvent("load",i)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!t.ready||!this.shim)return this;var e=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(e.x=e.x-2*this.options.margin,e.y=e.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:e.x,height:e.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle("display","none"),this},show:function(){return this.shim&&this.shim.setStyle("display","block"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent("load",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},class:"mask",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store("mask",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element("div",{class:this.options.class,id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(e){this.fireEvent("click",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:"")||(this.target==document.body?"inside":"after"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var n={styles:["padding","border"]};this.options.maskMargins&&n.styles.push("margin");var i=this.target.getComputedSize(n);if(this.target==document.body){this.element.setStyles({width:0,height:0});var r=window.getScrollSize();i.totalHeight2083&&this.fireEvent("error",o),Request.JSONP.request_map[r]=function(){delete Request.JSONP.request_map[r],this.success(arguments,i)}.bind(this);var s=this.getScript(o).inject(e.injectScript);return this.fireEvent("request",[o,s]),e.timeout&&this.timeout.delay(e.timeout,this),this},getScript:function(e){return this.script||(this.script=new Element("script",{type:"text/javascript",async:!0,src:e})),this.script},success:function(e){this.running&&this.clear().fireEvent("complete",e).fireEvent("success",e).callChain()},cancel:function(){return this.running&&this.clear().fireEvent("cancel"),this},isRunning:function(){return!!this.running},clear:function(){return this.running=!1,this.script&&(this.script.destroy(),this.script=null),this},timeout:function(){return this.running&&(this.running=!1,this.fireEvent("timeout",[this.script.get("src"),this.script]).fireEvent("failure").cancel()),this}}),Request.JSONP.counter=0,Request.JSONP.request_map={},Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],n=Math.floor(Math.random()*(e+1));this[e]=this[n],this[n]=t}return this},reduce:function(e,t){for(var n=0,i=this.length;n2),g=/Android/.test(e),_=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),v=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=h&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var k=v&&(u||h&&(null==w||w<12.11)),S=n||s&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,E=function(e,t){var n=e.className,i=C(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return L(e).appendChild(t)}function A(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}m?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch(e){}});var $=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function W(e,t){for(var n=0;n=t)return i+Math.min(s,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var J=[""];function Q(e){for(;J.length<=e;)J.push(Y(J)+" ");return J[e]}function Y(e){return e[e.length-1]}function Z(e,t){for(var n=[],i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ie(e))||t.test(e):ie(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var se=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ae(e){return e.charCodeAt(0)>=768&&se.test(e)}function le(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}var ce=null;function pe(e,t,n){var i;ce=null;for(var r=0;rt)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ce=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ce=r)}return null!=i?i:ce}var he=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function a(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,u){var c="ltr"==u?"L":"R";if(0==l.length||"ltr"==u&&!n.test(l))return!1;for(var p,h=l.length,d=[],f=0;f-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function _e(e,t){var n=me(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function we(e){e.prototype.on=function(e,t){ye(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function ke(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Te(e){ke(e),Se(e)}function Ee(e){return e.target||e.srcElement}function Le(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),v&&e.ctrlKey&&1==t&&(t=3),t}var Me,Ae,Oe=function(){if(s&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Pe(e){if(null==Me){var t=A("span","​");M(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Me=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=Me?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Ae)return Ae;var t=M(e,document.createTextNode("AخA")),n=T(t,0,1).getBoundingClientRect(),i=T(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Ae=i.right-n.right<3)}var je,Ne=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},De="oncopy"in(je=A("div"))||(je.setAttribute("oncopy","return;"),"function"==typeof je.oncopy),ze=null;var Be={},Fe={};function He(e){if("string"==typeof e&&Fe.hasOwnProperty(e))e=Fe[e];else if(e&&"string"==typeof e.name&&Fe.hasOwnProperty(e.name)){var t=Fe[e.name];"string"==typeof t&&(t={name:t}),(e=te(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=He(t);var n=Be[t.name];if(!n)return $e(e,"text/plain");var i=n(e,t);if(We.hasOwnProperty(t.name)){var r=We[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)i[s]=t.modeProps[s];return i}var We={};function qe(e,t){F(t,We.hasOwnProperty(e)?We[e]:We[e]={})}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ve(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}var Ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t=e.first&&tn?it(n,Xe(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?it(e.line,t):n<0?it(e.line,0):e}(t,Xe(e,t.line).text.length)}function pt(e,t){for(var n=[],i=0;i=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.post},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ht=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,i){var r=[e.state.modeGen],o={};kt(e,t.text,e.doc.mode,n,function(e,t){return r.push(e,t)},o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=e.state.overlays[i],l=1,u=0;n.state=!0,kt(e,t.text,a.mode,n,function(e,t){for(var n=l;ue&&r.splice(l,1,e,r[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ue(e.doc.mode,i.state),o=ft(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new dt(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Xe(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ht?u.lookAhead:0)<=o.modeFrontier))return a;var c=H(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=a-1,i=c)}return r}(e,t,n),s=o>i.first&&Xe(i,o-1).stateAfter,a=s?dt.fromSaved(i,s,o):new dt(i,Ke(i.mode),o);return i.iter(o,t,function(n){gt(e,n.text,a);var i=a.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&it.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,n){return t instanceof ht?new dt(e,Ue(e.mode,t.state),n,t.lookAhead):new dt(e,Ue(e.mode,t),n)},dt.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ht(t,this.maxLookAhead):t};var bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xt(e,t,n,i){var r,o,s=e.doc,a=s.mode,l=Xe(s,(t=ct(s,t)).line),u=mt(e,t.line,n),c=new Ge(l.text,e.options.tabSize,u);for(i&&(o=[]);(i||c.pose.options.maxHighlightLength?(a=!1,s&>(e,t,i,p.pos),p.pos=t.length,l=null):l=wt(vt(n,p,i.state,h),o),h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!a||c!=l){for(;u=t:o.to>t);(i||(i=[])).push(new Tt(s,o.from,a?null:o.to))}}return i}(n,r,s),l=function(e,t,n){var i;if(e)for(var r=0;r=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from0&&a)for(var v=0;vt)&&(!n||Nt(n,o.marker)<0)&&(n=o.marker)}return n}function Ft(e,t,n,i,r){var o=Xe(e,t),s=Ct&&o.markedSpans;if(s)for(var a=0;a=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?rt(u.to,n)>=0:rt(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?rt(u.from,i)<=0:rt(u.from,i)<0)))return!0}}}function Ht(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function $t(e,t){var n=Xe(e,t),i=Ht(n);return n==i?t:Ze(i)}function Wt(e,t){if(t>e.lastLine())return t;var n,i=Xe(e,t);if(!qt(e,i))return t;for(;n=zt(i);)i=n.find(1,!0).line;return Ze(i)+1}function qt(e,t){var n=Ct&&t.markedSpans;if(n)for(var i=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Xt=function(e,t,n){this.text=e,Pt(this,t),this.height=n?n(this):1};function Jt(e){e.parent=null,Ot(e)}Xt.prototype.lineNo=function(){return Ze(this)},we(Xt);var Qt={},Yt={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Qt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function en(e,t){var n=O("span",null,null,l?"padding-right: .1px":null),i={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,s=void 0;i.pos=0,i.addToken=nn,Re(e.display.measure)&&(s=de(o,e.doc.direction))&&(i.addToken=rn(i.addToken,s)),i.map=[],sn(o,i,yt(e,o,t!=e.display.externalMeasured&&Ze(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=N(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=N(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Pe(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return _e(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=N(i.pre.className,i.textClass||"")),i}function tn(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function nn(e,t,n,i,r,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;ru&&p.from<=u);h++);if(p.to>=c)return e(n,i,r,o,s,a,l);e(n,i.slice(0,p.to-u),r,o,null,a,l),o=null,i=i.slice(p.to-u),u=p.to}}}function on(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function sn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var s,a,l,u,c,p,h,d=r.length,f=0,y=1,m="",g=0;;){if(g==f){l=u=c=a="",h=null,p=null,g=1/0;for(var _=[],v=void 0,b=0;bf||w.collapsed&&x.to==f&&x.from==f)){if(null!=x.to&&x.to!=f&&g>x.to&&(g=x.to,u=""),w.className&&(l+=" "+w.className),w.css&&(a=(a?a+";":"")+w.css),w.startStyle&&x.from==f&&(c+=" "+w.startStyle),w.endStyle&&x.to==g&&(v||(v=[])).push(w.endStyle,x.to),w.title&&((h||(h={})).title=w.title),w.attributes)for(var k in w.attributes)(h||(h={}))[k]=w.attributes[k];w.collapsed&&(!p||Nt(p.marker,w)<0)&&(p=x)}else x.from>f&&g>x.from&&(g=x.from)}if(v)for(var S=0;S=d)break;for(var T=Math.min(d,g);;){if(m){var E=f+m.length;if(!p){var L=E>T?m.slice(0,T-f):m;t.addToken(t,L,s?s+l:l,c,f+L.length==g?u:"",a,h)}if(E>=T){m=m.slice(T-f),f=T;break}f=E,c=""}m=r.slice(o,o=n[y++]),s=Zt(n[y++],t.cm.options)}}else for(var M=1;Mn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}}function Rn(e,t,n,i){return In(e,Nn(e,t),n,i)}function jn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,i){var r,o=Bn(t.map,n,i),l=o.node,u=o.start,c=o.end,p=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&ae(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var d;u>0&&(p=i="right"),r=e.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==i?d.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+oi(e.display),top:f.top,bottom:f.bottom}:zn}for(var y=r.top-t.rect.top,m=r.bottom-t.rect.top,g=(y+m)/2,_=t.view.measure.heights,v=0;v<_.length-1&&!(g<_[v]);v++);var b=v?_[v-1]:0,x=_[v],w={left:("right"==p?r.right:r.left)-t.rect.left,right:("left"==p?r.left:r.right)-t.rect.left,top:b,bottom:x};r.left||r.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=y,w.rbottom=m);return w}(e,t,n,i)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var Dn,zn={left:0,right:0,top:0,bottom:0};function Bn(e,t,n){for(var i,r,o,s,a,l,u=0;ut)&&(r=(o=l-a)-1,t>=l&&(s="right")),null!=r){if(i=e[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],s="left";if("right"==n&&r==l-a)for(;u=0&&(n=e[r]).left==n.right;r--);return n}function Hn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(e,t,n){var i=1==a[t].level;return s(n?e-1:e,i!=n)}var p=pe(a,l,u),h=ce,d=c(l,p,"before"==u);return null!=h&&(d.other=c(l,h,"before"!=u)),d}function Qn(e,t){var n=0;t=ct(e.doc,t),e.options.lineWrapping||(n=oi(e.display)*t.ch);var i=Xe(e.doc,t.line),r=Vt(i)+Tn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Yn(e,t,n,i,r){var o=it(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Zn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Yn(i.first,0,null,-1,-1);var r=et(i,n),o=i.first+i.size-1;if(r>o)return Yn(i.first+i.size-1,Xe(i,o).text.length,null,1,1);t<0&&(t=0);for(var s=Xe(i,r);;){var a=ii(e,s,r,t,n),l=Bt(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;s=Xe(i,r=u.line)}}function ei(e,t,n,i){i-=Vn(t);var r=t.text.length,o=ue(function(t){return In(e,n,t-1).bottom<=i},r,0);return{begin:o,end:r=ue(function(t){return In(e,n,t).top>i},o,r)}}function ti(e,t,n,i){return n||(n=Nn(e,t)),ei(e,t,n,Kn(e,t,In(e,n,i),"line").top)}function ni(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ii(e,t,n,i,r){r-=Vt(t);var o=Nn(e,t),s=Vn(t),a=0,l=t.text.length,u=!0,c=de(t,e.doc.direction);if(c){var p=(e.options.lineWrapping?function(e,t,n,i,r,o,s){var a=ei(e,t,i,s),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,p=null,h=0;h=u||d.to<=l)){var f=1!=d.level,y=In(e,i,f?Math.min(u,d.to)-1:Math.max(l,d.from)).right,m=ym)&&(c=d,p=m)}}c||(c=r[r.length-1]);c.fromu&&(c={from:c.from,to:u,level:c.level});return c}:function(e,t,n,i,r,o,s){var a=ue(function(a){var l=r[a],u=1!=l.level;return ni(Jn(e,it(n,u?l.to:l.from,u?"before":"after"),"line",t,i),o,s,!0)},0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,c=Jn(e,it(n,u?l.from:l.to,u?"after":"before"),"line",t,i);ni(c,o,s,!0)&&c.top>s&&(l=r[a-1])}return l})(e,t,n,o,c,i,r);a=(u=1!=p.level)?p.from:p.to-1,l=u?p.to:p.from-1}var h,d,f=null,y=null,m=ue(function(t){var n=In(e,o,t);return n.top+=s,n.bottom+=s,!!ni(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,y=n),!0)},a,l),g=!1;if(y){var _=i-y.left=b.bottom?1:0}return Yn(n,m=le(t.text,m,1),d,g,i-h)}function ri(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(A("br"));Dn.appendChild(document.createTextNode("x"))}M(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function oi(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");M(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function si(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+r,i[a]=o.clientWidth}return{fixedPos:ai(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ai(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function li(e){var t=ri(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/oi(e.display)-3);return function(r){if(qt(e.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s0&&(l=Xe(e.doc,u.line).text).length==u.ch){var c=H(l,l.length,e.options.tabSize)-l.length;u=it(u.line,Math.max(0,Math.round((o-Ln(e.display).left)/oi(e.display))-c))}return u}function pi(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;it)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Ct&&$t(e.doc,t)r.viewFrom?fi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)fi(e);else if(t<=r.viewFrom){var o=yi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):fi(e)}else if(n>=r.viewTo){var s=yi(e,t,t,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):fi(e)}else{var a=yi(e,t,t,-1),l=yi(e,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(ln(e,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):fi(e)}var u=r.externalMeasured;u&&(n=r.lineN&&t=i.viewTo)){var o=i.view[pi(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==W(s,n)&&s.push(n)}}}function fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function yi(e,t,n,i){var r,o=pi(e,t),s=e.display.view;if(!Ct||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-t,o++}else r=a-t;t+=r,n+=r}for(;$t(e.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo||l.to().line0?s:e.defaultCharWidth())+"px"}if(i.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function bi(e,t){return e.top-t.top||e.left-t.left}function xi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),s=Ln(e.display),a=s.left,l=Math.max(i.sizerWidth,An(e)-i.sizer.offsetLeft)-s.right,u="ltr"==r.direction;function c(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(i-t)+"px"))}function p(t,n,i){var o,s,p=Xe(r,t),h=p.text.length;function d(n,i){return Xn(e,it(t,n),"div",p,i)}function f(t,n,i){var r=ti(e,p,null,t),o="ltr"==n==("after"==i)?"left":"right";return d("after"==i?r.begin:r.end-(/\s/.test(p.text.charAt(r.end-1))?2:1),o)[o]}var y=de(p,r.direction);return function(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;ot||t==n&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(y,n||0,null==i?h:i,function(e,t,r,p){var m="ltr"==r,g=d(e,m?"left":"right"),_=d(t-1,m?"right":"left"),v=null==n&&0==e,b=null==i&&t==h,x=0==p,w=!y||p==y.length-1;if(_.top-g.top<=3){var k=(u?b:v)&&w,S=(u?v:b)&&x?a:(m?g:_).left,C=k?l:(m?_:g).right;c(S,g.top,C-S,g.bottom)}else{var T,E,L,M;m?(T=u&&v&&x?a:g.left,E=u?l:f(e,r,"before"),L=u?a:f(t,r,"after"),M=u&&b&&w?l:_.right):(T=u?f(e,r,"before"):a,E=!u&&v&&x?l:g.right,L=!u&&b&&w?a:_.left,M=u?f(t,r,"after"):l),c(T,g.top,E-T,g.bottom),g.bottom<_.top&&c(a,g.bottom,null,_.top),c(L,_.top,M-L,_.bottom)}(!o||bi(g,o)<0)&&(o=g),bi(_,o)<0&&(o=_),(!s||bi(g,s)<0)&&(s=g),bi(_,s)<0&&(s=_)}),{start:o,end:s}}var h=t.from(),d=t.to();if(h.line==d.line)p(h.line,h.ch,d.ch);else{var f=Xe(r,h.line),y=Xe(r,d.line),m=Ht(f)==Ht(y),g=p(h.line,h.ch,m?f.text.length+1:null).end,_=p(d.line,m?0:null,d.ch).start;m&&(g.top<_.top-2?(c(g.right,g.top,null,g.bottom),c(a,_.top,_.left,_.bottom)):c(g.right,g.top,_.left-g.right,g.bottom)),g.bottom<_.top&&c(a,g.bottom,null,_.top)}n.appendChild(o)}function wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ti(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ki(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ci(e))}function Si(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ti(e))},100)}function Ci(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(_e(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),wi(e))}function Ti(e,t){e.state.delayingBlurEvent||(e.state.focused&&(_e(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=Math.max(0,t.scroller.getBoundingClientRect().top),r=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||y<-.005)&&(re.display.sizerWidth){var g=Math.ceil(h/oi(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Li(e){if(e.widgets)for(var t=0;t=s&&(o=et(t,Vt(Xe(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Ai(e,t){var n=e.display,i=ri(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=On(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+En(n),l=t.topa-i;if(t.topr+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=r&&(s.scrollTop=c)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,d=An(e)-n.gutters.offsetWidth,f=t.right-t.left>d;return f&&(t.right=t.left+d),t.left<10?s.scrollLeft=0:t.leftd+h-3&&(s.scrollLeft=t.right+(f?0:10)-d),s}function Oi(e,t){null!=t&&(ji(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pi(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ri(e,t,n){null==t&&null==n||ji(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ji(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Ni(e,Qn(e,t.from),Qn(e,t.to),t.margin))}function Ni(e,t,n,i){var r=Ai(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Ri(e,r.scrollLeft,r.scrollTop)}function Ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ur(e,{top:t}),Di(e,t,!0),n&&ur(e),ir(e,100))}function Di(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function zi(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Bi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+En(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Mn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Fi=function(e,t,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),ye(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ye(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=v&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new $,this.disableVert=new $},Fi.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="",t.set(1e3,function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,i)})},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hi=function(){};function $i(e,t){t||(t=Bi(e));var n=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Ei(e),Wi(e,Bi(e)),n=e.display.barWidth,i=e.display.barHeight}function Wi(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Hi.prototype.update=function(){return{bottom:0,right:0}},Hi.prototype.setScrollLeft=function(){},Hi.prototype.setScrollTop=function(){},Hi.prototype.clear=function(){};var qi={native:Fi,null:Hi};function Ui(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new qi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?zi(e,t):Ii(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Vi=0;function Ki(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vi,markArrays:null},t=e.curOp,un?un.ops.push(t):t.ownsGroup=un={ops:[t],delayedCallbacks:[]}}function Gi(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ji(e){var t=e.cm,n=t.display;e.updatedDisplay&&Ei(t),e.barMeasure=Bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Rn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Mn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-An(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Qi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(r=!1),null!=r&&!y){var s=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Tn(e.display))+"px;\n height: "+(t.bottom-t.top+Mn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?it(t.line,t.ch+1,"before"):t,t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,a=Jn(e,t),l=n&&n!=t?Jn(e,n):a,u=Ai(e,r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),c=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=u.scrollTop&&(Ii(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(zi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(s=!0)),!s)break}return r}(t,ct(i,e.scrollToPos.from),ct(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var s=0;s=e.display.viewTo)){var n=+new Date+e.options.workTime,i=mt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(i.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?Ue(t.mode,i.state):null,l=ft(e,o,i,!0);a&&(i.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!p&&hn)return ir(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Zi(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;dr(e)&&(fi(e),t.dims=si(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Ct&&(o=$t(e.doc,o),s=Wt(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=ln(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=ln(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,pi(e,n)))),i.viewTo=n}(e,o,s),n.viewOffset=Vt(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mi(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=sr(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(t){var n=t.nextSibling;return l&&v&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=i.view,c=i.viewFrom,p=0;p-1&&(d=!1),dn(e,h,c,n)),d&&(L(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(nt(e.options,c)))),s=h.node.nextSibling}else{var f=bn(e,h,c,n);o.insertBefore(f,s)}c+=h.size}for(;s;)s=a(s)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=R(e.activeElt.ownerDocument)&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),n.removeAllRanges(),n.addRange(i),n.extend(e.focusNode,e.focusOffset)}}(c),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ir(e,400)),n.updateLineNumbers=null,!0}function lr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=An(e))i&&(t.visible=Mi(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+En(e.display)-On(e),n.top)}),t.visible=Mi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ar(e,t))break;Ei(e);var r=Bi(e);gi(e),$i(e,r),pr(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ur(e,t){var n=new or(e,t);if(ar(e,n)){Ei(e),lr(e,n);var i=Bi(e);gi(e),$i(e,i),pr(e,i),n.finish()}}function cr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",pn(e,"gutterChanged",e)}function pr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Mn(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=ai(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",s=0;su.clientWidth,f=u.scrollHeight>u.clientHeight;if(r&&d||o&&f){if(o&&v&&l)e:for(var y=t.target,m=a.view;y!=u;y=y.parentNode)for(var g=0;g=0&&rt(e,i.to())<=0)return n}return-1};var kr=function(e,t){this.anchor=e,this.head=t};function Sr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort(function(e,t){return rt(e.from(),t.from())}),n=W(t,r);for(var o=1;o0:l>=0){var u=lt(a.from(),s.from()),c=at(a.to(),s.to()),p=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new kr(p?c:u,p?u:c))}}return new wr(t,n)}function Cr(e,t){return new wr([new kr(e,t||e)],0)}function Tr(e){return e.text?it(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Er(e,t){if(rt(e,t.from)<0)return e;if(rt(e,t.to)<=0)return Tr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Tr(t).ch-t.to.ch),it(n,i)}function Lr(e,t){for(var n=[],i=0;i1&&e.remove(a.line+1,f-1),e.insert(a.line+1,g)}pn(e,"change",e,t)}function jr(e,t,n){!function e(i,r,o){if(i.linked)for(var s=0;sa-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Br(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(r,r.lastOp==i)))s=Y(o.changes),0==rt(t.from,t.to)&&0==rt(t.from,s.to)?s.to=Tr(t):o.changes.push(zr(e,t));else{var l=Y(r.done);for(l&&l.ranges||$r(e.sel,r.done),o={changes:[zr(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,s||_e(e,"historyAdded")}function Hr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(r.done),t))?r.done[r.done.length-1]=t:$r(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Br(r.undone)}function $r(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Wr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function qr(e){if(!e)return null;for(var t,n=0;n-1&&(Y(a)[p]=u[p],delete u[p])}}}return i}function Kr(e,t,n,i){if(i){var r=e.anchor;if(n){var o=rt(t,r)<0;o!=rt(n,r)<0?(r=t,t=n):o!=rt(t,n)<0&&(t=n)}return new kr(r,t)}return new kr(n||t,t)}function Gr(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Zr(e,new wr([Kr(e.sel.primary(),t,n,r)],0),i)}function Xr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(r&&(_e(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var p=l.find(i<0?1:-1),h=void 0;if((i<0?c:u)&&(p=so(e,p,-i,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(h=rt(p,n))&&(i<0?h<0:h>0))return ro(e,p,t,i,r)}var d=l.find(i<0?-1:1);return(i<0?u:c)&&(d=so(e,d,i,d.line==t.line?o:null)),d?ro(e,d,t,i,r):null}}return t}function oo(e,t,n,i,r){var o=i||1,s=ro(e,t,n,o,r)||!r&&ro(e,t,n,o,!0)||ro(e,t,n,-o,r)||!r&&ro(e,t,n,-o,!0);return s||(e.cantEdit=!0,it(e.first,0))}function so(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?ct(e,it(t.line-1)):null:n>0&&t.ch==(i||Xe(e,t.line)).text.length?t.line0)){var c=[l,1],p=rt(u.from,a.from),h=rt(u.to,a.to);(p<0||!s.inclusiveLeft&&!p)&&c.push({from:u.from,to:a.from}),(h>0||!s.inclusiveRight&&!h)&&c.push({from:a.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)co(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=rt(t.from,t.to)){var n=Lr(e,t);Fr(e,t,n,e.cm?e.cm.curOp.id:NaN),fo(e,t,n,Mt(e,t));var i=[];jr(e,function(e,n){n||-1!=W(i,e.history)||(_o(e.history,t),i.push(e.history)),fo(e,t,null,Mt(e,t))})}}function po(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--d){var f=h(d);if(f)return f.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new wr(Z(e.sel.ranges,function(e){return new kr(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.lineo&&(t={from:t.from,to:it(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=Lr(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=Ze(Ht(Xe(i,o.line))),i.iter(l,s.line+1,function(e){if(e==r.maxLine)return a=!0,!0}));i.sel.contains(t.from,t.to)>-1&&be(e);Rr(i,t,n,li(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,function(e){var t=Kt(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;i--){var r=Xe(e,i).stateAfter;if(r&&(!(r instanceof ht)||i+r.lookAhead1||!(this.children[0]instanceof bo))){var a=[];this.collapse(a),this.children=[new bo(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=r.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,n,o)||t.line!=n.line&&Ft(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}o.addToHistory&&Fr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,function(i){u&&o.collapsed&&!u.options.lineWrapping&&Ht(i)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Ye(i,0),function(e,t,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&e.markedSpans&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}(i,new Tt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){qt(e,t)&&Ye(t,0)}),o.clearOnEnter&&ye(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(St=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hi(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)di(u,c,"text");o.atomic&&no(u.doc),pn(u,"markerAdded",u,o)}return o}Co.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ki(e),xe(this,"clear")){var n=this.find();n&&pn(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&pn(e,"markerCleared",e,this,i,r),t&&Gi(e),this.parent&&this.parent.clear()}},Co.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r=0;l--)uo(this,i[l]);a?Yr(this,a):this.cm&&Pi(this.cm)}),undo:nr(function(){po(this,"undo")}),redo:nr(function(){po(this,"redo")}),undoSelection:nr(function(){po(this,"undo",!0)}),redoSelection:nr(function(){po(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=ct(this,e),t=ct(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;ie)return t=e,!0;e-=o,++n}),ct(this,it(n,t))},indexFromPos:function(e){var t=(e=ct(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var p=e.dataTransfer.getData("Text");if(p){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),eo(t.doc,Cr(n,n)),h)for(var d=0;d=0;t--)yo(e.doc,"",i[t].from,i[t].to,"+delete");Pi(e)})}function Yo(e,t,n){var i=le(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Zo(e,t,n){var i=Yo(e,t.ch,n);return null==i?null:new it(t.line,i,n<0?"after":"before")}function es(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=de(n,t.doc.direction);if(o){var s,a=r<0?Y(o):o[0],l=r<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Nn(t,n);s=r<0?n.text.length-1:0;var c=In(t,u,s).top;s=ue(function(e){return In(t,u,e).top==c},r<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Yo(n,s,1))}else s=r<0?a.to:a.from;return new it(i,s,l)}}return new it(i,r<0?n.text.length:0,r<0?"before":"after")}Wo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wo.default=v?Wo.macDefault:Wo.pcDefault;var ts={selectAll:ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return Qo(e,function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)r=new it(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),it(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var s=Xe(e.doc,r.line-1).text;s&&(r=new it(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),it(r.line-1,s.length-1),r,"+transpose"))}n.push(new kr(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return Zi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i-1&&(rt((r=u.ranges[r]).from(),t)<0||t.xRel>0)&&(rt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,o=!1,u=er(e,function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Si(e)),ge(r.wrapper.ownerDocument,"mouseup",u),ge(r.wrapper.ownerDocument,"mousemove",c),ge(r.scroller,"dragstart",p),ge(r.scroller,"drop",u),o||(ke(t),i.addNew||Gr(e.doc,n,null,null,i.extend),l&&!d||s&&9==a?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};l&&(r.scroller.draggable=!0);e.state.draggingText=u,u.copy=!i.moveOnDrag,ye(r.wrapper.ownerDocument,"mouseup",u),ye(r.wrapper.ownerDocument,"mousemove",c),ye(r.scroller,"dragstart",p),ye(r.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout(function(){return r.input.focus()},20),r.scroller.dragDrop&&r.scroller.dragDrop()}(e,i,t,o):function(e,t,n,i){s&&Si(e);var r=e.display,o=e.doc;ke(t);var a,l,u=o.sel,c=u.ranges;i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new kr(n,n)):(a=o.sel.primary(),l=o.sel.primIndex);if("rectangle"==i.unit)i.addNew||(a=new kr(n,n)),n=ci(e,t,!0,!0),l=-1;else{var p=gs(e,n,i.unit);a=i.extend?Kr(a,p.anchor,p.head,i.extend):p}i.addNew?-1==l?(l=c.length,Zr(o,Sr(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==i.unit&&!i.extend?(Zr(o,Sr(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Jr(o,l,a,K):(l=0,Zr(o,new wr([a],0),K),u=o.sel);var h=n;function d(t){if(0!=rt(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],s=e.options.tabSize,c=H(Xe(o,n.line).text,n.ch,s),p=H(Xe(o,t.line).text,t.ch,s),d=Math.min(c,p),f=Math.max(c,p),y=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));y<=m;y++){var g=Xe(o,y).text,_=X(g,d,s);d==f?r.push(new kr(it(y,_),it(y,_))):g.length>_&&r.push(new kr(it(y,_),it(y,X(g,f,s))))}r.length||r.push(new kr(n,n)),Zr(o,Sr(e,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var v,b=a,x=gs(e,t,i.unit),w=b.anchor;rt(x.anchor,w)>0?(v=x.head,w=lt(b.from(),x.anchor)):(v=x.anchor,w=at(b.to(),x.head));var k=u.ranges.slice(0);k[l]=function(e,t){var n=t.anchor,i=t.head,r=Xe(e.doc,n.line);if(0==rt(n,i)&&n.sticky==i.sticky)return t;var o=de(r);if(!o)return t;var s=pe(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=pe(o,i.ch,i.sticky),p=c-s||(i.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?p<0:p>0}var h=o[u+(l?-1:0)],d=l==(1==h.level),f=d?h.from:h.to,y=d?"after":"before";return n.ch==f&&n.sticky==y?t:new kr(new it(n.line,f,y),i)}(e,new kr(ct(o,w),v)),Zr(o,Sr(e,k,l),K)}}var f=r.wrapper.getBoundingClientRect(),y=0;function m(t){e.state.selectingText=!1,y=1/0,t&&(ke(t),r.input.focus()),ge(r.wrapper.ownerDocument,"mousemove",g),ge(r.wrapper.ownerDocument,"mouseup",_),o.history.lastSelOrigin=null}var g=er(e,function(t){0!==t.buttons&&Le(t)?function t(n){var s=++y;var a=ci(e,n,!0,"rectangle"==i.unit);if(!a)return;if(0!=rt(a,h)){e.curOp.focus=R(D(e)),d(a);var l=Mi(r,o);(a.line>=l.to||a.linef.bottom?20:0;u&&setTimeout(er(e,function(){y==s&&(r.scroller.scrollTop+=u,t(n))}),50)}}(t):m(t)}),_=er(e,m);e.state.selectingText=_,ye(r.wrapper.ownerDocument,"mousemove",g),ye(r.wrapper.ownerDocument,"mouseup",_)}(e,i,t,o)}(t,i,o,e):Ee(e)==n.scroller&&ke(e):2==r?(i&&Gr(t.doc,i),setTimeout(function(){return n.input.focus()},20)):3==r&&(S?t.display.input.onContextMenu(e):Si(t)))}}function gs(e,t,n){if("char"==n)return new kr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new kr(it(t.line,0),ct(e.doc,it(t.line+1,0)));var i=n(e,t);return new kr(i.from,i.to)}function _s(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ke(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!xe(e,n))return Ce(t);o-=a.top-s.viewOffset;for(var l=0;l=r)return _e(e,n,e,et(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function vs(e,t){return _s(e,t,"gutterClick",!0)}function bs(e,t){Cn(e.display,t)||function(e,t){if(!xe(e,"gutterContextMenu"))return!1;return _s(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(e)}ys.prototype.compare=function(e,t,n){return this.time+400>e&&0==rt(t,this.pos)&&n==this.button};var ws={toString:function(){return"CodeMirror.Init"}},ks={},Ss={};function Cs(e,t,n){if(!t!=!(n&&n!=ws)){var i=e.display.dragFunctions,r=t?ye:ge;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function Ts(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Gt(e)),ui(e),hi(e),Wn(e),setTimeout(function(){return $i(e)},100)}function Es(e,t){var i=this;if(!(this instanceof Es))return new Es(e,t);this.options=t=t?F(t):{},F(ks,t,!1);var r=t.value;"string"==typeof r?r=new Oo(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Es.inputStyles[t.inputStyle](this),u=this.display=new function(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=O("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[u],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&p>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&_||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=fr(r.gutters,r.lineNumbers),yr(o),i.init(o)}(e,r,o,t);for(var f in u.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ui(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!_&&u.input.focus(),s&&a<11&&setTimeout(function(){return i.display.input.reset(!0)},20),function(e){var t=e.display;ye(t.scroller,"mousedown",er(e,ms)),ye(t.scroller,"dblclick",s&&a<11?er(e,function(t){if(!ve(e,t)){var n=ci(e,t);if(n&&!vs(e,t)&&!Cn(e.display,t)){ke(t);var i=e.findWordAt(n);Gr(e.doc,i.anchor,i.head)}}}):function(t){return ve(e,t)||ke(t)});ye(t.scroller,"contextmenu",function(t){return bs(e,t)}),ye(t.input.getField(),"contextmenu",function(n){t.scroller.contains(n.target)||bs(e,n)});var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(i=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}ye(t.scroller,"touchstart",function(r){if(!ve(e,r)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(r)&&!vs(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}}),ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ye(t.scroller,"touchend",function(n){var i=t.activeTouch;if(i&&!Cn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,a=e.coordsChar(t.activeTouch,"page");s=!i.prev||o(i,i.prev)?new kr(a,a):!i.prev.prev||o(i,i.prev.prev)?e.findWordAt(a):new kr(it(a.line,0),ct(e.doc,it(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),ke(n)}r()}),ye(t.scroller,"touchcancel",r),ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ii(e,t.scroller.scrollTop),zi(e,t.scroller.scrollLeft,!0),_e(e,"scroll",e))}),ye(t.scroller,"mousewheel",function(t){return xr(e,t)}),ye(t.scroller,"DOMMouseScroll",function(t){return xr(e,t)}),ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ve(e,t)||Te(t)},over:function(t){ve(e,t)||(!function(e,t){var n=ci(e,t);if(n){var i=document.createDocumentFragment();vi(e,n,i),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,i)}}(e,t),Te(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Po<100))Te(t);else if(!ve(e,t)&&!Cn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:er(e,Ro),leave:function(t){ve(e,t)||jo(e)}};var l=t.input.getField();ye(l,"keyup",function(t){return ps.call(e,t)}),ye(l,"keydown",er(e,cs)),ye(l,"keypress",er(e,hs)),ye(l,"focus",function(t){return Ci(e,t)}),ye(l,"blur",function(t){return Ti(e,t)})}(this),Do(),Ki(this),this.curOp.forceUpdate=!0,Nr(this,r),t.autofocus&&!_||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ci(i)},20):Ti(this),Ss)Ss.hasOwnProperty(f)&&Ss[f](this,t[f],ws);dr(this),t.finishInit&&t.finishInit(this);for(var y=0;y150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?H(Xe(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var p="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/s);d;--d)h+=s,p+="\t";if(hs,l=Ne(t),u=null;if(a&&i.ranges.length>1)if(As&&As.text.join("\n")==t){if(i.ranges.length%As.text.length==0){u=[];for(var c=0;c=0;h--){var d=i.ranges[h],f=d.from(),y=d.to();d.empty()&&(n&&n>0?f=it(f.line,f.ch-n):e.state.overwrite&&!a?y=it(y.line,Math.min(Xe(o,y.line).text.length,y.ch+Y(l).length)):a&&As&&As.lineWise&&As.text.join("\n")==l.join("\n")&&(f=y=it(f.line,0)));var m={from:f,to:y,text:u?u[h%u.length]:l,origin:r||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};uo(e.doc,m),pn(e,"inputRead",e,m)}t&&!a&&js(e,t),Pi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Zi(t,function(){return Ps(t,n,0,null,"paste")}),!0}function js(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Ms(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Ms(e,r.head.line,"smart"));s&&pn(e,"electricInput",e,r.head.line)}}}function Ns(e){for(var t=[],n=[],i=0;i0?0:-1));if(isNaN(c))s=null;else{var p=n>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new it(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(p?2:1))),-n)}}else s=r?function(e,t,n,i){var r=de(t,e.doc.direction);if(!r)return Zo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=pe(r,n.ch,n.sticky),s=r[o];if("ltr"==e.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&h>=c.begin)){var d=p?"before":"after";return new it(n.line,h,d)}}var f=function(e,t,i){for(var o=function(e,t){return t?new it(n.line,l(e,1),"before"):new it(n.line,e,"after")};e>=0&&e0==(1!=s.level),u=a?i.begin:l(i.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==m||i>0&&m==t.text.length||!(y=f(i>0?0:r.length-1,i,u(m)))?null:y}(e.cm,a,t,n):Zo(a,t,n);if(null==s){if(o||(u=t.line+l)=e.first+e.size||(t=new it(u,t.ch,t.sticky),!(a=Xe(e,u))))return!1;t=es(r,e.cm,a,t.line,l)}else t=s;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var c=null,p="group"==i,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||u(!d);d=!1){var f=a.text.charAt(t.ch)||"\n",y=re(f,h)?"w":p&&"\n"==f?"n":!p||/\s/.test(f)?null:"p";if(!p||d||y||(y="s"),c&&c!=y){n<0&&(n=1,u(),t.sticky="after");break}if(y&&(c=y),n>0&&!u(!d))break}var m=oo(e,t,o,s,!0);return ot(o,m)&&(m.hitSide=!0),m}function Bs(e,t,n,i){var r,o,s=e.doc,a=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,z(e).innerHeight||s(e).documentElement.clientHeight),u=Math.max(l-.5*ri(e.display),3);r=(n>0?t.bottom:t.top)+n*u}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Zn(e,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Fs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Hs(e,t){var n=jn(e,t.line);if(!n||n.hidden)return null;var i=Xe(e.doc,t.line),r=Pn(n,i,t.line),o=de(i,e.doc.direction),s="left";o&&(s=pe(o,t.ch)%2?"right":"left");var a=Bn(r.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function $s(e,t){return t&&(e.bad=!0),e}function Ws(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return $s(e.clipPos(it(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r=t.display.viewTo||o.line=t.display.viewFrom&&Hs(t,r)||{node:l[0].measure.map[2],offset:0},c=o.linei.firstLine()&&(s=it(s.line-1,Xe(i.doc,s.line-1).length)),a.ch==Xe(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(e=pi(i,s.line))?(t=Ze(r.view[0].line),n=r.view[0].node):(t=Ze(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,u,c=pi(i,a.line);if(c==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=Ze(r.view[c+1].line)-1,u=r.view[c+1].node.previousSibling),!n)return!1;for(var p=i.doc.splitLines(function(e,t,n,i,r){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(e){e&&(u(),o+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(it(i,0),it(r+1,0),(m=+h,function(e){return e.id==m}));return void(d.length&&(o=d[0].find(0))&&c(Je(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&u();for(var y=0;y1&&h.length>1;)if(Y(p)==Y(h))p.pop(),h.pop(),l--;else{if(p[0]!=h[0])break;p.shift(),h.shift(),t++}for(var d=0,f=0,y=p[0],m=h[0],g=Math.min(y.length,m.length);ds.ch&&_.charCodeAt(_.length-f-1)==v.charCodeAt(v.length-f-1);)d--,f++;p[p.length-1]=_.slice(0,_.length-f).replace(/^\u200b+/,""),p[0]=p[0].slice(d).replace(/\u200b+$/,"");var x=it(t,d),w=it(l,h.length?Y(h).length-f:0);return p.length>1||p[0]||rt(x,w)?(yo(i.doc,p,x,w,"+input"),!0):void 0},Fs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fs.prototype.reset=function(){this.forceCompositionEnd()},Fs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Fs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zi(this.cm,function(){return hi(e.cm)})},Fs.prototype.setUneditable=function(e){e.contentEditable="false"},Fs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ps)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fs.prototype.onContextMenu=function(){},Fs.prototype.resetPosition=function(){},Fs.prototype.needsContentAttribute=!0;var Us=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null,this.resetting=!1};Us.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!ve(i,e)){if(i.somethingSelected())Os({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ns(i);Os({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,V):(n.prevInput="",r.value=t.text.join("\n"),I(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),ye(r,"input",function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ye(r,"paste",function(e){ve(i,e)||Rs(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())}),ye(r,"cut",o),ye(r,"copy",o),ye(e.scroller,"paste",function(t){if(!Cn(e,t)&&!ve(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}}),ye(e.lineSpace,"selectstart",function(t){Cn(e,t)||ke(t)}),ye(r,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ye(r,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Us.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Is(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Us.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Us.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=_i(e);if(e.options.moveInputWithCursor){var r=Jn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},Us.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Us.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null));this.resetting=!1}},Us.prototype.getField=function(){return this.textarea},Us.prototype.supportsTouch=function(){return!1},Us.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!_||R(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Us.prototype.blur=function(){this.textarea.blur()},Us.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Us.prototype.receivedFocus=function(){this.slowPoll()},Us.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Us.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Us.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ie(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||v&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Us.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Us.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Us.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ci(n,e),u=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&er(n,Zr)(n.doc,Cr(o),V);var c,p=r.style.cssText,d=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=r.ownerDocument.defaultView.scrollY),i.input.focus(),l&&r.ownerDocument.defaultView.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=g,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&m(),S){Te(e);var y=function(){ge(window,"mouseup",y),setTimeout(g,20)};ye(window,"mouseup",y)}else setTimeout(g,50)}function m(){if(null!=r.selectionStart){var e=n.somethingSelected(),o="​"+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,r.style.cssText=p,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!s||s&&a<9)&&m();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==t.prevInput?er(n,ao)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Us.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Us.prototype.setUneditable=function(){},Us.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=ws&&r(e,t,n)}:r)}e.defineOption=n,e.Init=ws,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Ar(e)},!0),n("indentUnit",2,Ar,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Or(e),Wn(e),hi(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter(function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(it(i,o))}i++});for(var r=n.length-1;r>=0;r--)yo(e.doc,t,n[r],it(n[r].line,n[r].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ws&&e.refresh()}),n("specialCharPlaceholder",tn,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",_?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),n("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){xs(e),mr(e)},!0),n("keyMap","default",function(e,t,n){var i=Jo(t),r=n!=ws&&Jo(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ts,!0),n("gutters",[],function(e,t){e.display.gutterSpecs=fr(t,e.options.lineNumbers),mr(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ai(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return $i(e)},!0),n("scrollbarStyle","native",function(e){Ui(e),$i(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e,t){e.display.gutterSpecs=fr(e.options.gutters,t),mr(e)},!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",function(e){return e},mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(e,t){"nocursor"==t&&(Ti(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,Cs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Or,!0),n("addModeClass",!1,Or,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Or,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),n("phrases",null)}(Es),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){z(this).focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&er(this,t[e])(this,n,r),_e(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Jo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Ms(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Pi(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&Jr(this.doc,i,new kr(o,u[i].to()),V)}}}),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,it(e),t,!0)},getTokenTypeAt:function(e){e=ct(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(e=o,r=!0),i=Xe(this.doc,e)}else i=e;return Kn(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-Vt(i):0)},defaultTextHeight:function(){return ri(this.display)},defaultCharWidth:function(){return oi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o,s,a,l=this.display,u=(e=Jn(this,ct(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)u=e.top;else if("above"==i||"near"==i){var p=Math.max(l.wrapper.clientHeight,this.doc.height),h=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>p)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=p&&(u=e.bottom),c+t.offsetWidth>h&&(c=h-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==r?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?c=0:"middle"==r&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=Ai(o,s)).scrollTop&&Ii(o,a.scrollTop),null!=a.scrollLeft&&zi(o,a.scrollLeft))},triggerOnKeyDown:tr(cs),triggerOnKeyPress:tr(hs),triggerOnKeyUp:ps,triggerOnMouseDown:tr(ms),execCommand:function(e){if(ts.hasOwnProperty(e))return ts[e].call(null,this)},triggerElectric:tr(function(e){js(this,e)}),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=ct(this.doc,e),s=0;s0&&s(t.charAt(n-1));)--n;for(;i.5||this.options.lineWrapping)&&ui(this),_e(this,"refresh",this)}),swapDoc:tr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Nr(this,e),Wn(this),this.display.input.reset(),Ri(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,pn(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}(Es);var Vs="iter insert remove copy getEditor constructor".split(" ");for(var Ks in Oo.prototype)Oo.prototype.hasOwnProperty(Ks)&&W(Vs,Ks)<0&&(Es.prototype[Ks]=function(e){return function(){return e.apply(this.doc,arguments)}}(Oo.prototype[Ks]));return we(Oo),Es.inputStyles={textarea:Us,contenteditable:Fs},Es.defineMode=function(e){Es.defaults.mode||"null"==e||(Es.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}.apply(this,arguments)},Es.defineMIME=function(e,t){Fe[e]=t},Es.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Es.defineMIME("text/plain","null"),Es.defineExtension=function(e,t){Es.prototype[e]=t},Es.defineDocExtension=function(e,t){Oo.prototype[e]=t},Es.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=R(e.ownerDocument);t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=a.getValue()}var r;if(e.form&&(ye(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var a=Es(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a},function(e){e.off=ge,e.on=ye,e.wheelEventPixels=br,e.Doc=Oo,e.splitLines=Ne,e.countColumn=H,e.findColumn=X,e.isWordChar=ie,e.Pass=U,e.signal=_e,e.Line=Xt,e.changeEnd=Tr,e.scrollbarModel=qi,e.Pos=it,e.cmpPos=rt,e.modes=Be,e.mimeModes=Fe,e.resolveMode=He,e.getMode=$e,e.modeExtensions=We,e.extendMode=qe,e.copyState=Ue,e.startState=Ke,e.innerMode=Ve,e.commands=ts,e.keyMap=Wo,e.keyName=Xo,e.isModifierKey=Ko,e.lookupKey=Vo,e.normalizeKeyMap=Uo,e.StringStream=Ge,e.SharedTextMarker=Eo,e.TextMarker=Co,e.LineWidget=wo,e.e_preventDefault=ke,e.e_stopPropagation=Se,e.e_stop=Te,e.addClass=j,e.contains=P,e.rmClass=E,e.keyNames=Bo}(Es),Es.version="5.65.14",Es}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r,o){if(r&&r.call){var s=r;r=null}else s=i(t,r,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var a=i(t,r,"minFoldSize");function l(e){var i=s(t,n);if(!i||i.to.line-i.from.linet.firstLine();)n=e.Pos(n.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t,n){var r=i(e,t,"widget");"function"==typeof r&&(r=r(n.from,n.to));if("string"==typeof r){var o=document.createTextNode(r);(r=document.createElement("span")).appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}(t,r,u);e.on(c,"mousedown",function(t){p.clear(),e.e_preventDefault(t)});var p=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:i(t,r,"clearOnEnter"),__isFold:!0});p.on("clear",function(n,i){e.signal(t,"unfold",t,n,i)}),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,n){return function(i,r){t(i,r,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,i){t(this,e,n,i)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n=u){if(h&&s&&h.test(s.className))return;o=i(a.indicatorOpen)}}(o||s)&&e.setGutterMarker(r,a.gutter,o)})}function o(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){r(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function a(e,i,r){var o=e.state.foldGutter;if(o){var s=o.options;if(r==s.gutter){var a=n(e,i);a?a.clear():e.foldCode(t(i,0),s)}}}function l(e,t){"mode"==t&&u(e)}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){s(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation(function(){n.fromt.to&&(r(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var i=t.line;i>=n.from&&i=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(s(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function p(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(a(e))continue;return}if(s(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function h(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function d(e,n){for(var i=[];;){var r,o=p(e),s=e.line,a=e.ch-(o?o[0].length:0);if(!o||!(r=u(e)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(s,a),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,n){for(var i=[];;){var r=h(e);if(!r)return;if("selfClose"!=r){var o=e.line,s=e.ch,a=c(e);if(!a)return;if(a[1])i.push(a[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==a[2]){i.length=l;break}if(l<0&&(!n||n==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(o,s)}}}else c(e)}}e.registerHelper("fold","xml",function(e,i){for(var r=new o(e,i.line,0);;){var s=p(r);if(!s||r.line!=i.line)return;var a=u(r);if(!a)return;if(!s[1]&&"selfClose"!=a){var l=t(r.line,r.ch),c=d(r,s[2]);return c&&n(c.from,l)>0?{from:l,to:c.from}:null}}}),e.findMatchingTag=function(e,i,r){var s=new o(e,i.line,i.ch,r);if(-1!=s.text.indexOf(">")||-1!=s.text.indexOf("<")){var a=u(s),l=a&&t(s.line,s.ch),p=a&&c(s);if(a&&p&&!(n(s,i)>0)){var h={from:t(s.line,s.ch),to:l,tag:p[2]};return"selfClose"==a?{open:h,close:null,at:"open"}:p[1]?{open:f(s,p[2]),close:h,at:"close"}:{open:h,close:d(s=new o(e,l.line,l.ch,r),p[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var s=f(r,i);if(!s)break;var a=d(new o(e,t.line,t.ch,n),s.tag);if(a)return{open:s,close:a}}},e.scanForClosingTag=function(e,t,n,i){return d(new o(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t){return function(n,i){var r=i.line,o=n.getLine(r);function s(t){for(var s,a=i.ch,l=0;;){var u=a<=0?-1:o.lastIndexOf(t[0],a-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));if(/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1))),"keyword"!=i.type||"import"!=i.string)return null;for(var r=n,o=Math.min(t.lastLine(),n+10);r<=o;++r){var s=t.getLine(r).indexOf(";");if(-1!=s)return{startCh:i.end,end:e.Pos(r,s)}}}var r,o=n.line,s=i(o);if(!s||i(o-1)||(r=i(o-2))&&r.end.line==o-1)return null;for(var a=s.end;;){var l=i(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(o,s.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function i(n){if(nt.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));return/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1))),"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var r=n.line,o=i(r);if(null==o||null!=i(r-1))return null;for(var s=r;;){if(null==i(s+1))break;++s}return{from:e.Pos(r,o+1),to:t.clipPos(e.Pos(s))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function r(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var a=e.getLineHandle(t.line),l=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=r(o),p=!u&&l>=0&&c.test(a.text.charAt(l))&&i[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&i[a.text.charAt(++l)];if(!p)return null;var h=">"==p.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(l==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,l+1)),f=s(e,n(t.line,l+(h>0?1:0)),h,d,o);return null==f?null:{from:n(t.line,l),to:f&&f.pos,match:f&&f.ch==p.charAt(0),forward:h>0}}function s(e,t,o,s,a){for(var l=a&&a.maxScanLineLength||1e4,u=a&&a.maxScanLines||1e3,c=[],p=r(a),h=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),d=t.line;d!=h;d+=o){var f=e.getLine(d);if(f){var y=o>0?0:f.length-1,m=o>0?f.length:-1;if(!(f.length>l))for(d==t.line&&(y=t.ch-(o<0?1:0));y!=m;y+=o){var g=f.charAt(y);if(p.test(g)&&(void 0===s||(e.getTokenTypeAt(n(d,y+1))||"")==(s||""))){var _=i[g];if(_&&">"==_.charAt(1)==o>0)c.push(g);else{if(!c.length)return{pos:n(d,y),ch:g};c.pop()}}}}}return d-o!=(o>0?e.lastLine():e.firstLine())&&null}function a(e,i,r){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,a=r&&r.highlightNonMatching,l=[],u=e.listSelections(),c=0;c'"]=function(i){return function(i){if(i.getOption("disableInput"))return e.Pass;for(var s=i.listSelections(),a=[],l=i.getOption("autoCloseTags"),u=0;uc.ch&&(y=y.slice(0,y.length-p.end+c.ch));var v=y.toLowerCase();if(!y||"string"==p.type&&(p.end!=c.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||1==p.string.length)||"tag"==p.type&&f.close||p.string.indexOf("/")==c.ch-p.start-1||g&&r(g,v)>-1||o(i,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(d)||[],y,c,!0))return e.Pass;var b="object"==typeof l&&l.emptyTags;if(b&&r(b,y)>-1)a[u]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var x=_&&r(_,v)>-1;a[u]={indent:x,text:">"+(x?"\n\n":"")+"",newPos:x?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}for(var w="object"==typeof l&&l.dontIndentOnAutoClose,u=s.length-1;u>=0;u--){var k=a[u];i.replaceRange(k.text,s[u].head,s[u].anchor,"+insert");var S=i.listSelections().slice(0);S[u]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!w&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}(i)}),s.addKeyMap(u)}});var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(t,n){for(var i=t.listSelections(),r=[],s=n?"/":""!=t.getLine(c.line).charAt(p.end)&&(f+=">"),r[u]=f}if(t.replaceSelections(r),i=t.listSelections(),!l)for(u=0;u=0&&n[u]==i;u--)++l;r=a.to;for(u=1;u",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,function(t,n,s){s&&s!=e.Init&&(t.removeKeyMap(r),t.state.closeBrackets=null),n&&(o(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(r))});var r={Backspace:function(t){var r=a(t);if(!r||t.getOption("disableInput"))return e.Pass;for(var o=i(r,"pairs"),s=t.listSelections(),l=0;l=0;l--){var p=s[l].head;t.replaceRange("",n(p.line,p.ch-1),n(p.line,p.ch+1),"+delete")}},Enter:function(t){var n=a(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),s=0;s1&&d.indexOf(r)>=0&&t.getRange(n(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;_="addFour"}else if(f){var w=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(x)||w==r||e.isWordChar(w))return e.Pass;_="both"}else{if(!m||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return e.Pass;_="both"}else _=f&&c(t,b)?"both":d.indexOf(r)>=0&&t.getRange(b,n(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(p){if(p!=_)return e.Pass}else p=_}var k=u%2?s.charAt(u-1):r,S=u%2?r:s.charAt(u+1);t.operation(function(){if("skip"==p)l(t,1);else if("skipThree"==p)l(t,3);else if("surround"==p){for(var i=t.getSelections(),r=0;r0,{anchor:new n(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new n(o.head.line,o.head.ch+(s?1:-1))});t.setSelections(i)}else"both"==p?(t.replaceSelection(k+S,null),t.triggerElectric(k+S),l(t,-1)):"addFour"==p&&(t.replaceSelection(k+k+k+k,"before"),l(t,1));var o,s})}(r,t)}}function a(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){for(var n=[],i=e.listSelections(),r=0,o=0;o0?{line:s.head.line,ch:s.head.ch+t}:{line:s.head.line-1};n.push({anchor:a,head:a})}e.setSelections(n,r)}function u(e,t){var i=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==i.length?i:null}function c(e,t){var i=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var i=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,i.line),r.to=Math.max(i.line+1,r.to);var o=e.findMatchingTag(n,i,r);if(o){if(n.state.matchBothTags){var s="open"==o.at?o.open:o.close;s&&(n.state.tagHit=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}))}var a="close"==o.at?o.open:o.close;a?n.state.tagOther=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(r,o,s){s&&s!=e.Init&&(r.off("cursorActivity",n),r.off("viewportChange",i),t(r)),o&&(r.state.matchBothTags="object"==typeof o&&o.bothTags,r.on("cursorActivity",n),r.on("viewportChange",i),n(r))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var i="close"==n.at?n.open:n.close;i&&t.extendSelection(i.to,i.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active";function i(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var i={hint:t};if(n)for(var r in n)i[r]=n[r];return e.showHint(i)},e.defineExtension("showHint",function(t){t=function(e,t,n){var i=e.options.hintOptions,r={};for(var o in c)r[o]=c[o];if(i)for(var o in i)void 0!==i[o]&&(r[o]=i[o]);if(n)for(var o in n)void 0!==n[o]&&(r[o]=n[o]);r.hint.resolve&&(r.hint=r.hint.resolve(e,t));return r}(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var r=0;rp.clientHeight+1;if(setTimeout(function(){A=l.getScrollInfo()}),O.bottom-M>0){var R=O.bottom-O.top,j=O.top-(v.bottom-v.top)-2;M-O.topj&&(p.style.height=(R=j)+"px"),p.style.top=(x=v.top-R)+S+"px",w=!1):p.style.height=M-O.top-2+"px"}var N,I=O.right-L;if(P&&(I+=l.display.nativeBarWidth),I>0&&(O.right-O.left>L&&(p.style.width=L-5+"px",I-=O.right-O.left-L),p.style.left=(b=Math.max(v.left-I-k,0))+"px"),P)for(var D=p.firstChild;D;D=D.nextSibling)D.style.paddingRight=l.display.nativeBarWidth+"px";(l.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var i=e.options.customKeys,r=i?{}:n;function o(e,i){var o;o="string"!=typeof i?function(e){return i(e,t)}:n.hasOwnProperty(i)?n[i]:i,r[e]=o}if(i)for(var s in i)i.hasOwnProperty(s)&&o(s,i[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&o(s,a[s]);return r}(i,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:d.length,close:function(){i.close()},pick:function(){o.pick()},data:r})),i.options.closeOnUnfocus)&&(l.on("blur",this.onBlur=function(){N=setTimeout(function(){i.close()},100)}),l.on("focus",this.onFocus=function(){clearTimeout(N)}));l.on("scroll",this.onScroll=function(){var e=l.getScrollInfo(),t=l.getWrapperElement().getBoundingClientRect();A||(A=l.getScrollInfo());var n=x+A.top-e.top,r=n-(c.pageYOffset||(u.documentElement||u.body).scrollTop);if(w||(r+=p.offsetHeight),r<=t.top||r>=t.bottom)return i.close();p.style.top=n+"px",p.style.left=b+A.left-e.left+"px"}),e.on(p,"dblclick",function(e){var t=a(p,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())}),e.on(p,"click",function(e){var t=a(p,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),i.options.completeOnSingleClick&&o.pick())}),e.on(p,"mousedown",function(){setTimeout(function(){l.focus()},20)});var z=this.getSelectedHintRange();return 0===z.from&&0===z.to||this.scrollToActive(),e.signal(r,"select",d[this.selectedHint],p.childNodes[this.selectedHint]),!0}function u(e,t,n,i){if(e.async)e(t,i,n);else{var r=e(t,n);r&&r.then?r.then(i):i(r)}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var i=t.list[n],r=this;this.cm.operation(function(){i.hint?i.hint(r.cm,t,i):r.cm.replaceRange(s(i),i.from||t.from,i.to||t.to,"complete"),e.signal(t,"pick",i),r.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=i?this.data.list.length-1:0:t<0&&(t=i?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" "+n,""),r.removeAttribute("aria-selected")),(r=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,r.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",r.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],i=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+i.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,n){var i,r=t.getHelpers(n,"hint");if(r.length){var o=function(e,t,n){var i=function(e,t){if(!e.somethingSelected())return t;for(var n=[],i=0;i0?t(e):r(o+1)})}(0)};return o.async=!0,o.supportsSelection=!0,o}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",function(t,n){var i,r=t.getCursor(),o=t.getTokenAt(r),s=e.Pos(r.line,o.start),a=r;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=e.Pos;function n(e,t){for(var n=0,i=e.length;nc.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start)):p={start:c.ch,end:c.ch,string:"",state:p.state,type:"."==p.string?"property":null};for(var d=p;"property"==d.type;){if("."!=(d=l(i,t(c.line,d.start))).string)return;if(d=l(i,t(c.line,d.start)),!f)var f=[];f.push(d)}return{list:function(e,t,i,r){var l=[],u=e.string,c=r&&r.globalScope||window;function p(e){0!=e.lastIndexOf(u,0)||function(e,t){if(!Array.prototype.indexOf){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}return-1!=e.indexOf(t)}(l,e)||l.push(e)}function h(e){"string"==typeof e?n(o,p):e instanceof Array?n(s,p):e instanceof Function&&n(a,p),function(e,t){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=e;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(t);else for(var i in e)t(i)}(e,p)}if(t&&t.length){var d,f=t.pop();for(f.type&&0===f.type.indexOf("variable")?(r&&r.additionalContext&&(d=r.additionalContext[f.string]),r&&!1===r.useGlobalScope||(d=d||c[f.string])):"string"==f.type?d="":"atom"==f.type?d=1:"function"==f.type&&(null==c.jQuery||"$"!=f.string&&"jQuery"!=f.string||"function"!=typeof c.jQuery?null!=c._&&"_"==f.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&t.length;)d=d[t.pop().string];null!=d&&h(d)}else{for(var y=e.state.localVars;y;y=y.next)p(y.name);for(var m=e.state.context;m;m=m.prev)for(var y=m.vars;y;y=y.next)p(y.name);for(var y=e.state.globalVars;y;y=y.next)p(y.name);if(r&&null!=r.additionalContext)for(var g in r.additionalContext)p(g);r&&!1===r.useGlobalScope||h(c),n(i,p)}return l}(p,f,r,u),from:t(c.line,p.start),to:t(c.line,p.end)}}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}e.registerHelper("hint","javascript",function(e,t){return i(e,l,function(e,t){return e.getTokenAt(t)},t)}),e.registerHelper("hint","coffeescript",function(e,t){return i(e,u,r,t)});var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),l="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),u="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=e.Pos;function n(e,t,n){return n?e.indexOf(t)>=0:0==e.lastIndexOf(t,0)}e.registerHelper("hint","xml",function(i,r){var o=r&&r.schemaInfo,s=r&&r.quoteChar||'"',a=r&&r.matchInMiddle;if(o){var l=i.getCursor(),u=i.getTokenAt(l);if(u.end>l.ch&&(u.end=l.ch,u.string=u.string.slice(0,l.ch-u.start)),(v=e.innerMode(i.getMode(),u.state)).mode.xmlCurrentTag){var c,p,h=[],d=!1,f=/\btag\b/.test(u.type)&&!/>$/.test(u.string),y=f&&/^\w/.test(u.string);if(y){var m=i.getLine(l.line).slice(Math.max(0,u.start-2),u.start),g=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;g&&(p=u.start-("close"==g?2:1))}else f&&"<"==u.string?g="open":f&&"")}else{var C=(x=_&&o[_.name])&&x.attrs,T=o["!attrs"];if(!C&&!T)return;if(C){if(T){var E={};for(var L in T)T.hasOwnProperty(L)&&(E[L]=T[L]);for(var L in C)C.hasOwnProperty(L)&&(E[L]=C[L]);C=E}}else C=T;if("string"==u.type||"="==u.string){var M,A=(m=i.getRange(t(l.line,Math.max(0,l.ch-60)),t(l.line,"string"==u.type?u.start:u.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!A||!C.hasOwnProperty(A[1])||!(M=C[A[1]]))return;if("function"==typeof M&&(M=M.call(this,i)),"string"==u.type){c=u.string;var O=0;/['"]/.test(u.string.charAt(0))&&(s=u.string.charAt(0),c=u.string.slice(1),O++);var P=u.string.length;if(/['"]/.test(u.string.charAt(P-1))&&(s=u.string.charAt(P-1),c=u.string.substr(O,P-2)),O){var R=i.getLine(l.line);R.length>u.end&&R.charAt(u.end)==s&&u.end++}d=!0}var j=function(e){if(e)for(var t=0;t][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],a={attrs:{}},l={a:{attrs:{href:null,ping:null,type:null,media:s,target:n,hreflang:t}},abbr:a,acronym:a,address:a,applet:a,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:s,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:a,aside:a,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:a,base:{attrs:{href:null,target:n}},basefont:a,bdi:a,bdo:a,big:a,blockquote:{attrs:{cite:null}},body:a,br:a,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:o,formmethod:r,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:a,center:a,cite:a,code:a,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:a,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:a,dir:a,div:a,dialog:{attrs:{open:null}},dl:a,dt:a,em:a,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:a,figure:a,font:a,footer:a,form:{attrs:{action:null,name:null,"accept-charset":i,autocomplete:["on","off"],enctype:o,method:r,novalidate:["","novalidate"],target:n}},frame:a,frameset:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:a,hgroup:a,hr:a,html:{attrs:{manifest:null},children:["head","body"]},i:a,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:o,formmethod:r,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:a,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:a,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:s,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:a,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:i,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:a,noframes:a,noscript:a,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:a,param:{attrs:{name:null,value:null}},pre:a,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:a,rt:a,ruby:a,s:a,samp:a,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:i}},section:a,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:a,source:{attrs:{src:null,type:null,media:null}},span:a,strike:a,strong:a,style:{attrs:{type:["text/css"],media:s,scoped:null}},sub:a,summary:a,sup:a,table:a,tbody:a,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:a,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:a,time:{attrs:{datetime:null}},title:a,tr:a,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:t}},tt:a,u:a,ul:a,var:a,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:a},u={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],autocorrect:["true","false"],autocapitalize:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};function c(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}for(var p in c(a),l)l.hasOwnProperty(p)&&l[p]!=a&&c(l[p]);e.htmlSchema=l,e.registerHelper("hint","html",function(t,n){var i={schemaInfo:l};if(n)for(var r in n)i[r]=n[r];return e.hint.xml(t,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var t={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};e.registerHelper("hint","css",function(n){var i=n.getCursor(),r=n.getTokenAt(i),o=e.innerMode(n.getMode(),r.state);if("css"==o.mode.name){if("keyword"==r.type&&0=="!important".indexOf(r.string))return{list:["!important"],from:e.Pos(i.line,r.start),to:e.Pos(i.line,r.end)};var s=r.start,a=i.ch,l=r.string.slice(0,a-s);/[^\w$_-]/.test(l)&&(l="",s=a=i.ch);var u=e.resolveMode("text/css"),c=[],p=o.state.state;return"pseudo"==p||"variable-3"==r.type?h(t):"block"==p||"maybeprop"==p?h(u.propertyKeywords):"prop"==p||"parens"==p||"at"==p||"params"==p?(h(u.valueKeywords),h(u.colorKeywords)):"media"!=p&&"media_parens"!=p||(h(u.mediaTypes),h(u.mediaFeatures)),c.length?{list:c,from:e.Pos(i.line,s),to:e.Pos(i.line,a)}:void 0}function h(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",i="CodeMirror-activeline-gutter";function r(e){for(var r=0;r-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n50&&r.shift()}function s(e){return r[r.length-(e?Math.min(e,1):1)]||""}var a=null;function l(e,t,n,s,l){null==l&&(l=e.getRange(t,n)),"grow"==s&&a&&a.cm==e&&i(t,a.pos)&&e.isClean(a.gen)?function(e){if(!r.length)return o(e);r[r.length-1]+=e}(l):!1!==s&&o(l),e.replaceRange("",t,n,"+delete"),a="grow"==s?{cm:e,pos:t,gen:e.changeGeneration()}:null}function u(e,t,n){return e.findPosH(t,n,"char",!0)}function c(e,t,n){return e.findPosH(t,n,"word",!0)}function p(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function h(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function d(e,t,i){for(var r=t.line,o=e.getLine(r),s=/\S/.test(i<0?o.slice(0,t.ch):o.slice(t.ch)),a=e.firstLine(),l=e.lastLine();;){if((r+=i)l)return e.clipPos(n(r-i,i<0?0:null));if(o=e.getLine(r),/\S/.test(o))s=!0;else if(s)return n(r,0)}}function f(e,t,i){for(var r=t.line,o=t.ch,s=e.getLine(t.line),a=!1;;){var l=s.charAt(o+(i<0?-1:0));if(l){if(a&&/[!?.]/.test(l))return n(r,o+(i>0?1:0));a||(a=/\w/.test(l)),o+=i}else{if(r==(i<0?e.firstLine():e.lastLine()))return n(r,o);if(s=e.getLine(r+i),!/\S/.test(s))return n(r,o);r+=i,o=i<0?s.length:0}}}function y(e,t,r){var o;if(e.findMatchingBracket&&(o=e.findMatchingBracket(t,{strict:!0}))&&o.match&&(o.forward?1:-1)==r)return r>0?n(o.to.line,o.to.ch+1):o.to;for(var s=!0;;s=!1){var a=e.getTokenAt(t),l=n(t.line,r<0?a.start:a.end);if(!(s&&r>0&&a.end==t.ch)&&/\w/.test(a.string))return l;var u=e.findPosH(l,r,"char");if(i(l,u))return t;t=u}}function m(e,t){var n=e.state.emacsPrefix;return n?(C(e),"-"==n?-1:Number(n)):t?null:1}function g(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=m(e);t(e);for(var i=1;i1&&"+input"==t.origin){for(var i=t.text.join("\n"),r="",o=1;o1&&r.pop(),s()),"around","paste")},t.forwardChar=v(u,1),t.backwardChar=v(u,-1),t.deleteChar=function(e){b(e,u,1,!1)},t.deleteForwardChar=function(e){x(e,!1)||b(e,u,1,!1)},t.deleteBackwardChar=function(e){x(e,!1)||b(e,u,-1,!1)},t.forwardWord=v(c,1),t.backwardWord=v(c,-1),t.killWord=function(e){b(e,c,1,"grow")},t.backwardKillWord=function(e){b(e,c,-1,"grow")},t.nextLine=v(p,1),t.previousLine=v(p,-1),t.scrollDownCommand=v(h,-1),t.scrollUpCommand=v(h,1),t.backwardParagraph=v(d,-1),t.forwardParagraph=v(d,1),t.backwardSentence=v(f,-1),t.forwardSentence=v(f,1),t.killSentence=function(e){b(e,f,1,"grow")},t.backwardKillSentence=function(e){l(e,e.getCursor(),f(e,e.getCursor(),1),"grow")},t.killSexp=function(e){b(e,y,1,"grow")},t.backwardKillSexp=function(e){b(e,y,-1,"grow")},t.forwardSexp=v(y,1),t.backwardSexp=v(y,-1),t.markSexp=function(e){var t=e.getCursor();e.setSelection(_(e,t,y,1),t)},t.transposeSexps=function(e){var t=y(e,e.getCursor(),-1),n=y(e,t,1),i=y(e,n,1),r=y(e,i,-1);e.replaceRange(e.getRange(r,i)+e.getRange(n,r)+e.getRange(t,n),t,i)},t.backwardUpList=g(function(e){for(var t=e.getCursor(),i=t.line,r=t.ch,o=[];i>=e.firstLine();){for(var s=e.getLine(i),a=null==r?s.length:r;a>0;)if(")"==(r=s.charAt(--a)))o.push("(");else if("]"==r)o.push("[");else if("}"==r)o.push("{");else if(/[\(\{\[]/.test(r)&&(!o.length||o.pop()!=r))return e.extendSelection(n(i,a));--i,r=null}}),t.justOneSpace=function(e){for(var t=e.getCursor(),i=t.ch,r=t.ch,o=e.getLine(t.line);i&&/\s/.test(o.charAt(i-1));)--i;for(;r0)return e.setCursor(t-1);M(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)})},t.indentRigidly=function(e){e.indentSelection(m(e,!0)||e.getOption("indentUnit"))},t.exchangePointAndMark=function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},t.quotedInsertTab=g("insertTab"),t.universalArgument=function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(P),e.on("keyHandled",E),e.on("inputRead",E)},e.emacs={kill:l,killRegion:x,repeated:g};var O=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":"killRegion","Ctrl-K":"killLineEmacs","Alt-W":"killRingSave","Ctrl-Y":"yank","Alt-Y":"yankPop","Ctrl-Space":"setMark","Ctrl-Shift-2":"setMark","Ctrl-F":"forwardChar","Ctrl-B":"backwardChar",Right:"forwardChar",Left:"backwardChar","Ctrl-D":"deleteChar",Delete:"deleteForwardChar","Ctrl-H":"deleteBackwardChar",Backspace:"deleteBackwardChar","Alt-F":"forwardWord","Alt-B":"backwardWord","Alt-Right":"forwardWord","Alt-Left":"backwardWord","Alt-D":"killWord","Alt-Backspace":"backwardKillWord","Ctrl-N":"nextLine","Ctrl-P":"previousLine",Down:"nextLine",Up:"previousLine","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":"scrollDownCommand","Ctrl-V":"scrollUpCommand",PageUp:"scrollDownCommand",PageDown:"scrollUpCommand","Ctrl-Up":"backwardParagraph","Ctrl-Down":"forwardParagraph","Alt-{":"backwardParagraph","Alt-}":"forwardParagraph","Alt-A":"backwardSentence","Alt-E":"forwardSentence","Alt-K":"killSentence","Ctrl-X Delete":"backwardKillSentence","Ctrl-Alt-K":"killSexp","Ctrl-Alt-Backspace":"backwardKillSexp","Ctrl-Alt-F":"forwardSexp","Ctrl-Alt-B":"backwardSexp","Shift-Ctrl-Alt-2":"markSexp","Ctrl-Alt-T":"transposeSexps","Ctrl-Alt-U":"backwardUpList","Alt-Space":"justOneSpace","Ctrl-O":"openLine","Ctrl-T":"transposeCharsRepeatable","Alt-C":"capitalizeWord","Alt-U":"upcaseWord","Alt-L":"downcaseWord","Alt-;":"toggleComment","Ctrl-/":"undoRepeatable","Shift-Ctrl--":"undoRepeatable","Ctrl-Z":"undoRepeatable","Cmd-Z":"undoRepeatable","Ctrl-X U":"undoRepeatable","Shift-Ctrl-Z":"redo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":"keyboardQuit","Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":"newline",Tab:"indentAuto","Alt-G G":"gotoLine","Ctrl-X Tab":"indentRigidly","Ctrl-X Ctrl-X":"exchangePointAndMark","Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X K":"close","Ctrl-X H":"selectAll","Ctrl-Q Tab":"quotedInsertTab","Ctrl-U":"universalArgument",fallthrough:"default"}),P={"Ctrl-G":C};function R(e){P[e]=function(t){w(t,e)},O["Ctrl-"+e]=function(t){w(t,e)},k["Ctrl-"+e]=!0}for(var j=0;j<10;++j)R(String(j));R("-")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";var t=e.commands,n=e.Pos;function i(t,i){t.extendSelectionsBy(function(r){return t.display.shift||t.doc.extend||r.empty()?function(t,i,r){if(r<0&&0==i.ch)return t.clipPos(n(i.line-1));var o=t.getLine(i.line);if(r>0&&i.ch>=o.length)return t.clipPos(n(i.line+1,0));for(var s,a="start",l=i.ch,u=l,c=r<0?0:o.length,p=0;u!=c;u+=r,p++){var h=o.charAt(r<0?u-1:u),d="_"!=h&&e.isWordChar(h)?"w":"o";if("w"==d&&h.toUpperCase()==h&&(d="W"),"start"==a)"o"!=d?(a="in",s=d):l=u+r;else if("in"==a&&s!=d){if("w"==s&&"W"==d&&r<0&&u--,"W"==s&&"w"==d&&r>0){if(u==l+1){s="w";continue}u--}break}}return n(i.line,u)}(t.doc,r.head,i):i<0?r.from():r.to()})}function r(t,i){if(t.isReadOnly())return e.Pass;t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,s=0;s=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),i=[],r=0;ro.line&&a==s.line&&0==s.ch||i.push({anchor:a==o.line?o:n(a,0),head:a==s.line?s:n(a)});e.setSelections(i,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),i=[],r=0;r=0;a--){var u=i[r[a]];if(!(l&&e.cmpPos(u.head,l)>0)){var c=o(t,u.head);l=c.from,t.replaceRange(n(c.word),c.from,c.to)}}})}function h(t){var n=t.getCursor("from"),i=t.getCursor("to");if(0==e.cmpPos(n,i)){var r=o(t,n);if(!r.word)return;n=r.from,i=r.to}return{from:n,to:i,query:t.getRange(n,i),word:r}}function d(e,t){var i=h(e);if(i){var r=i.query,o=e.getSearchCursor(r,t?i.to:i.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):i.word&&e.setSelection(i.from,i.to))}}t.selectScope=function(e){l(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!l(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy(function(i){var r=t.scanForBracket(i.head,1,u(t.getTokenTypeAt(i.head)));if(r&&0!=e.cmpPos(r.pos,i.head))return r.pos;var o=t.scanForBracket(i.head,-1,u(t.getTokenTypeAt(n(i.head.line,i.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||i.head})},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var i=t.listSelections(),r=[],o=t.firstLine()-1,s=[],a=0;ao?r.push(u,c):r.length&&(r[r.length-1]=c),o=c}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+a,n(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.setSelections(s),t.scrollIntoView()})},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var i=t.listSelections(),r=[],o=t.lastLine()+1,s=i.length-1;s>=0;s--){var a=i[s],l=a.to().line+1,u=a.from().line;0!=a.to().ch||a.empty()||l--,l=0;e-=2){var i=r[e],o=r[e+1],s=t.getLine(i);i==t.lastLine()?t.replaceRange("",n(i-1),n(i),"+swapLine"):t.replaceRange("",n(i,0),n(i+1,0),"+swapLine"),t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()})},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),i=[],r=0;r=0;o--){var s=i[o].head,a=t.getRange({line:s.line,ch:0},s),l=e.countColumn(a,null,t.getOption("tabSize")),u=t.findPosH(s,-1,"char",!1);if(a&&!/\S/.test(a)&&l%r==0){var c=new n(s.line,e.findColumn(a,l-r,r));c.ch!=s.ch&&(u=c)}t.replaceRange("",u,s,"+delete")}})},t.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange("",t[i].anchor,n(t[i].to().line),"+delete");e.scrollIntoView()})},t.upcaseAtCursor=function(e){p(e,function(e){return e.toUpperCase()})},t.downcaseAtCursor=function(e){p(e,function(e){return e.toLowerCase()})},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var i=t.getCursor(),r=n;if(e.cmpPos(i,r)>0){var o=r;r=i,i=o}t.state.sublimeKilled=t.getRange(i,r),t.replaceRange("",i,r)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){d(e,!0)},t.findUnderPrevious=function(e){d(e,!1)},t.findAllUnder=function(e){var t=h(e);if(t){for(var n=e.getSearchCursor(t.query),i=[],r=-1;n.findNext();)i.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&r++;e.setSelections(i,r)}};var f=e.keyMap;f.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(f.macSublime),f.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(f.pcSublime);var y=f.default==f.macDefault;f.sublime=y?f.macSublime:f.pcSublime}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.Pos;function n(e,n){var i=e.state.vim;if(!i||i.insertMode)return n.head;var r=i.sel.head;return r?i.visualBlock&&n.head.line!=r.line?void 0:n.from()!=n.anchor||n.empty()||n.head.line!=r.line||n.head.ch==r.ch?n.head:new t(n.head.line,n.head.ch-1):n.head}var i=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"g",type:"keyToKey",toKeys:"gk"},{keys:"g",type:"keyToKey",toKeys:"gj"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"idle",context:"normal"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],r=i.length,o=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"global",shortName:"g"}];function s(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",tt),z(t),e.on(t.getInputField(),"paste",h(t))}function a(t,n){this==e.keyMap.vim&&(t.options.$customCursor=null,e.rmClass(t.getWrapperElement(),"cm-fat-cursor")),n&&n.attach==l||function(t){t.setOption("disableInput",!1),t.off("cursorActivity",tt),e.off(t.getInputField(),"paste",h(t)),t.state.vim=null,He&&clearTimeout(He)}(t)}function l(t,i){this==e.keyMap.vim&&(t.curOp&&(t.curOp.selectionChanged=!0),t.options.$customCursor=n,e.addClass(t.getWrapperElement(),"cm-fat-cursor")),i&&i.attach==l||s(t)}function u(t,n){if(n){if(this[t])return this[t];var i=function(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var i=!1,r=0;r"}(t);if(!i)return!1;var r=F.findKey(n,i);return"function"==typeof r&&e.signal(n,"vim-keypress",i),r}}e.defineOption("vimMode",!1,function(t,n,i){n&&"vim"!=t.getOption("keyMap")?t.setOption("keyMap","vim"):!n&&i!=e.Init&&/^vim/.test(t.getOption("keyMap"))&&t.setOption("keyMap","default")});var c={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A",CapsLock:""},p={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function h(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(Z(e.getCursor(),0,1)),J.enterInsertMode(e,{},t))}),t.onPasteFn}var d=/[\d]/,f=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],y=[function(e){return/\S/.test(e)}];function m(e,t){for(var n=[],i=e;i"]),w=[].concat(_,v,b,["-",'"',".",":","_","/"]);try{g=new RegExp("^[\\p{Lu}]$","u")}catch(e){g=/^[A-Z]$/}function k(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function S(e){return/^[a-z]$/.test(e)}function C(e){return g.test(e)}function T(e){return/^\s*$/.test(e)}function E(e){return-1!=".?!".indexOf(e)}function L(e,t){for(var n=0;nn?t=n:t0?1:-1,c=o.getCursor();do{if((a=r[(e+(t+=u))%e])&&(l=a.find())&&!ie(c,l))break}while(ti)}return a}return{cachedCursor:void 0,add:function(o,s,a){var l=r[t%e];function u(n){var i=++t%e,s=r[i];s&&s.clear(),r[i]=o.setBookmark(n)}if(l){var c=l.find();c&&!ie(c,s)&&u(s)}else u(s);u(a),n=t,(i=t-e+1)<0&&(i=0)},find:function(e,n){var i=t,r=o(e,n);return t=i,r&&r.find()},move:o}},I=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function D(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=I()}function z(e){return e.state.vim||(e.state.vim={inputState:new H,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function B(){for(var e in R={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:N(),macroModeState:new D,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new q({}),searchHistoryController:new U,exCommandHistoryController:new U},M){var t=M[e];t.value=t.defaultValue}}D.prototype={exitMacroRecordMode:function(){var e=R.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=R.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var i=De("span",{class:"cm-vim-message"},"recording @"+t);this.onRecordingDone=e.openDialog(i,null,{bottom:!0})}this.isRecording=!0}}};var F={enterVimMode:s,buildKeyMap:function(){},getRegisterController:function(){return R.registerController},resetVimGlobalState_:B,getVimGlobalState_:function(){return R},maybeInitVimState_:z,suppressErrorLogging:!1,InsertModeKey:it,map:function(e,t,n){Je.map(e,t,n)},unmap:function(e,t){return Je.unmap(e,t)},noremap:function(e,t,n){function o(e){return e?[e]:["normal","insert","visual"]}for(var s=o(n),a=i.length,l=a-r;l=0;s--){var a=o[s];if(e!==a.context)if(a.context)this._mapCommand(a);else{var l=["normal","insert","visual"];for(var u in l)if(l[u]!==e){var c={};for(var p in a)c[p]=a[p];c.context=l[u],this._mapCommand(c)}}}},setOption:O,getOption:P,defineOption:A,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;Xe[e]=n,Je.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var i=this.findKey(e,t,n);if("function"==typeof i)return i()},multiSelectHandleKey:function(e,t,n){var i=!1,r=F.maybeInitVimState_(e),o=r.visualBlock||r.wasInVisualBlock,s=e.isInMultiSelectMode();r.wasInVisualBlock&&!s?r.wasInVisualBlock=!1:s&&r.visualBlock&&(r.wasInVisualBlock=!0);if(""!=t||r.insertMode||r.visualMode||!s||""!=r.status)if(o||!s||e.inVirtualSelectionMode)i=F.handleKey(e,t,n);else{var a=at(r);e.operation(function(){e.curOp.isVimOp=!0,e.forEachSelection(function(){var r=e.getCursor("head"),o=e.getCursor("anchor"),s=re(r,o)?0:-1,l=re(r,o)?-1:0;r=Z(r,0,s),o=Z(o,0,l),e.state.vim.sel.head=r,e.state.vim.sel.anchor=o,i=F.handleKey(e,t,n),e.virtualSelection&&(e.state.vim=at(a))}),e.curOp.cursorActivity&&!i&&(e.curOp.cursorActivity=!1),e.state.vim=r},!0)}else $(e);!i||r.visualMode||r.insert||r.visualMode==e.somethingSelected()||nt(e,r);return i},findKey:function(e,t,n){var r,o=z(e);function s(){var i=R.macroModeState;if(i.isRecording){if("q"==t)return i.exitMacroRecordMode(),$(e),!0;"mapping"!=n&&function(e,t){if(e.isPlaying)return;var n=e.latestRegister,i=R.registerController.getRegister(n);i&&i.pushText(t)}(i,t)}}function a(){if(""==t){if(o.visualMode)me(e);else{if(!o.insertMode)return;Qe(e)}return $(e),!0}}return!1===(r=o.insertMode?function(){if(a())return!0;for(var n=o.inputState.keyBuffer=o.inputState.keyBuffer+t,r=1==t.length,s=V.matchCommand(n,i,o.inputState,"insert");n.length>1&&"full"!=s.type;){n=o.inputState.keyBuffer=n.slice(1);var l=V.matchCommand(n,i,o.inputState,"insert");"none"!=l.type&&(s=l)}if("none"==s.type)return $(e),!1;if("partial"==s.type)return j&&window.clearTimeout(j),j=window.setTimeout(function(){o.insertMode&&o.inputState.keyBuffer&&$(e)},P("insertModeEscKeysTimeout")),!r;if(j&&window.clearTimeout(j),r){for(var u=e.listSelections(),c=0;c|<\w+>|./.exec(n),t=i[0],n=n.substring(i.index+t.length),F.handleKey(e,t,"mapping")}(r.toKeys):V.processCommand(e,o,r)}catch(t){throw e.state.vim=void 0,z(e),F.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Je.processCommand(e,t)},defineMotion:function(e,t){K[e]=t},defineAction:function(e,t){J[e]=t},defineOperator:function(e,t){X[e]=t},mapCommand:function(e,t,n,i,r){var o={keys:e,type:t};for(var s in o[t]=n,o[t+"Args"]=i,r)o[s]=r[s];Ye(o)},_mapCommand:Ye,defineRegister:function(e,t){var n=R.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(n[e])throw Error("Register already defined "+e);n[e]=t,w.push(e)},exitVisualMode:me,exitInsertMode:Qe};function H(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function $(t,n){t.state.vim.inputState=new H,e.signal(t,"vim-command-done",n)}function W(e,t,n){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}function q(e){this.registers=e,this.unnamedRegister=e['"']=new W,e["."]=new W,e[":"]=new W,e["/"]=new W}function U(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}H.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},H.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},W.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(I(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},q.prototype={pushText:function(e,t,n,i,r){if("_"!==e){i&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(o){C(e)?o.pushText(n,i):o.setText(n,i,r),this.unnamedRegister.setText(o.toString(),i)}else{switch(t){case"yank":this.registers[0]=new W(n,i,r);break;case"delete":case"change":-1==n.indexOf("\n")?this.registers["-"]=new W(n,i):(this.shiftNumericRegisters_(),this.registers[1]=new W(n,i))}this.unnamedRegister.setText(n,i,r)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new W),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&L(e,w)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},U.prototype={nextMatch:function(e,t){var n=this.historyBuffer,i=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var r=this.iterator+i;t?r>=0:r=n.length?(this.iterator=n.length,this.initialPrefix):r<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var V={matchCommand:function(e,t,n,i){var r,o=function(e,t,n,i){for(var r,o=[],s=[],a=0;a"==r.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" ";break;default:n=""}return n}(e);if(!l||l.length>1)return{type:"clear"};n.selectedCharacter=l}return{type:"full",command:r}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=Y(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var i=t.inputState;if(i.operator){if(i.operator==n.operator)return i.motion="expandToLine",i.motionArgs={linewise:!0},void this.evalInput(e,t);$(e)}i.operator=n.operator,i.operatorArgs=Y(n.operatorArgs),n.keys.length>1&&(i.operatorShortcut=n.keys),n.exitVisualBlock&&(t.visualBlock=!1,fe(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var i=t.visualMode,r=Y(n.operatorMotionArgs);r&&i&&r.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),i||this.processMotion(e,t,n)},processAction:function(e,t,n){var i=t.inputState,r=i.getRepeat(),o=!!r,s=Y(n.actionArgs)||{};i.selectedCharacter&&(s.selectedCharacter=i.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),s.repeat=r||1,s.repeatIsExplicit=o,s.registerName=i.registerName,$(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,i,n),J[n.action](e,s,t)},processSearch:function(t,n,i){if(t.getSearchCursor){var r=i.searchArgs.forward,o=i.searchArgs.wholeWordOnly;Oe(t).setReversed(!r);var s=r?"/":"?",a=Oe(t).getQuery(),l=t.getScrollInfo();switch(i.searchArgs.querySrc){case"prompt":var u=R.macroModeState;if(u.isPlaying)d(h=u.replaySearchQueries.shift(),!0,!1);else Be(t,{onClose:function(e){t.scrollTo(l.left,l.top),d(e,!0,!0);var n=R.macroModeState;n.isRecording&&function(e,t){if(!e.isPlaying){var n=e.latestRegister,i=R.registerController.getRegister(n);i&&i.pushSearchQuery&&i.pushSearchQuery(t)}}(n,e)},prefix:s,desc:"(JavaScript regexp)",onKeyUp:function(n,i,o){var s,a,u,c=e.keyName(n);"Up"==c||"Down"==c?(s="Up"==c,a=n.target?n.target.selectionEnd:0,o(i=R.searchHistoryController.nextMatch(i,s)||""),a&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(a,n.target.value.length))):"Left"!=c&&"Right"!=c&&"Ctrl"!=c&&"Alt"!=c&&"Shift"!=c&&R.searchHistoryController.reset();try{u=Fe(t,i,!0,!0)}catch(n){}u?t.scrollIntoView(We(t,!r,u),30):(qe(t),t.scrollTo(l.left,l.top))},onKeyDown:function(n,i,r){var o=e.keyName(n);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==i?(R.searchHistoryController.pushInput(i),R.searchHistoryController.reset(),Fe(t,a),qe(t),t.scrollTo(l.left,l.top),e.e_stop(n),$(t),r(),t.focus()):"Up"==o||"Down"==o?e.e_stop(n):"Ctrl-U"==o&&(e.e_stop(n),r(""))}});break;case"wordUnderCursor":var c=_e(t,!1,!0,!1,!0),p=!0;if(c||(c=_e(t,!1,!0,!1,!1),p=!1),!c)return;var h=t.getLine(c.start.line).substring(c.start.ch,c.end.ch);h=p&&o?"\\b"+h+"\\b":h.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),R.jumpList.cachedCursor=t.getCursor(),t.setCursor(c.start),d(h,!0,!1)}}function d(e,r,o){R.searchHistoryController.pushInput(e),R.searchHistoryController.reset();try{Fe(t,e,r,o)}catch(n){return ze(t,"Invalid regex: "+e),void $(t)}V.processMotion(t,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:i.searchArgs.toJumplist}})}},processEx:function(t,n,i){function r(e){R.exCommandHistoryController.pushInput(e),R.exCommandHistoryController.reset(),Je.processCommand(t,e),$(t)}function o(n,i,r){var o,s,a=e.keyName(n);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==i)&&(R.exCommandHistoryController.pushInput(i),R.exCommandHistoryController.reset(),e.e_stop(n),$(t),r(),t.focus()),"Up"==a||"Down"==a?(e.e_stop(n),o="Up"==a,s=n.target?n.target.selectionEnd:0,r(i=R.exCommandHistoryController.nextMatch(i,o)||""),s&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(s,n.target.value.length))):"Ctrl-U"==a?(e.e_stop(n),r("")):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&R.exCommandHistoryController.reset()}"keyToEx"==i.type?Je.processCommand(t,i.exArgs.input):n.visualMode?Be(t,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):Be(t,{onClose:r,prefix:":",onKeyDown:o})},evalInput:function(e,n){var i,r,o,s=n.inputState,a=s.motion,l=s.motionArgs||{},u=s.operator,c=s.operatorArgs||{},p=s.registerName,h=n.sel,d=ne(n.visualMode?Q(e,h.head):e.getCursor("head")),f=ne(n.visualMode?Q(e,h.anchor):e.getCursor("anchor")),y=ne(d),m=ne(f);if(u&&this.recordLastEdit(n,s),(o=void 0!==s.repeatOverride?s.repeatOverride:s.getRepeat())>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1,l.repeatIsExplicit=!1),s.selectedCharacter&&(l.selectedCharacter=c.selectedCharacter=s.selectedCharacter),l.repeat=o,$(e),a){var g=K[a](e,d,l,n,s);if(n.lastMotion=K[a],!g)return;if(l.toJumplist){var _=R.jumpList,v=_.cachedCursor;v?(ve(e,v,g),delete _.cachedCursor):ve(e,d,g)}g instanceof Array?(r=g[0],i=g[1]):i=g,i||(i=ne(d)),n.visualMode?(n.visualBlock&&i.ch===1/0||(i=Q(e,i)),r&&(r=Q(e,r)),r=r||m,h.anchor=r,h.head=i,fe(e),Te(e,n,"<",re(r,i)?r:i),Te(e,n,">",re(r,i)?i:r)):u||(i=Q(e,i),e.setCursor(i.line,i.ch))}if(u){if(c.lastSel){r=m;var b=c.lastSel,x=Math.abs(b.head.line-b.anchor.line),w=Math.abs(b.head.ch-b.anchor.ch);i=b.visualLine?new t(m.line+x,m.ch):b.visualBlock?new t(m.line+x,m.ch+w):b.head.line==b.anchor.line?new t(m.line,m.ch+w):new t(m.line+x,m.ch),n.visualMode=!0,n.visualLine=b.visualLine,n.visualBlock=b.visualBlock,h=n.sel={anchor:r,head:i},fe(e)}else n.visualMode&&(c.lastSel={anchor:ne(h.anchor),head:ne(h.head),visualBlock:n.visualBlock,visualLine:n.visualLine});var k,S,C,E,L;if(n.visualMode){if(k=oe(h.head,h.anchor),S=se(h.head,h.anchor),C=n.visualLine||c.linewise,L=ye(e,{anchor:k,head:S},E=n.visualBlock?"block":C?"line":"char"),C){var M=L.ranges;if("block"==E)for(var A=0;A0&&o&&T(o);o=r.pop())n.line--,n.ch=0;o?(n.line--,n.ch=le(e,n.line)):n.ch=0}}(e,k,S),L=ye(e,{anchor:k,head:S},E="char",!l.inclusive||C)}e.setSelections(L.ranges,L.primary),n.lastMotion=null,c.repeat=o,c.registerName=p,c.linewise=C;var P=X[u](e,c,L.ranges,m,i);n.visualMode&&me(e,null!=P),P&&e.setCursor(P)}},recordLastEdit:function(e,t,n){var i=R.macroModeState;i.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,i.lastInsertModeChanges.changes=[],i.lastInsertModeChanges.expectCursorActivityForChange=!1,i.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},K={moveToTopLine:function(e,n,i){var r=Ue(e).top+i.repeat-1;return new t(r,ge(e.getLine(r)))},moveToMiddleLine:function(e){var n=Ue(e),i=Math.floor(.5*(n.top+n.bottom));return new t(i,ge(e.getLine(i)))},moveToBottomLine:function(e,n,i){var r=Ue(e).bottom-i.repeat+1;return new t(r,ge(e.getLine(r)))},expandToLine:function(e,n,i){return new t(n.line+i.repeat-1,1/0)},findNext:function(e,t,n){var i=Oe(e),r=i.getQuery();if(r){var o=!n.forward;return o=i.isReversed()?!o:o,$e(e,r),We(e,o,r,n.repeat)}},findAndSelectNextInclusive:function(n,i,r,o,s){var a=Oe(n),l=a.getQuery();if(l){var u=!r.forward,c=function(e,n,i,r,o){void 0===r&&(r=1);return e.operation(function(){var s=e.getCursor(),a=e.getSearchCursor(i,s),l=a.find(!n);!o.visualMode&&l&&ie(a.from(),s)&&a.find(!n);for(var u=0;ul:p.linec&&o.line==c?Se(e,n,i,r,!0):(i.toFirstChar&&(s=ge(e.getLine(l)),r.lastHPos=s),r.lastHSPos=e.charCoords(new t(l,s),"div").left,new t(l,s))},moveByDisplayLines:function(e,n,i,r){var o=n;switch(r.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:r.lastHSPos=e.charCoords(o,"div").left}var s=i.repeat;if((l=e.findPosV(o,i.forward?s:-s,"line",r.lastHSPos)).hitSide)if(i.forward)var a={top:e.charCoords(l,"div").top+8,left:r.lastHSPos},l=e.coordsChar(a,"div");else{var u=e.charCoords(new t(e.firstLine(),0),"div");u.left=r.lastHSPos,l=e.coordsChar(u,"div")}return r.lastHPos=l.ch,l},moveByPage:function(e,t,n){var i=t,r=n.repeat;return e.findPosV(i,n.forward?r:-r,"page")},moveByParagraph:function(e,t,n){var i=n.forward?1:-1;return Le(e,t,n.repeat,i)},moveBySentence:function(e,n,i){var r=i.forward?1:-1;return function(e,n,i,r){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!k(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function s(e,t,n,i){var r=e.getLine(t),s=""===r,a={line:r,ln:t,pos:n,dir:i},l={ln:a.ln,pos:a.pos},u=""===a.line;for(o(e,a);null!==a.line;){if(l.ln=a.ln,l.pos=a.pos,""===a.line&&!u)return{ln:a.ln,pos:a.pos};if(s&&""!==a.line&&!T(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!E(a.line[a.pos])||s||a.pos!==a.line.length-1&&!T(a.line[a.pos+1])||(s=!0),o(e,a)}var r=e.getLine(l.ln);l.pos=0;for(var c=r.length-1;c>=0;--c)if(!T(r[c])){l.pos=c;break}return l}function a(e,t,n,i){var r=e.getLine(t),s={line:r,ln:t,pos:n,dir:i},a={ln:s.ln,pos:null},l=""===s.line;for(o(e,s);null!==s.line;){if(""===s.line&&!l)return null!==a.pos?a:{ln:s.ln,pos:s.pos};if(E(s.line[s.pos])&&null!==a.pos&&(s.ln!==a.ln||s.pos+1!==a.pos))return a;""===s.line||T(s.line[s.pos])||(l=!1,a={ln:s.ln,pos:s.pos}),o(e,s)}var r=e.getLine(a.ln);a.pos=0;for(var u=0;u0;)l=r<0?a(e,l.ln,l.pos,r):s(e,l.ln,l.pos,r),i--;return new t(l.ln,l.pos)}(e,n,i.repeat,r)},moveByScroll:function(e,t,n,i){var r,o=e.getScrollInfo(),s=n.repeat;s||(s=o.clientHeight/(2*e.defaultTextHeight()));var a=e.charCoords(t,"local");if(n.repeat=s,!(r=K.moveByDisplayLines(e,t,n,i)))return null;var l=e.charCoords(r,"local");return e.scrollTo(null,o.top+l.top-a.top),r},moveByWords:function(e,n,i){return function(e,n,i,r,o,s){var a=ne(n),l=[];(r&&!o||!r&&o)&&i++;for(var u=!(r&&o),c=0;c0)p.index=0;else{var y=p.lineText.length;p.index=y>0?y-1:0}p.nextCh=p.lineText.charAt(p.index)}f(p)&&(o.line=u,o.ch=p.index,n--)}if(p.nextCh||p.curMoveThrough)return new t(u,p.index);return o}(e,i.repeat,i.forward,i.selectedCharacter)||n},moveToColumn:function(e,n,i,r){var o=i.repeat;return r.lastHPos=o-1,r.lastHSPos=e.charCoords(n,"div").left,function(e,n){var i=e.getCursor().line;return Q(e,new t(i,n-1))}(e,o)},moveToEol:function(e,t,n,i){return Se(e,t,n,i,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,n){var i=n;return new t(i.line,ge(e.getLine(i.line)))},moveToMatchedSymbol:function(e,n){for(var i,r=n,o=r.line,s=r.ch,a=e.getLine(o);s"===s?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new t(o,s),{bracketRegex:u}).to}return r},moveToStartOfLine:function(e,n){return new t(n.line,0)},moveToLineOrEdgeOfDocument:function(e,n,i){var r=i.forward?e.lastLine():e.firstLine();return i.repeatIsExplicit&&(r=i.repeat-e.getOption("firstLineNumber")),new t(r,ge(e.getLine(r)))},moveToStartOfDisplayLine:function(e){return e.execCommand("goLineLeft"),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand("goLineRight");var t=e.getCursor();return"before"==t.sticky&&t.ch--,t},textObjectManipulation:function(n,i,r,o){var s=r.selectedCharacter;"b"==s?s="(":"B"==s&&(s="{");var a,l=!r.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[s])a=function(e,n,i,r){var o,s,a=n,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[i],u={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[i],c=e.getLine(a.line).charAt(a.ch)===u?1:0;if(o=e.scanForBracket(new t(a.line,a.ch+c),-1,void 0,{bracketRegex:l}),s=e.scanForBracket(new t(a.line,a.ch+c),1,void 0,{bracketRegex:l}),!o||!s)return{start:a,end:a};if(o=o.pos,s=s.pos,o.line==s.line&&o.ch>s.ch||o.line>s.line){var p=o;o=s,s=p}r?s.ch+=1:o.ch+=1;return{start:o,end:s}}(n,i,s,l);else if({"'":!0,'"':!0,"`":!0}[s])a=function(e,n,i,r){var o,s,a,l,u=ne(n),c=e.getLine(u.line).split(""),p=c.indexOf(i);u.ch-1&&!o;a--)c[a]==i&&(o=a+1);else o=u.ch+1;if(o&&!s)for(a=o,l=c.length;a0&&E(c[i.ch])&&(i.ch-=1);var p=Me(n,i,r.repeat,1,l),h=Me(n,i,r.repeat,-1,l);T(n.getLine(h.line)[h.ch])&&T(n.getLine(p.line)[p.ch-1])&&(h={line:h.line,ch:h.ch+1}),a={start:h,end:p}}return n.state.vim.visualMode?function(e,n,i){var r,o=e.state.vim.sel,s=o.head,a=o.anchor;re(i,n)&&(r=i,i=n,n=r);re(s,a)?(s=oe(n,s),a=se(a,i)):(a=oe(n,a),-1==(s=Z(s=se(s,i),0,-1)).ch&&s.line!=e.firstLine()&&(s=new t(s.line-1,le(e,s.line-1))));return[a,s]}(n,a.start,a.end):[a.start,a.end]},repeatLastCharacterSearch:function(e,t,n){var i=R.lastCharacterSearch,r=n.repeat,o=n.forward===i.forward,s=(i.increment?1:0)*(o?-1:1);e.moveH(-s,"char"),n.inclusive=!!o;var a=Ce(e,r,o,i.selectedCharacter);return a?(a.ch+=s,a):(e.moveH(s,"char"),t)}};function G(e,t){for(var n=[],i=0;in.lastLine()&&i.linewise&&!f?n.replaceRange("",d,u):n.replaceRange("",l,u),i.linewise&&(f||(n.setCursor(d),e.commands.newlineAndIndent(n)),l.ch=Number.MAX_VALUE),o=l}R.registerController.pushText(i.registerName,"change",s,i.linewise,r.length>1),J.enterInsertMode(n,{head:o},n.state.vim)},delete:function(e,n,i){var r,o,s=e.state.vim;if(s.visualBlock){o=e.getSelection();var a=G("",i.length);e.replaceSelections(a),r=oe(i[0].head,i[0].anchor)}else{var l=i[0].anchor,u=i[0].head;n.linewise&&u.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==u.line-1&&(l.line==e.firstLine()?l.ch=0:l=new t(l.line-1,le(e,l.line-1))),o=e.getRange(l,u),e.replaceRange("",l,u),r=l,n.linewise&&(r=K.moveToFirstNonWhiteSpaceCharacter(e,l))}return R.registerController.pushText(n.registerName,"delete",o,n.linewise,s.visualBlock),Q(e,r)},indent:function(e,t,n){var i=e.state.vim;if(e.indentMore)for(var r=i.visualMode?t.repeat:1,o=0;ou.top?(l.line+=(a-u.top)/r,l.line=Math.ceil(l.line),e.setCursor(l),u=e.charCoords(l,"local"),e.scrollTo(null,u.top)):e.scrollTo(null,a);else{var c=a+e.getScrollInfo().clientHeight;c=s.anchor.line?Z(s.head,0,1):new t(s.anchor.line,0)}else if("inplace"==o){if(r.visualMode)return}else"lastEdit"==o&&(a=Ke(n)||a);n.setOption("disableInput",!1),i&&i.replace?(n.toggleOverwrite(!0),n.setOption("keyMap","vim-replace"),e.signal(n,"vim-mode-change",{mode:"replace"})):(n.toggleOverwrite(!1),n.setOption("keyMap","vim-insert"),e.signal(n,"vim-mode-change",{mode:"insert"})),R.macroModeState.isPlaying||(n.on("change",et),e.on(n.getInputField(),"keydown",rt)),r.visualMode&&me(n),he(n,a,l)}},toggleVisualMode:function(n,i,r){var o,s=i.repeat,a=n.getCursor();r.visualMode?r.visualLine^i.linewise||r.visualBlock^i.blockwise?(r.visualLine=!!i.linewise,r.visualBlock=!!i.blockwise,e.signal(n,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),fe(n)):me(n):(r.visualMode=!0,r.visualLine=!!i.linewise,r.visualBlock=!!i.blockwise,o=Q(n,new t(a.line,a.ch+s-1)),r.sel={anchor:a,head:o},e.signal(n,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),fe(n),Te(n,r,"<",oe(a,o)),Te(n,r,">",se(a,o)))},reselectLastSelection:function(t,n,i){var r=i.lastSelection;if(i.visualMode&&de(t,i),r){var o=r.anchorMark.find(),s=r.headMark.find();if(!o||!s)return;i.sel={anchor:o,head:s},i.visualMode=!0,i.visualLine=r.visualLine,i.visualBlock=r.visualBlock,fe(t),Te(t,i,"<",oe(o,s)),Te(t,i,">",se(o,s)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""})}},joinLines:function(e,n,i){var r,o;if(i.visualMode){if(r=e.getCursor("anchor"),re(o=e.getCursor("head"),r)){var s=o;o=r,r=s}o.ch=le(e,o.line)-1}else{var a=Math.max(n.repeat,2);r=e.getCursor(),o=Q(e,new t(r.line+a-1,1/0))}for(var l=0,u=r.line;u1)d=Array(n.repeat+1).join(d);var f,y,m=o.linewise,g=o.blockwise;if(g){d=d.split("\n"),m&&d.pop();for(var _=0;_e.lastLine()&&e.replaceRange("\n",new t(T,0)),le(e,T)c.length&&(o=c.length),s=new t(l.line,o)}if("\n"==a)r.visualMode||n.replaceRange("",l,s),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(n);else{var p=n.getRange(l,s);if(p=p.replace(/[^\n]/g,a),r.visualBlock){var h=new Array(n.getOption("tabSize")+1).join(" ");p=(p=n.getSelection()).replace(/\t/g,h).replace(/[^\n]/g,a).split("\n"),n.replaceSelections(p)}else n.replaceRange(p,l,s);r.visualMode?(l=re(u[0].anchor,u[0].head)?u[0].anchor:u[0].head,n.setCursor(l),me(n,!1)):n.setCursor(Z(s,0,-1))}},incrementNumberToken:function(e,n){for(var i,r,o,s,a=e.getCursor(),l=e.getLine(a.line),u=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(i=u.exec(l))&&(o=(r=i.index)+i[0].length,!(a.ch"==t.slice(-11)){var n=t.length-11,i=e.slice(0,n),r=t.slice(0,n);return i==r&&e.length>n?"full":0==r.indexOf(i)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function te(e,t,n){return function(){for(var i=0;i2&&(t=oe.apply(void 0,Array.prototype.slice.call(arguments,1))),re(e,t)?e:t}function se(e,t){return arguments.length>2&&(t=se.apply(void 0,Array.prototype.slice.call(arguments,1))),re(e,t)?t:e}function ae(e,t,n){var i=re(e,t),r=re(t,n);return i&&r}function le(e,t){return e.getLine(t).length}function ue(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ce(e,n,i){var r=le(e,n),o=new Array(i-r+1).join(" ");e.setCursor(new t(n,r)),e.replaceRange(o,e.getCursor())}function pe(e,n){var i=[],r=e.listSelections(),o=ne(e.clipPos(n)),s=!ie(n,o),a=function(e,t,n){for(var i=0;ia?u:0,p=r[c].anchor,h=Math.min(p.line,o.line),d=Math.max(p.line,o.line),f=p.ch,y=o.ch,m=r[c].head.ch-f,g=y-f;m>0&&g<=0?(f++,s||y--):m<0&&g>=0?(f--,l||y++):m<0&&-1==g&&(f--,y++);for(var _=h;_<=d;_++){var v={anchor:new t(_,f),head:new t(_,y)};i.push(v)}return e.setSelections(i),n.ch=y,p.ch=f,p}function he(e,t,n){for(var i=[],r=0;ru&&(o.line=u),o.ch=le(e,o.line)}return{ranges:[{anchor:s,head:o}],primary:0}}if("block"==i){var c=Math.min(s.line,o.line),p=s.ch,h=Math.max(s.line,o.line),d=o.ch;p=a.length)return null;r?u=y[0]:(u=f[0])(a.charAt(l))||(u=f[1]);for(var c=l,p=l;u(a.charAt(c))&&c=0;)p--;if(p++,n){for(var h=c;/\s/.test(a.charAt(c))&&c0;)p--;p||(p=d)}}return{start:new t(s.line,p),end:new t(s.line,c)}}function ve(e,t,n){ie(t,n)||R.jumpList.add(e,t,n)}function be(e,t){R.lastCharacterSearch.increment=e,R.lastCharacterSearch.forward=t.forward,R.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var xe={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},we={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/^#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function ke(e,t,n,i,r){var o=t.line,s=t.ch,a=e.getLine(o),l=n?1:-1,u=i?y:f;if(r&&""==a){if(o+=l,a=e.getLine(o),!k(e,o))return null;s=n?0:a.length}for(;;){if(r&&""==a)return{from:0,to:0,line:o};for(var c=l>0?a.length:-1,p=c,h=c;s!=c;){for(var d=!1,m=0;m0?0:a.length}}function Se(e,n,i,r,o){var s=new t(n.line+i.repeat-1,1/0),a=e.clipPos(s);return a.ch--,o||(r.lastHPos=1/0,r.lastHSPos=e.charCoords(a,"div").left),s}function Ce(e,n,i,r){for(var o,s=e.getCursor(),a=s.ch,l=0;l0;)h(c,r)&&i--,c+=r;return new t(c,0)}var d=e.state.vim;if(d.visualLine&&h(a,1,!0)){var f=d.sel.anchor;h(f.line,-1,!0)&&(o&&f.line==a||(a+=1))}var y=p(a);for(c=a;c<=u&&i;c++)h(c,1,!0)&&(o&&p(c)==y||i--);for(s=new t(c,0),c>u&&!y?y=!0:o=!1,c=a;c>l&&(o&&p(c)!=y&&c!=a||!h(c,-1,!0));c--);return{start:new t(c,0),end:s}}function Me(e,n,i,r,o){function s(e){e.pos+e.dir<0||e.pos+e.dir>=e.line.length?e.line=null:e.pos+=e.dir}function a(e,t,n,i){var r={line:e.getLine(t),ln:t,pos:n,dir:i};if(""===r.line)return{ln:r.ln,pos:r.pos};var a=r.pos;for(s(r);null!==r.line;){if(a=r.pos,E(r.line[r.pos])){if(o){for(s(r);null!==r.line&&T(r.line[r.pos]);)a=r.pos,s(r);return{ln:r.ln,pos:a+1}}return{ln:r.ln,pos:r.pos+1}}s(r)}return{ln:r.ln,pos:a+1}}function l(e,t,n,i){var r=e.getLine(t),a={line:r,ln:t,pos:n,dir:i};if(""===a.line)return{ln:a.ln,pos:a.pos};var l=a.pos;for(s(a);null!==a.line;){if(T(a.line[a.pos])||E(a.line[a.pos])){if(E(a.line[a.pos]))return o&&T(a.line[a.pos+1])?{ln:a.ln,pos:a.pos+1}:{ln:a.ln,pos:l}}else l=a.pos;s(a)}return a.line=r,o&&T(a.line[a.pos])?{ln:a.ln,pos:a.pos}:{ln:a.ln,pos:l}}for(var u={ln:n.line,pos:n.ch};i>0;)u=r<0?l(e,u.ln,u.pos,r):a(e,u.ln,u.pos,r),i--;return new t(u.ln,u.pos)}function Ae(){}function Oe(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new Ae)}function Pe(e,t){var n=Re(e,t)||[];if(!n.length)return[];var i=[];if(0===n[0]){for(var r=0;r@~])/);return n.commandName=i?i[1]:t.match(/.*/)[0],n},parseLineSpec_:function(e,t){var n=t.match(/^(\d+)/);if(n)return parseInt(n[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var i=t.next(),r=Ve(e,e.state.vim,i);if(!r)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,r.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var n=e.match(/^([+-])?(\d+)/);if(n){var i=parseInt(n[2],10);"-"==n[1]?t-=i:t+=i}return t},parseCommandArgs_:function(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)[0];var i=n.argDelimiter||/\s+/,r=ue(t.argString).split(i);r.length&&r[0]&&(t.args=r)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var i=this.commandMap_[n];if(0===i.name.indexOf(e))return i}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e1)return"Invalid arguments";a=(u?"decimal":c&&"hex")||p&&"octal"}n[2]&&(l=new RegExp(n[2].substr(1,n[2].length-2),o?"i":""))}}();if(u)ze(n,u+": "+i.argString);else{var c=i.line||n.firstLine(),p=i.lineEnd||i.line||n.lastLine();if(c!=p){var h=new t(c,0),d=new t(p,le(n,p)),f=n.getRange(h,d).split("\n"),y=l||("decimal"==a?/(-?)([\d]+)/:"hex"==a?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==a?/([0-7]+)/:null),m="decimal"==a?10:"hex"==a?16:"octal"==a?8:null,g=[],_=[];if(a||l)for(var v=0;v=n&&e<=a:e==n);)if(i||s.from().line!=p||h)return t.scrollIntoView(s.from(),30),t.setSelection(s.from(),s.to()),c=s.from(),void(d=!1);var e,n,a;d=!0}function _(e){if(e&&e(),t.focus(),c){t.setCursor(c);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=c.ch}u&&u()}if(g(),d)return void ze(t,"No matches for "+a.source);if(!n)return f(),void(u&&u());Be(t,{prefix:De("span","replace with ",De("strong",l)," (y/n/a/q/l)"),onKeyDown:function(n,i,r){switch(e.e_stop(n),e.keyName(n)){case"Y":y(),g();break;case"N":g();break;case"A":var o=u;u=void 0,t.operation(f),u=o;break;case"L":y();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":_(r)}d&&_(r);return!0}})}(n,p,h,y,m,n.getSearchCursor(f,g),f,c,i.callback)}else ze(n,"No previous substitute regular expression")},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){qe(e)},yank:function(e){var t=ne(e.getCursor()).line,n=e.getLine(t);R.registerController.pushText("0","yank",n,!0,!0)},delmarks:function(t,n){if(n.argString&&ue(n.argString))for(var i=t.state.vim,r=new e.StringStream(ue(n.argString));!r.eol();){r.eatSpace();var o=r.pos;if(!r.match(/[a-zA-Z]/,!1))return void ze(t,"Invalid argument: "+n.argString.substring(o));var s=r.next();if(r.match("-",!0)){if(!r.match(/[a-zA-Z]/,!1))return void ze(t,"Invalid argument: "+n.argString.substring(o));var a=s,l=r.next();if(!(S(a)&&S(l)||C(a)&&C(l)))return void ze(t,"Invalid argument: "+a+"-");var u=a.charCodeAt(0),c=l.charCodeAt(0);if(u>=c)return void ze(t,"Invalid argument: "+n.argString.substring(o));for(var p=0;p<=c-u;p++){var h=String.fromCharCode(u+p);delete i.marks[h]}}else delete i.marks[s]}else ze(t,"Argument required")}},Je=new Ge;function Qe(t){var n=t.state.vim,i=R.macroModeState,r=R.registerController.getRegister("."),o=i.isPlaying,s=i.lastInsertModeChanges;o||(t.off("change",et),e.off(t.getInputField(),"keydown",rt)),!o&&n.insertModeRepeat>1&&(ot(t,n,n.insertModeRepeat-1,!0),n.lastEditInputState.repeatOverride=n.insertModeRepeat),delete n.insertModeRepeat,n.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),r.setText(s.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),i.isRecording&&function(e){if(e.isPlaying)return;var t=e.latestRegister,n=R.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}(i)}function Ye(e){i.unshift(e)}function Ze(e,t,n,i){var r=R.registerController.getRegister(i);if(":"==i)return r.keyBuffer[0]&&Je.processCommand(e,r.keyBuffer[0]),void(n.isPlaying=!1);var o=r.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=r.searchQueries.slice(0);for(var a=0;a|<\w+>|./.exec(c))[0],c=c.substring(l.index+u.length),F.handleKey(e,u,"macro"),t.insertMode){var p=r.insertModeChanges[s++].changes;R.macroModeState.lastInsertModeChanges.changes=p,st(e,p,1),Qe(e)}n.isPlaying=!1}function et(e,t){var n=R.macroModeState,i=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(i.expectCursorActivityForChange=!0,i.ignoreCount>1)i.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var r=e.listSelections().length;r>1&&(i.ignoreCount=r);var o=t.text.join("\n");i.maybeReset&&(i.changes=[],i.maybeReset=!1),o&&(e.state.overwrite&&!/\n/.test(o)?i.changes.push([o]):i.changes.push(o))}t=t.next}}function tt(e){var t=e.state.vim;if(t.insertMode){var n=R.macroModeState;if(n.isPlaying)return;var i=n.lastInsertModeChanges;i.expectCursorActivityForChange?i.expectCursorActivityForChange=!1:i.maybeReset=!0}else e.curOp.isVimOp||nt(e,t)}function nt(t,n){var i=t.getCursor("anchor"),r=t.getCursor("head");if(n.visualMode&&!t.somethingSelected()?me(t,!1):n.visualMode||n.insertMode||!t.somethingSelected()||(n.visualMode=!0,n.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),n.visualMode){var o=re(r,i)?0:-1,s=re(r,i)?-1:0;r=Z(r,0,o),i=Z(i,0,s),n.sel={anchor:i,head:r},Te(t,n,"<",oe(r,i)),Te(t,n,">",se(r,i))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function it(e){this.keyName=e}function rt(t){var n=R.macroModeState.lastInsertModeChanges,i=e.keyName(t);i&&(-1==i.indexOf("Delete")&&-1==i.indexOf("Backspace")||e.lookupKey(i,"vim-insert",function(){return n.maybeReset&&(n.changes=[],n.maybeReset=!1),n.changes.push(new it(i)),!0}))}function ot(e,t,n,i){var r=R.macroModeState;r.isPlaying=!0;var o=!!t.lastEditActionCommand,s=t.inputState;function a(){o?V.processAction(e,t,t.lastEditActionCommand):V.evalInput(e,t)}function l(n){if(r.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var i=r.lastInsertModeChanges;st(e,i.changes,n)}}if(t.inputState=t.lastEditInputState,o&&t.lastEditActionCommand.interlaceInsertRepeat)for(var u=0;un&&(n=e.line_indent_level)),{mode:t,parent:e,last_token:e?e.last_token:new r(c.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:e?e.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},x.prototype._reset=function(e){var t=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,t),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(g.BlockStatement);var n=new a(e,this._options);return this._tokens=n.tokenize(),e},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&o.lineBreak.test(e||"")&&(t=e.match(o.lineBreak)[0]));for(var n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(t)},x.prototype.handle_token=function(e,t){e.type===c.START_EXPR?this.handle_start_expr(e):e.type===c.END_EXPR?this.handle_end_expr(e):e.type===c.START_BLOCK?this.handle_start_block(e):e.type===c.END_BLOCK?this.handle_end_block(e):e.type===c.WORD?this.handle_word(e):e.type===c.RESERVED?this.handle_word(e):e.type===c.SEMICOLON?this.handle_semicolon(e):e.type===c.STRING?this.handle_string(e):e.type===c.EQUALS?this.handle_equals(e):e.type===c.OPERATOR?this.handle_operator(e):e.type===c.COMMA?this.handle_comma(e):e.type===c.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===c.COMMENT?this.handle_comment(e,t):e.type===c.DOT?this.handle_dot(e):e.type===c.EOF?this.handle_eof(e):(e.type,c.UNKNOWN,this.handle_unknown(e,t))},x.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,i=this._options.keep_array_indentation&&v(this._flags.mode);if(e.comments_before)for(var r=e.comments_before.next();r;)this.handle_whitespace_and_comments(r,t),this.handle_token(r,t),r=e.comments_before.next();if(i)for(var o=0;o0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var s=1;s0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===g.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},x.prototype.start_of_object_property=function(){return this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},x.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||d(this._flags.last_token,["var","let","const"])&&e.type===c.WORD)||h(this._flags.last_token,"do"))||!(this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement)&&d(this._flags.last_token,w)&&!e.newlines)||h(this._flags.last_token,"else")&&!(h(e,"if")&&!e.comments_before))||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===g.ForInitializer||this._previous_flags.mode===g.Conditional))||this._flags.last_token.type===c.WORD&&this._flags.mode===g.BlockStatement&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==c.WORD&&e.type!==c.RESERVED)||this._flags.mode===g.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(g.Statement),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,d(e,["do","for","if","while"])),!0)},x.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=g.Expression;if("["===e.text){if(this._flags.last_token.type===c.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=g.ArrayLiteral,v(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),p(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=g.ForInitializer):p(this._flags.last_token.text,["if","while"])?(this._output.space_before_token=this._options.space_before_conditional,t=g.Conditional):p(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(p(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var i=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(i,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g.ObjectLiteral&&("{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==i.text&&","!==i.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===c.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(p(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&p(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===c.START_BLOCK?this.print_newline():this._flags.last_token.type!==c.END_EXPR&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==c.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},x.prototype.handle_end_expr=function(e){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==c.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===g.Conditional&&(this._previous_flags.mode=g.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},x.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(g.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(g.BlockStatement):n&&(p(n.text,[":",","])&&p(t.type,[c.STRING,c.WORD,c.RESERVED])||p(t.text,["get","set","..."])&&p(n.type,[c.WORD,c.RESERVED]))?p(this._last_last_text,["class","interface"])?this.set_mode(g.BlockStatement):this.set_mode(g.ObjectLiteral):this._flags.last_token.type===c.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(g.BlockStatement):p(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g.ObjectLiteral):this.set_mode(g.BlockStatement);var i=!t.comments_before&&"}"===t.text,r=i&&"function"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var o=0,s=null;this._flags.inline_frame=!0;do{if(o+=1,(s=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(s.type!==c.EOF&&(s.type!==c.END_BLOCK||s.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(r||this._flags.last_token.type===c.EQUALS||d(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!v(this._previous_flags.mode)||this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.COMMA||((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type!==c.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(e),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},x.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===g.Statement;)this.restore_mode();var t=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(v(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},x.prototype.handle_word=function(e){if(e.type===c.RESERVED)if(p(e.text,["set","get"])&&this._flags.mode!==g.ObjectLiteral)e.type=c.WORD;else if("import"===e.text&&"("===this._tokens.peek().text)e.type=c.WORD;else if(p(e.text,["as","from"])&&!this._flags.import_block)e.type=c.WORD;else if(this._flags.mode===g.ObjectLiteral){":"===this._tokens.peek().text&&(e.type=c.WORD)}if(this.start_of_statement(e)?d(this._flags.last_token,["var","let","const"])&&e.type===c.WORD&&(this._flags.declaration_statement=!0):!e.newlines||b(this._flags.mode)||this._flags.last_token.type===c.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===c.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(h(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&h(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===g.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(e,["case","default"]))return this.print_newline(),this._flags.last_token.type!==c.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.EQUALS&&this._flags.last_token.type!==c.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e),h(e,"function"))return(p(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!p(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==c.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,w)?this._output.space_before_token=!0:h(this._flags.last_token,"default")&&"export"===this._last_last_text?this._output.space_before_token=!0:"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!b(this._flags.mode)&&!v(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":d(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===g.BlockStatement?t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&b(this._flags.mode)?t="SPACE":this._flags.last_token.type===c.STRING?t="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||"*"===this._flags.last_token.text&&(p(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&p(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===c.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),d(e,l)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(e,["else","catch","finally"]))?(this._flags.last_token.type!==c.END_BLOCK||this._previous_flags.mode!==g.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?d(this._flags.last_token,f)?this._output.space_before_token=!0:"declare"===this._flags.last_token.text&&d(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?this._flags.last_token.type===c.START_EXPR&&d(e,["var","let","const"])||":"===this._flags.last_token.text||(h(e,"if")&&h(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(e,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&v(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==c.WORD&&e.previous.type!==c.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===c.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&h(e,"from")&&(this._flags.import_block=!1))},x.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==g.Statement||this._flags.if_block&&h(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},x.prototype.handle_string=function(e){this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):this.print_newline()),this.print_token(e)},x.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},x.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(b(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===g.ObjectLiteral||this._flags.mode===g.Statement&&this._flags.parent.mode===g.ObjectLiteral?(this._flags.mode===g.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},x.prototype.handle_operator=function(e){var t="*"===e.text&&(d(this._flags.last_token,["function","yield"])||p(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),n=p(e.text,["-","+"])&&(p(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||p(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var i=!t;this.handle_whitespace_and_comments(e,i)}if(d(this._flags.last_token,f))return this._output.space_before_token=!0,void this.print_token(e);if("*"!==e.text||this._flags.last_token.type!==c.DOT)if("::"!==e.text){if(this._flags.last_token.type===c.OPERATOR&&p(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var r=!0,o=!0,s=!1;if(":"===e.text?0===this._flags.ternary_depth?r=!1:(this._flags.ternary_depth-=1,s=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&p(e.text,u)){var a=":"===e.text,h=a&&s,_=a&&!s;switch(this._options.operator_position){case y.before_newline:return this._output.space_before_token=!_,this.print_token(e),a&&!h||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case y.after_newline:return this._output.space_before_token=!0,!a||h?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case y.preserve_newline:return _||this.allow_wrap_or_preserved_newline(e),r=!(this._output.just_added_newline()||_),this._output.space_before_token=r,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),r=!1;var v=this._tokens.peek();o=v&&p(v.type,[c.WORD,c.RESERVED])}else"..."===e.text?(this.allow_wrap_or_preserved_newline(e),r=this._flags.last_token.type===c.START_BLOCK,o=!1):(p(e.text,["--","++","!","~"])||n)&&(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR||this.allow_wrap_or_preserved_newline(e),r=!1,o=!1,!e.newlines||"--"!==e.text&&"++"!==e.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&b(this._flags.mode)&&(r=!0),this._flags.last_token.type===c.RESERVED?r=!0:this._flags.last_token.type===c.END_EXPR?r=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===c.OPERATOR&&(r=p(e.text,["--","-","++","+"])&&p(this._flags.last_token.text,["--","-","++","+"]),p(e.text,["+","-"])&&p(this._flags.last_token.text,["--","++"])&&(o=!0)),(this._flags.mode!==g.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==g.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||r,this.print_token(e),this._output.space_before_token=o}else this.print_token(e);else this.print_token(e)},x.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):o.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},x.prototype.print_block_commment=function(e,t){var n,i=function(e){for(var t=[],n=(e=e.replace(o.allLineBreaks,"\n")).indexOf("\n");-1!==n;)t.push(e.substring(0,n)),n=(e=e.substring(n+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),r=!1,s=!1,a=e.whitespace_before,l=a.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(r=function(e,t){for(var n=0;n0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function o(e,t){this.__indent_cache=new r(e,t),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var e=new i(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},i.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},i.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},i.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},i.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},r.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},r.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},r.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},o.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(e,t){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==t){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},e.exports.Output=o},function(e,t,n){"use strict";e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(e,t,n){"use strict";var i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+i+"])";t.identifier=new RegExp(o+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a"+i+r+"])+");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")},function(e,t,n){"use strict";var i=n(6).Options,r=["before-newline","after-newline","preserve-newline"];function o(e){i.call(this,e,"js");var t=this.raw_options.brace_style||null;"expand-strict"===t?this.raw_options.brace_style="expand":"collapse-preserve-inline"===t?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o>> === !== << && >= ** != == <= >> || < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= = ! ? > < : / ^ - + * & % ~ |";g=(g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")).replace(/ /g,"|");var _,v=new RegExp(g),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),x=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),w=new RegExp("^(?:"+x.join("|")+")$"),k=function(e,t){r.call(this,e,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),i=new u(this._input).read_options(this._options);this.__patterns={template:i,identifier:i.starting_with(a.identifier).matching(a.identifierMatch),number:n.matching(d),punct:n.matching(v),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(a.lineBreak),shebang:n.starting_with(/#!/).until_after(a.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}};(k.prototype=new r)._is_comment=function(e){return e.type===p.COMMENT||e.type===p.BLOCK_COMMENT||e.type===p.UNKNOWN},k.prototype._is_opening=function(e){return e.type===p.START_BLOCK||e.type===p.START_EXPR},k.prototype._is_closing=function(e,t){return(e.type===p.END_BLOCK||e.type===p.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},k.prototype._reset=function(){_=!1},k.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(p.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(i))||this._read_string(i))||this._read_word(e))||this._read_singles(i))||this._read_comment(i))||this._read_regexp(i,e))||this._read_xml(i,e))||this._read_punctuation())||this._create_token(p.UNKNOWN,this._input.next())},k.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(a.allLineBreaks,"\n"),e.type!==p.DOT&&(e.type!==p.RESERVED||"set"!==e.text&&"get"!==e.text)&&w.test(t)?"in"===t||"of"===t?this._create_token(p.OPERATOR,t):this._create_token(p.RESERVED,t):this._create_token(p.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(p.WORD,t):void 0},k.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(p.START_EXPR,e):")"===e||"]"===e?t=this._create_token(p.END_EXPR,e):"{"===e?t=this._create_token(p.START_BLOCK,e):"}"===e?t=this._create_token(p.END_BLOCK,e):";"===e?t=this._create_token(p.SEMICOLON,e):"."===e&&y.test(this._input.peek(1))?t=this._create_token(p.DOT,e):","===e&&(t=this._create_token(p.COMMA,e)),t&&this._input.next(),t},k.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(p.EQUALS,e):this._create_token(p.OPERATOR,e)},k.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(p.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(p.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(f)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(p.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)t+=this._input.next();return _=!0,this._create_token(p.COMMENT,t)}}else if(_&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return _=!1,this._create_token(p.COMMENT,t);return null},k.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var i=h.get_directives(n);i&&"start"===i.ignore&&(n+=h.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),(t=this._create_token(p.BLOCK_COMMENT,n)).directives=i}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(p.COMMENT,n))}return t},k.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var t=this._input.next();return this.has_char_escapes=!1,t+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(t=function(e){var t="",n=0,r=new i(e),o=null;for(;r.hasNext();)if((o=r.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=o[0]),"\\"===r.peek()){if(r.next(),"x"===r.peek())o=r.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==r.peek()){t+="\\",r.hasNext()&&(t+=r.next());continue}o=r.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return e;if((n=parseInt(o[1],16))>126&&n<=255&&0===o[0].indexOf("x"))return e;if(n>=0&&n<32){t+="\\"+o[0];continue}t+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(t)),this._input.peek()===e&&(t+=this._input.next()),t=t.replace(a.allLineBreaks,"\n"),this._create_token(p.STRING,t)}return null},k.prototype._allow_regexp_or_xml=function(e){return e.type===p.RESERVED&&c(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===p.END_EXPR&&")"===e.text&&e.opened.previous.type===p.RESERVED&&c(e.opened.previous.text,["if","while","for"])||c(e.type,[p.COMMENT,p.START_EXPR,p.START_BLOCK,p.START,p.END_BLOCK,p.OPERATOR,p.EQUALS,p.EOF,p.SEMICOLON,p.COMMA])},k.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),i=!1,r=!1;this._input.hasNext()&&(i||r||this._input.peek()!==e)&&!this._input.testChar(a.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?r=!0:"]"===this._input.peek()&&(r=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(p.STRING,n)}return null},k.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",i=this.__patterns.xml.read_match();if(i){for(var r=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===r.indexOf("{"),s=0;i;){var l=!!i[1],u=i[2];if(!(!!i[i.length-1]||"![CDATA["===u.slice(0,8))&&(u===r||o&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--s:++s),n+=i[0],s<=0)break;i=this.__patterns.xml.read_match()}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(p.STRING,n)}}return null},k.prototype._read_string_recursive=function(e,t,n){var i,r;"'"===e?r=this.__patterns.single_quote:'"'===e?r=this.__patterns.double_quote:"`"===e?r=this.__patterns.template_text:"}"===e&&(r=this.__patterns.template_expression);for(var o=r.read(),s="";this._input.hasNext();){if((s=this._input.next())===e||!t&&a.newline.test(s)){this._input.back();break}"\\"===s&&this._input.hasNext()?("x"===(i=this._input.peek())||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),s+=this._input.next()):n&&("${"===n&&"$"===s&&"{"===this._input.peek()&&(s+=this._input.next()),n===s&&(s+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(s+=this._input.next()))),o+=s+=r.read()}return o},e.exports.Tokenizer=k,e.exports.TOKEN=p,e.exports.positionable_operators=m.slice(),e.exports.line_starters=b.slice()},function(e,t,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=r},function(e,t,n){"use strict";var i=n(8).InputScanner,r=n(3).Token,o=n(10).TokenStream,s=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new o,this._reset();for(var t=new r(a.START,""),n=null,i=[],s=new o;t.type!==a.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new o),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=a},function(e,t,n){"use strict";function i(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position=0&&e/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/)}}o.prototype=new i,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},o.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},o.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},o.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},o.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},o.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())));return e},e.exports.TemplatablePattern=o}]);"function"==typeof define&&define.amd?define([],function(){return{js_beautify:e}}):"undefined"!=typeof exports?exports.js_beautify=e:"undefined"!=typeof window?window.js_beautify=e:"undefined"!=typeof global&&(global.js_beautify=e)}(),function(){var e=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=18)}([,,function(e,t,n){"use strict";function i(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function r(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function o(e,t){this.__indent_cache=new r(e,t),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var e=new i(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},i.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},i.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},i.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},i.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},r.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},r.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},r.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},o.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(e,t){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==t){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},e.exports.Output=o},function(e,t,n){"use strict";e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},,,function(e,t,n){"use strict";function i(e,t){this.raw_options=r(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php"],["auto"])}function r(e,t){var n,i={};for(n in e=o(e))n!==t&&(i[n]=e[n]);if(t&&e[t])for(n in e[t])i[n]=e[t][n];return i}function o(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}i.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},i.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},i.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},i.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},i.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},i.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},i.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},e.exports.Options=i,e.exports.normalizeOpts=o,e.exports.mergeOpts=r},,function(e,t,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=r},function(e,t,n){"use strict";var i=n(8).InputScanner,r=n(3).Token,o=n(10).TokenStream,s=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new o,this._reset();for(var t=new r(a.START,""),n=null,i=[],s=new o;t.type!==a.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new o),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=a},function(e,t,n){"use strict";function i(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position=0&&e/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/)}}o.prototype=new i,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},o.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},o.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},o.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},o.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},o.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())));return e},e.exports.TemplatablePattern=o},,,,function(e,t,n){"use strict";var i=n(19).Beautifier,r=n(20).Options;e.exports=function(e,t,n,r){return new i(e,t,n,r).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){"use strict";var i=n(20).Options,r=n(2).Output,o=n(21).Tokenizer,s=n(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=function(e,t){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new r(e,t)};u.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},u.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},u.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},u.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},u.prototype.print_preserved_newlines=function(e){var t=0;e.type!==s.TEXT&&e.previous.type!==s.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines0);return 0!==t},u.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},u.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},u.prototype.print_newline=function(e){this._output.add_new_line(e)},u.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},u.prototype.indent=function(){this.indent_level++},u.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var c=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),(n=function(e){for(var t=null,n=e.next;n.type!==s.EOF&&e.closed!==n;){if(n.type===s.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===s.EQUALS&&n.next.next&&n.next.next.type===s.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n).search("text/css")>-1?i="css":n.search(/(text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect)/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function p(e,t){return-1!==t.indexOf(e)}function h(e){this._printer=e,this._current_frame=null}function d(e,t,n,r){this._source_text=e||"",t=t||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var o=new i(t,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}h.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},h.prototype.record_tag=function(e){var t=new function(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}(this._current_frame,e,this._printer.indent_level);this._current_frame=t},h.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},h.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},h.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},h.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.test(e)&&(t=e.match(a)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0],i={text:"",type:""},r=new f,c=new u(this._options,n),p=new o(e,this._options).tokenize();this._tag_stack=new h(c);for(var d=null,y=p.next();y.type!==s.EOF;)y.type===s.TAG_OPEN||y.type===s.COMMENT?r=d=this._handle_tag_open(c,y,r,i):y.type===s.ATTRIBUTE||y.type===s.EQUALS||y.type===s.VALUE||y.type===s.TEXT&&!r.tag_complete?d=this._handle_inside_tag(c,y,r,p):y.type===s.TAG_CLOSE?d=this._handle_tag_close(c,y,r):y.type===s.TEXT?d=this._handle_text(c,y,r):c.add_raw_token(y),i=d,y=p.next();return c._output.get_code(t)},d.prototype._handle_tag_close=function(e,t,n){var i={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),i},d.prototype._handle_inside_tag=function(e,t,n,i){var r=n.has_wrapped_attrs,o={text:t.text,type:t.type};if(e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted)e.add_raw_token(t);else if("{"===n.tag_start_char&&t.type===s.TEXT)e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t);else{if(t.type===s.ATTRIBUTE?(e.set_space_before_token(!0),n.attr_count+=1):t.type===s.EQUALS?e.set_space_before_token(!1):t.type===s.VALUE&&t.previous.type===s.EQUALS&&e.set_space_before_token(!1),t.type===s.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),r=r||0!==t.newlines),this._is_wrap_attributes_force)){var a=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===n.attr_count){var l,u=!0,c=0;do{if((l=i.peek(c)).type===s.ATTRIBUTE){u=!1;break}c+=1}while(c<4&&l.type!==s.EOF&&l.type!==s.TAG_CLOSE);a=!u}a&&(e.print_newline(!1),r=!0)}e.print_token(t),r=r||e.previous_token_wrapped(),n.has_wrapped_attrs=r}return o},d.prototype._handle_text=function(e,t,n){var i={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),i},d.prototype._print_custom_beatifier_text=function(e,t,n){var i=this;if(""!==t.text){var r,o=t.text,s=1,a="",l="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?r=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?r=this._css_beautify:"html"===n.custom_beautifier_name&&(r=function(e,t){return new d(e,t,i._js_beautify,i._css_beautify).beautify()}),"keep"===this._options.indent_scripts?s=0:"separate"===this._options.indent_scripts&&(s=-e.indent_level);var u=e.get_full_indent(s);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(|]]>)$/.exec(o);if(!c)return void e.add_raw_token(t);a=u+c[1]+"\n",o=c[4],c[5]&&(l=u+c[5]),o=o.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(t.whitespace_before=c[0])}if(o)if(r){var p=function(){this.eol="\n"};p.prototype=this._options.raw_options,o=r(u+o,new p)}else{var h=t.whitespace_before;h&&(o=o.replace(new RegExp("\n("+h+")?","g"),"\n")),o=u+o.replace(/\n/g,"\n"+u)}a&&(o=o?a+o+"\n"+l:a+l),e.print_newline(!1),o&&(t.text=o,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},d.prototype._handle_tag_open=function(e,t,n,i){var r=this._get_tag_open_token(t);return(n.is_unformatted||n.is_content_unformatted)&&t.type===s.TAG_OPEN&&0===t.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=t.text.match(/^{{[#\^]?([^\s}]+)/),this.tag_check=n?n[1]:""),this.tag_check=this.tag_check.toLowerCase(),t.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||t.closed&&"/>"===t.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};d.prototype._get_tag_open_token=function(e){var t=new f(this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||p(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&p(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&p(t.tag_check,this._options.content_unformatted),t.is_inline_element=p(t.tag_name,this._options.inline)||"{"===t.tag_start_char,t},d.prototype._set_tag_position=function(e,t,n,i,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||(n.parent&&(n.parent.multiline_content=!0),e.print_newline(!1))),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=c(n.tag_check,t)))),p(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&r.type===s.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||n.is_inline_element||n.is_unformatted||e.print_newline(!1)}else n.is_unformatted||n.is_content_unformatted?n.is_inline_element||n.is_unformatted||e.print_newline(!1):n.is_end_tag?(n.start_tag_token&&n.start_tag_token.multiline_content||!(n.is_inline_element||i.is_inline_element||r.type===s.TAG_CLOSE&&n.start_tag_token===i||"TK_CONTENT"===r.type))&&e.print_newline(!1):(n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||"TK_CONTENT"===r.type||(n.parent&&(n.parent.multiline_content=!0),e.print_newline(!1)))},d.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent)return"body"===e.tag_name?t=t||this._tag_stack.try_pop("head"):"li"===e.tag_name?t=t||this._tag_stack.try_pop("li",["ol","ul"]):"dd"===e.tag_name||"dt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]):"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"])),e.parent=this._tag_stack.get_parser_token(),t},e.exports.Beautifier=d},function(e,t,n){"use strict";var i=n(6).Options;function r(e){i.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new i,e.exports.Options=r},function(e,t,n){"use strict";var i=n(9).Tokenizer,r=n(9).TOKEN,o=n(13).Directives,s=n(14).TemplatablePattern,a=n(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},u=new o(/<\!--/,/-->/),c=function(e,t){i.call(this,e,t),this._current_tag_name="";var n=new s(this._input).read_options(this._options),r=new a(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(o).until_after(o)}};(c.prototype=new i)._is_comment=function(e){return!1},c.prototype._is_opening=function(e){return e.type===l.TAG_OPEN},c.prototype._is_closing=function(e,t){return e.type===l.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])},c.prototype._reset=function(){this._current_tag_name=""},c.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(l.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(i,t))||this._read_attribute(i,e,t))||this._read_raw_content(i,e,t))||this._read_close(i,t))||this._read_content_word(i))||this._read_comment_or_cdata(i))||this._read_processing(i))||this._read_open(i,t))||this._create_token(l.UNKNOWN,this._input.next())},c.prototype._read_comment_or_cdata=function(e){var t=null,n=null,i=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(i=u.get_directives(n))&&"start"===i.ignore&&(n+=u.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=i));return t},c.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var i=this._input.peek(1);"!"!==i&&"?"!==i||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=null)}return t},c.prototype._read_open=function(e,t){var n=null,i=null;return t||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(l.TAG_OPEN,n)),i},c.prototype._read_open_handlebars=function(e,t){var n=null,i=null;return t||this._options.indent_handlebars&&"{"===e&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),i=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),i=this._create_token(l.TAG_OPEN,n))),i},c.prototype._read_close=function(e,t){var n=null,i=null;return t&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),i=this._create_token(l.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(l.TAG_CLOSE,"}}"))),i},c.prototype._read_attribute=function(e,t,n){var i=null,r="";if(n&&"<"===n.text[0])if("="===e)i=this._create_token(l.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),i=this._create_token(l.VALUE,o)}else(r=this.__patterns.attribute.read())&&(i=t.type===l.EQUALS?this._create_token(l.VALUE,r):this._create_token(l.ATTRIBUTE,r));return i},c.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},c.prototype._read_raw_content=function(e,t,n){var i="";if(n&&"{"===n.text[0])i=this.__patterns.handlebars_raw_close.read();else if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]){var r=t.opened.text.substr(1).toLowerCase();if("script"===r||"style"===r){var o=this._read_comment_or_cdata(e);if(o)return o.type=l.TEXT,o;i=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(r)&&(i=this._input.readUntil(new RegExp("","ig")))}return i?this._create_token(l.TEXT,i):null},c.prototype._read_content_word=function(e){var t="";if(this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(t=this.__patterns.unformatted_content_delimiter.read()),t||(t=this.__patterns.word.read()),t)return this._create_token(l.TEXT,t)},e.exports.Tokenizer=c,e.exports.TOKEN=l}]);if("function"==typeof define&&define.amd)define(["require","./beautify","./beautify-css"],function(t){var n=t("./beautify"),i=t("./beautify-css");return{html_beautify:function(t,r){return e(t,r,n.js_beautify,i.css_beautify)}}});else if("undefined"!=typeof exports){var t=require("./beautify.js"),n=require("./beautify-css.js");exports.html_beautify=function(i,r){return e(i,r,t.js_beautify,n.css_beautify)}}else"undefined"!=typeof window?window.html_beautify=function(t,n){return e(t,n,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(t,n){return e(t,n,global.js_beautify,global.css_beautify)})}(),function(){var e=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([,,function(e,t,n){"use strict";function i(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function r(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function o(e,t){this.__indent_cache=new r(e,t),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var e=new i(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},i.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},i.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},i.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},i.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},r.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},r.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},r.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},o.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(e,t){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==t){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},e.exports.Output=o},,,,function(e,t,n){"use strict";function i(e,t){this.raw_options=r(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php"],["auto"])}function r(e,t){var n,i={};for(n in e=o(e))n!==t&&(i[n]=e[n]);if(t&&e[t])for(n in e[t])i[n]=e[t][n];return i}function o(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}i.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},i.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},i.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},i.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},i.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},i.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},i.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},e.exports.Options=i,e.exports.normalizeOpts=o,e.exports.mergeOpts=r},,function(e,t,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=r},,,,,function(e,t,n){"use strict";function i(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}i.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},i.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=i},,function(e,t,n){"use strict";var i=n(16).Beautifier,r=n(17).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){"use strict";var i=n(17).Options,r=n(2).Output,o=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,p=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,h=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(e,t){this._source_text=e||"",this._options=new i(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}d.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},d.prototype.eatWhitespace=function(e){for(var t=u.test(this._input.peek()),n=!0;u.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(this._options.preserve_newlines||n)&&(n=!1,this._output.add_new_line(!0));return t},d.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},d.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},d.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&a.test(e||"")&&(t=e.match(a)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new o(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var i,d,f=0,y=!1,m=!1,g=!1,_=!1,v=!1,b=this._ch;i=""!==this._input.read(c),d=b,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),b=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(p),w=s.get_directives(x);w&&"start"===w.ignore&&(x+=s.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(h)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(i),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s$/,""),this.print_string(k),this._output.space_before_token=!0),"extend"===(k=k.replace(/\s$/,""))?_=!0:"import"===k&&(v=!0),k in this.NESTED_AT_RULE?(this._nestedLevel+=1,k in this.CONDITIONAL_GROUP_RULE&&(g=!0)):y||0!==f||-1===k.indexOf(":")||(m=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(i),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(m&&(m=!1,this.outdent()),this.indent(),this._output.space_before_token=!0,this.print_string(this._ch),g?(g=!1,y=this._indentLevel>this._nestedLevel):y=this._indentLevel>=this._nestedLevel,this._options.newline_between_rules&&y&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===d&&this._output.trim(!0),v=!1,_=!1,m&&(this.outdent(),m=!1),this.print_string(this._ch),y=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!y&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||_||0!==f?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),m||(m=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(i),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===f?(m&&(this.outdent(),m=!1),_=!1,v=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),f++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),f&&(f--,this.outdent()))):(this.preserveSingleSpace(i),this.print_string(this._ch),this.eatWhitespace(),f++,this.indent()):")"===this._ch?(f&&(f--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||m||0!==f||v?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==f?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(i),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(i),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=d},function(e,t,n){"use strict";var i=n(6).Options;function r(e){i.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t}r.prototype=new i,e.exports.Options=r}]);"function"==typeof define&&define.amd?define([],function(){return{css_beautify:e}}):"undefined"!=typeof exports?exports.css_beautify=e:"undefined"!=typeof window?window.css_beautify=e:"undefined"!=typeof global&&(global.css_beautify=e)}();var Beautifier={javascript:function(e){return js_beautify(e,{indent_size:window.userCmOptions.indentUnit||2,space_before_conditional:!0,jslint_happy:!1,max_char:0,space_after_anon_function:!1,end_with_newline:!0})},html:function(e){return html_beautify(e,{indent_size:window.userCmOptions.indentUnit||2,max_char:0,indent_inner_html:!0,end_with_newline:!0})},css:function(e){return css_beautify(e,{indent_size:window.userCmOptions.indentUnit||2,max_char:0,end_with_newline:!0})}};(function(){"use strict";var e,t,n={extend:function(e,t){if(t=JSON.parse(JSON.stringify(t)),"string"==typeof e)return t;var n;for(var i in e)n=e[i],e.hasOwnProperty(i)&&void 0!==n&&(t[i]=n);return t},queue:function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),setcss:function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()}),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var i,r=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);r--;)if((i=e[r]+o)in n)return i;return t}(n))}function i(e,t,i){t=n(t),e.style[t]=i}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&i(e,n,r);else i(e,o[1],o[2])}}(),clamp:function(e,t,n){return en?n:e},toBarPerc:function(e){return 100*(-1+e)},hasClass:function(e,t){return("string"==typeof e?e:n.classList(e)).indexOf(" "+t+" ")>=0},addClass:function(e,t){var i=n.classList(e),r=i+t;n.hasClass(i,t)||(e.className=r.substring(1))},removeClass:function(e,t){var i,r=n.classList(e);n.hasClass(e,t)&&(i=r.replace(" "+t+" "," "),e.className=i.substring(1,i.length-1))},showEl:function(e){n.setcss(e,{display:"block"})},hideEl:function(e){n.setcss(e,{display:"none"})},classList:function(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")},removeElement:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},i=n;e="undefined"!=typeof window?window:this,t=function(){var e,t,n={template:1,parent:"body",start:!1,minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800},r={determinate:'
',buffer:'
',indeterminate:'
',query:'
'},o={},s=function(e){this.options=e||{},this.status=null,this.bufferStatus=null};return s.prototype={version:"0.1.0",constructor:s,start:function(){if(this.status||this._isBufferStyle()||this.set(0),this._isIndeterminateStyle()||this._isQueryStyle())return this;var e=this;if(this._isBufferStyle()&&!this.bufferStatus){var t=this._render(),n=t.querySelector('[role="dashed"]'),r=t.querySelector(this._getCurrSelector());i.hideEl(r),i.hideEl(n),this.setBuffer(0).setBuffer(1),setTimeout(function(){i.showEl(n),i.showEl(r),e.set(0).setBuffer(0)},500)}return this.options.trickle&&function t(){setTimeout(function(){e.status&&(e._trickle(),t())},e.options.trickleSpeed)}(),this},end:function(e){if(!e&&!this.status)return this;var t=this,n=this.options.speed,r=this._getRenderedId();if(this._isBufferStyle()&&e)return this.set(0).set(1);if(this._isIndeterminateStyle())return!this._isRendered()&&e&&(this.set(0),r=this._getRenderedId(),n=500),i.setcss(r,{transition:"none",opacity:1}),r.offsetWidth,setTimeout(function(){i.setcss(r,{transition:"all "+n+"ms linear",opacity:0}),setTimeout(function(){t._remove()},n)},n),this;if(this._isQueryStyle()){if(this._isRendered()){var o=r.querySelector(this._getCurrSelector());return i.addClass(o,"end"),setTimeout(function(){t._remove()},1500),this}if(e)return this.set(0),r=this._getRenderedId(),setTimeout(function(){t._remove()},1500),this}return this.inc(.3+.5*Math.random()).set(1)},set:function(e){return e=i.clamp(e,this.options.minimum,1),this.status=1===e?null:e,this._setProgress(this._getCurrSelector(),e),this},setBuffer:function(e){return e=i.clamp(e,this.options.minimum,1),this.bufferStatus=1===e?null:e,this._setProgress('[role="bufferBar"]',e),this},inc:function(e){var t=this.status,n=this.bufferStatus;return t?(t=this._getRandomNum(t,e),this._isBufferStyle()&&(n=this._getRandomNum(n>t?n:t+.1,e),this.setBuffer(n)),this.set(t)):this.start()},_trickle:function(){return this.inc(Math.random()*this.options.trickleRate)},_render:function(e){if(this._isRendered())return this._getRenderedId();var t,n=document.createElement("div"),r=this._getCurrTemplate()||"",o=document.querySelector(this.options.parent);if(n.id=this._getRenderedId(!0),n.className="ui-mprogress",n.innerHTML=r,!this._isIndeterminateStyle()&&!this._isQueryStyle()){e||(t=!this._isStarted());var s=n.querySelector(this._getCurrSelector()),a=t?"-100":i.toBarPerc(this.status||0);if(i.setcss(s,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),this._isBufferStyle()){var l=n.querySelector('[role="bufferBar"]'),u=t?"-100":i.toBarPerc(this.bufferStatus||0);i.setcss(l,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"})}}return o!=document.body&&i.addClass(o,"mprogress-custom-parent"),o.appendChild(n),n},_remove:function(){var e=this._getRenderedId(),t=document.querySelector(this.options.parent);t!=document.body&&i.removeClass(t,"mprogress-custom-parent");var n=this.options.parent+this.options.template;o[n]&&(o[n]=null),e&&(this.status=null,this.bufferStatus=null,i.removeElement(e))},_setProgress:function(e,t){var n=this._render(),r=n.querySelector(e),o=this.options.speed,s=this.options.easing,a=this;if(n.offsetWidth,this._isIndeterminateStyle()||this._isQueryStyle())return this;i.queue(function(e){""===a.options.positionUsing&&(a.options.positionUsing=a._getPositioningCSS()),i.setcss(r,a._barPositionCSS(t,o,s)),1===t?(i.setcss(n,{transition:"none",opacity:1}),n.offsetWidth,setTimeout(function(){i.setcss(n,{transition:"all "+o+"ms linear",opacity:0}),setTimeout(function(){a._remove(),e()},o)},o)):setTimeout(e,o)})},_getCurrSelector:function(){var e=this._getCurrTplId();return"99"!==e?'[role="mpbar'+e+'"]':'[role="mpbar"]'},_isStarted:function(){return"number"==typeof this.status},_getRandomNum:function(e,t){return"number"!=typeof t&&(t=(1-e)*i.clamp(Math.random()*e,.1,.95)),e=i.clamp(e+t,0,.994)},_isRendered:function(){return!!this._getRenderedId()},_getRenderedId:function(e){var t="mprogress"+this._getCurrTplId();return e?t:document.getElementById(t)},_isBufferStyle:function(){return 2===this._getCurrTplId()},_isIndeterminateStyle:function(){return 3===this._getCurrTplId()},_isQueryStyle:function(){return 4===this._getCurrTplId()},_getCurrTplId:function(){var e=~~this.options.template||1;return"number"==typeof e?e:"99"},_getCurrTemplate:function(){var e=this.options.template||1;return"number"==typeof~~e?r[["determinate","buffer","indeterminate","query"][e-1]]||"":"string"==typeof e?template:void 0},_getPositioningCSS:function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"},_barPositionCSS:function(e,t,n){var r;return(r="translate3d"===this.options.positionUsing?{transform:"translate3d("+i.toBarPerc(e)+"%,0,0)"}:"translate"===this.options.positionUsing?{transform:"translate("+i.toBarPerc(e)+"%,0)"}:{"margin-left":i.toBarPerc(e)+"%"}).transition="all "+t+"ms "+n,r}},e=0,t=0,s.prototype.promise=function(n){if(!n||"resolved"==n.state())return this;var i=this;return 0==t&&i.start(),e++,t++,n.always(function(){0==--t?(e=0,i.end()):i.set((e-t)/e)}),this},function(e){var t=i.extend(e,n),r=t.parent+t.template,a=o[r]||"";return a||(a=new s(t),o[r]=a),"string"==typeof e&&"function"==typeof a[e]?a[e]():t.start&&a.start(),a}},"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.Mprogress=t()}).call(this),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.emmetCodeMirror=e()}}(function(){var define,module,exports;return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s2&&"object"!=typeof t&&(t={line:arguments[1],ch:arguments[2]}),e.indexFromPos(t)}function u(e,t){return e.posFromIndex(t)}n.default=a},{"./emmet":2}],2:[function(e,t,n){"use strict";var i,r=(i=e("emmet"))&&i.__esModule?i.default:i;e("emmet/bundles/snippets"),e("emmet/bundles/caniuse"),t.exports=r},{emmet:39,"emmet/bundles/caniuse":3,"emmet/bundles/snippets":4}],3:[function(e,t,n){var i=e("../lib/assets/caniuse"),r=e("../lib/caniuse.json");i.load(r,!0)},{"../lib/assets/caniuse":23,"../lib/caniuse.json":35}],4:[function(e,t,n){var i=e("../lib/assets/resources"),r=e("../lib/snippets.json");i.setVocabulary(r,"system")},{"../lib/assets/resources":31,"../lib/snippets.json":68}],5:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/htmlMatcher"),r=e("../utils/common"),o=e("../utils/editor"),s=e("../utils/action"),a=e("../assets/range"),l=e("../editTree/css"),u=e("../utils/cssSections"),c=null;function p(e){return e[e.length-1]}function h(e,t){var n;if("string"==typeof e){var i=u.matchEnclosingRule(e,t);i&&(n=l.parse(i.substring(e),{offset:i.start}))}else n=e;if(!n)return null;var o=function(e,t){var n=[e.range(!0)];n.push(e.valueRange(!0));var i=u.nestedSectionsInRule(e),r=e.list();if(r.length||i.length){var o=Number.POSITIVE_INFINITY,s=-1;r.length&&(o=r[0].namePosition(!0),s=p(r).range(!0).end),i.length&&(i[0].starts&&(s=p(i).end)),n.push(a.create2(o,s))}n=n.concat(i);var c=l.propertyFromPosition(e,t)||r[0];if(c){n.push(c.range(!0));var h=c.valueRange(!0);c.end()||(h._unterminated=!0),n.push(h)}return n}(n,t);return o=o.filter(function(e){return!!e.length}),r.unique(o,function(e){return e.valueOf()})}return{balance:function(e,t){t=String((t||"out").toLowerCase());var n=o.outputInfo(e);return s.isSupportedCSS(n.syntax)?function(e,t){var n=o.outputInfo(e),i=n.content,s=a(e.getSelectionRange()),u=h(n.content,s.start);if(!u&&s.length())try{u=h(l.parse(s.substring(n.content),{offset:s.start}),s.start)}catch(e){}if(!u)return!1;u=a.sort(u,!0);var c=r.find(u,function(e){return e.equal(s)});if(c||(c=r.find(u,function(e){return e._unterminated?e.include(s.start):e.inside(s.start)})),!c)return!1;var d=u.indexOf(c);if(c.equal(s)&&(d+="out"==t?1:-1),d<0||d>=u.length)if(d>=u.length&&"out"==t){pos=c.start-1;var f=h(i,pos);f&&(c=p(f.filter(function(e){return e.inside(pos)})))}else c=null;else c=u[d];return!!c&&(e.createSelection(c.start,c.end),!0)}(e,t):function(e,t){var n=o.outputInfo(e).content,s=a(e.getSelectionRange());if(c&&!c.range.equal(s)&&(c=null),c&&s.length())if("in"==t){if("tag"==c.type&&!c.close)return!1;if(c.range.equal(c.outerRange))c.range=c.innerRange;else{var l=r.narrowToNonSpace(n,c.innerRange);(c=i.find(n,l.start+1))&&c.range.equal(s)&&c.outerRange.equal(s)&&(c.range=c.innerRange)}}else!c.innerRange.equal(c.outerRange)&&c.range.equal(c.innerRange)&&s.equal(c.range)?c.range=c.outerRange:(c=i.find(n,s.start))&&c.range.equal(s)&&c.innerRange.equal(s)&&(c.range=c.outerRange);else c=i.find(n,s.start);return c&&(c.innerRange.equal(s)&&(c.range=c.outerRange),!c.range.equal(s))?(e.createSelection(c.range.start,c.range.end),!0):(c=null,!1)}(e,t)},balanceInwardAction:function(e){return this.balance(e,"in")},balanceOutwardAction:function(e){return this.balance(e,"out")},goToMatchingPairAction:function(e){var t=String(e.getContent()),n=e.getCaretPos();"<"==t.charAt(n)&&n++;var r=i.tag(t,n);return!(!r||!r.close)&&(r.open.range.inside(n)?e.setCaretPos(r.close.range.start):e.setCaretPos(r.open.range.start),!0)}}})},{"../assets/htmlMatcher":26,"../assets/range":30,"../editTree/css":37,"../utils/action":70,"../utils/common":73,"../utils/cssSections":74,"../utils/editor":75}],6:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../plugin/file"),r=e("../utils/base64"),o=e("../utils/action"),s=e("../utils/editor");function a(e,t,n){return n=n||0,t.charAt(n)==e.charAt(0)&&t.substr(n,e.length)==e}return{encodeDecodeDataUrlAction:function(e){var t=String(e.getSelection()),n=e.getCaretPos(),l=s.outputInfo(e);if(!t)for(var u,c=l.content;n-- >=0;){if(a("src=",c,n)){(u=c.substr(n).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))&&(t=u[3],n+=u[1].length);break}if(a("url(",c,n)){(u=c.substr(n).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))&&(t=u[3],n+=u[1].length);break}}return!!t&&(a("data:",t)?function(e,t,n){var o=String(e.prompt("Enter path to file (absolute or relative)"));if(!o)return!1;var s=i.createPath(e.getFilePath(),o);if(!s)throw"Can't save file";return i.save(s,r.decode(t.replace(/^data\:.+?;.+?,/,""))),e.replaceContent("$0"+o,n,n+t.length),!0}(e,t,n):function(e,t,n){var s=e.getFilePath();if(null===s)throw"You should save your file before using this action";var a=i.locateFile(s,t);if(null===a)throw"Can't find "+t+" file";return i.read(a,function(s,l){if(s)throw"Unable to read "+a+": "+s;var u=r.encode(String(l));if(!u)throw"Can't encode file content to base64";u="data:"+(o.mimeTypes[String(i.getExt(a))]||"application/octet-stream")+";base64,"+u,e.replaceContent("$0"+u,n,n+t.length)}),!0}(e,t,n))}}})},{"../plugin/file":63,"../utils/action":70,"../utils/base64":71,"../utils/editor":75}],7:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){function i(e,t,n){t=t||1,n=n||0;var i=e.getCaretPos()+n,r=String(e.getContent()),o=r.length,s=-1,a=/^\s+$/;function l(e){for(var t=e;t>=0;){var n=r.charAt(t);if("\n"==n||"\r"==n)break;t--}return r.substring(t,e)}for(;i<=o&&i>=0;){i+=t;var u=r.charAt(i),c=r.charAt(i+1),p=r.charAt(i-1);switch(u){case'"':case"'":c==u&&"="==p&&(s=i+1);break;case">":"<"==c&&(s=i+1);break;case"\n":case"\r":a.test(l(i-1))&&(s=i)}if(-1!=s)break}return s}return{previousEditPointAction:function(e,t,n){var r=e.getCaretPos(),o=i(e,-1);return o==r&&(o=i(e,-1,-2)),-1!=o&&(e.setCaretPos(o),!0)},nextEditPointAction:function(e,t,n){var r=i(e,1);return-1!=r&&(e.setCaretPos(r),!0)}}})},{}],8:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/action"),r=e("../utils/common"),o=e("../utils/math"),s=e("../assets/range");return{evaluateMathAction:function(e){var t=e.getContent(),n=s(e.getSelectionRange());if(n.length()||(n=i.findExpressionBounds(e,function(e){return r.isNumeric(e)||-1!=".+-*/\\".indexOf(e)})),n&&n.length()){var a=n.substring(t);a=a.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"round($1/$2)");try{var l=r.prettifyNumber(o.evaluate(a));return e.replaceContent(l,n.start,n.end),e.setCaretPos(n.start+l.length),!0}catch(e){}}return!1}}})},{"../assets/range":30,"../utils/action":70,"../utils/common":73,"../utils/math":76}],9:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/handlerList"),r=e("../assets/range"),o=e("../assets/preferences"),s=e("../utils/common"),a=e("../utils/editor"),l=e("../utils/action"),u=e("../resolver/cssGradient"),c=e("../parser/abbreviation");function p(e){var t=r(e.getSelectionRange()),n=String(e.getContent());if(t.length())return t.substring(n);var i=e.getCurrentLineRange();return l.extractAbbreviation(n.substring(i.start,t.start))}var h=i.create();return h.add(function(e,t,n){var i=e.getSelectionRange().end,r=p(e);if(r){var s=c.expand(r,{syntax:t,profile:n,contextNode:l.captureContext(e)});if(s){var a=i-r.length,u=i,h=o.getArray("css.syntaxes");if(h&&~h.indexOf(t))";"==e.getContent().charAt(i)&&";"==s.charAt(s.length-1)&&u++;return e.replaceContent(s,a,u),!0}}return!1},{order:-1}),h.add(u.expandAbbreviationHandler.bind(u)),{expandAbbreviationAction:function(e,t,n){var i=s.toArray(arguments),r=a.outputInfo(e,t,n);return i[1]=r.syntax,i[2]=r.profile,h.exec(!1,i)},expandAbbreviationWithTabAction:function(e,t,n){var i=e.getSelection();if(i){var o=r(e.getSelectionRange()),a=s.padString(i,"\t");e.replaceContent("\t${0}",e.getCaretPos());var l=r(e.getCaretPos(),o.length());return e.replaceContent(a,l.start,l.end,!0),e.createSelection(l.start,l.start+a.length),!0}return this.expandAbbreviationAction(e,t,n)||e.replaceContent("\t",e.getCaretPos()),!0},_defaultHandler:function(e,t,n){var i=e.getSelectionRange().end,r=this.findAbbreviation(e);if(r){var o=l.captureContext(e),s=c.expand(r,t,n,o);if(s)return e.replaceContent(s,i-r.length,i),!0}return!1},addHandler:function(e,t){h.add(e,t)},removeHandler:function(e){h.remove(e)},findAbbreviation:p}})},{"../assets/handlerList":25,"../assets/preferences":28,"../assets/range":30,"../parser/abbreviation":55,"../resolver/cssGradient":65,"../utils/action":70,"../utils/common":73,"../utils/editor":75}],10:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r=e("../utils/action");return{increment01Action:function(e){return this.incrementNumber(e,.1)},increment1Action:function(e){return this.incrementNumber(e,1)},increment10Action:function(e){return this.incrementNumber(e,10)},decrement01Action:function(e){return this.incrementNumber(e,-.1)},decrement1Action:function(e){return this.incrementNumber(e,-1)},decrement10Action:function(e){return this.incrementNumber(e,-10)},incrementNumber:function(e,t){var n=!1,o=!1,s=r.findExpressionBounds(e,function(e,t,r){return!!i.isNumeric(e)||("."==e?!!i.isNumeric(r.charAt(t+1))&&(!o&&(o=!0)):"-"==e&&(!n&&(n=!0)))});if(s&&s.length()){var a=s.substring(String(e.getContent())),l=parseFloat(a);if(!isNaN(l)){if(l=i.prettifyNumber(l+t),/^(\-?)0+[1-9]/.test(a)){var u="";RegExp.$1&&(u="-",l=l.substring(1));var c=l.split(".");c[0]=i.zeroPadString(c[0],function(e){return~(e=e.replace(/^\-/,"")).indexOf(".")?e.split(".")[0].length:e.length}(a)),l=u+c.join(".")}return e.replaceContent(l,s.start,s.end),e.createSelection(s.start,s.start+l.length),!0}}return!1}}})},{"../utils/action":70,"../utils/common":73}],11:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/preferences"),r=e("../utils/common"),o=(e("../assets/resources"),e("../assets/htmlMatcher")),s=e("../utils/editor"),a=["html","xml","xsl"];return i.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefere indented closing brace of CSS rule for better readability. This preference’s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when “Insert formatted linebreak” action will be performed in CSS file). If you’re such user, you may want to write put a value like \\n\\t in this preference."),{insertLineBreakAction:function(e){if(!this.insertLineBreakOnlyAction(e)){for(var t,n=s.getCurrentLinePadding(e),i=String(e.getContent()),r=e.getCaretPos(),o=i.length,a="",l=e.getCurrentLineRange().end+1;ln.length?e.replaceContent("\n"+a,r,r,!0):e.replaceContent("\n",r)}return!0},insertLineBreakOnlyAction:function(e){var t=s.outputInfo(e),n=e.getCaretPos();if(~a.indexOf(t.syntax)){var l=o.tag(t.content,n);if(l&&!l.innerRange.length())return e.replaceContent("\n\t"+r.getCaretPlaceholder()+"\n",n),!0}else if("css"==t.syntax){var u=t.content;if(n&&"{"==u.charAt(n-1)){var c=i.get("css.closeBraceIndentation"),p="}"==u.charAt(n);if(!p)for(var h,d=n,f=u.length;d0?"increment":"decrement",n=String(Math.abs(e)).replace(".","").substring(0,2),i=t+"_number_by_"+n,r=t+n+"Action",o="Numbers/"+t.charAt(0).toUpperCase()+t.substring(1)+" number by "+Math.abs(e);s(i,l("incrementDecrement",r),o)}),{add:s,get:function(e){return r[e.toLowerCase()]},run:function(e,t){Array.isArray(t)||(t=i.toArray(arguments,1));var n=this.get(e);if(!n)throw new Error('Action "'+e+'" is not defined');return n.fn.apply(n,t)},getAll:function(){return r},getList:function(){var e=this.getAll();return Object.keys(e).map(function(t){return e[t]})},getMenu:function(e){var t=[];return e=e||[],this.getList().forEach(function(n){if(!n.options.hidden&&!~e.indexOf(n.name)){var r=a(n.name),o=t;if(n.options.label){var s,l,u=n.options.label.split("/");for(r=u.pop();s=u.shift();)(l=i.find(o,function(e){return"submenu"==e.type&&e.name==s}))||(l={name:s,type:"submenu",items:[]},o.push(l)),o=l.items}o.push({type:"action",name:n.name,label:r})}}),t},getActionNameForMenuTitle:function(e,t){return i.find(t||this.getMenu(),function(t){return"action"!=t.type?this.getActionNameForMenuTitle(e,t.items):t.label==e||t.name==e?t.name:void 0},this)}}})},{"../utils/common":73,"./balance":5,"./base64":6,"./editPoints":7,"./evaluateMath":8,"./expandAbbreviation":9,"./incrementDecrement":10,"./lineBreaks":11,"./mergeLines":13,"./reflectCSSValue":14,"./removeTag":15,"./selectItem":16,"./selectLine":17,"./splitJoinTag":18,"./toggleComment":19,"./updateImageSize":20,"./updateTag":21,"./wrapWithAbbreviation":22}],13:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/htmlMatcher"),r=e("../utils/common"),o=e("../utils/editor"),s=e("../assets/range");return{mergeLinesAction:function(e){var t=o.outputInfo(e),n=s(e.getSelectionRange());if(!n.length()){var a=i.find(t.content,e.getCaretPos());a&&(n=a.outerRange)}if(n.length()){for(var l=n.substring(t.content),u=r.splitByLines(l),c=1;cfilter:alpha(opacity=...).\t\tNote that CSS3 and SVG also provides filter property so this option is disabled by default.");var p=i.create();function h(e,t){var n=function(e,t,n,i){if(e=s.baseName(e),n=s.baseName(n),"opacity"==e&&"filter"==n)return i.replace(/opacity=[^)]*/i,"opacity="+Math.floor(100*parseFloat(t)));if("filter"==e&&"opacity"==n){var r=t.match(/opacity=([^)]*)/i);return r?a.prettifyNumber(parseInt(r[1],10)/100):i}return t}(e.name(),e.value(),t.name(),t.value());n=function(e,t){var n=/^\-(\w+)\-/,i=n.test(e)?RegExp.$1.toLowerCase():"",r=s.findParts(t);return r.reverse(),r.forEach(function(e){var r=e.substring(t).replace(n,""),s=o.vendorPrefixes(r);s&&(i&&~s.indexOf(i)&&(r="-"+i+"-"+r),t=a.replaceSubstring(t,r,e))}),t}(t.name(),n),t.value(n)}return(n=n||{}).exports={reflectCSSValueAction:function(e){return"css"==e.getSyntax()&&l.compoundUpdate(e,function(e){var t=u.outputInfo(e),n=e.getCaretPos(),i=s.parseFromPosition(t.content,n);if(i){var r=i.itemFromPosition(n,!0);if(r){var o=i.source,a=i.options.offset,l=n-a-r.range().start;return p.exec(!1,[r]),o!==i.source?{data:i.source,start:a,end:a+o.length,caret:a+r.range().start+l}:void 0}}}(e))},_defaultHandler:function(e){var t,n,i=(t=e.name(),"opacity"!=(t=s.baseName(t))&&"filter"!=t||!r.get("css.reflect.oldIEOpacity")?(n=t.match(/^border-radius-(top|bottom)(left|right)/))?new RegExp("^(?:\\-\\w+\\-)?(?:"+t+"|border-"+n[1]+"-"+n[2]+"-radius)$"):(n=t.match(/^border-(top|bottom)-(left|right)-radius/))?new RegExp("^(?:\\-\\w+\\-)?(?:"+t+"|border-radius-"+n[1]+n[2]+")$"):new RegExp("^(?:\\-\\w+\\-)?"+t+"$"):new RegExp("^(?:\\-\\w+\\-)?(?:opacity|filter)$"));e.parent.list().forEach(function(t){i.test(t.name())&&h(e,t)})},addHandler:function(e,t){p.add(e,t)},removeHandler:function(e){p.remove(e)}},p.add(n.exports._defaultHandler.bind(n.exports),{order:-1}),p.add(c.reflectValueHandler.bind(c)),n.exports})},{"../assets/handlerList":25,"../assets/preferences":28,"../editTree/css":37,"../resolver/css":64,"../resolver/cssGradient":65,"../utils/action":70,"../utils/common":73,"../utils/editor":75}],15:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r=e("../utils/editor"),o=e("../assets/htmlMatcher");return{removeTagAction:function(e){var t=r.outputInfo(e),n=o.tag(t.content,e.getCaretPos());if(n){if(n.close){var s=i.narrowToNonSpace(t.content,n.innerRange),a=i.findNewlineBounds(t.content,s.start),l=i.getLinePadding(a.substring(t.content)),u=s.substring(t.content);u=i.unindentString(u,l),e.replaceContent(i.getCaretPlaceholder()+i.escapeText(u),n.outerRange.start,n.outerRange.end)}else e.replaceContent(i.getCaretPlaceholder(),n.range.start,n.range.end);return!0}return!1}}})},{"../assets/htmlMatcher":26,"../utils/common":73,"../utils/editor":75}],16:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/range"),r=e("../utils/common"),o=e("../utils/editor"),s=e("../utils/action"),a=e("../assets/stringStream"),l=e("../parser/xml"),u=e("../editTree/css"),c=e("../utils/cssSections"),p=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;function h(e,t,n,r){for(var s,a,l=o.outputInfo(e).content,u=l.length,c=i(-1,0),p=i(e.getSelectionRange()),h=p.start,d=1e5;h>=0&&h0;){if(s=n(l,h,t)){if(c.equal(s))break;if(c=s.clone(),a=r(s.substring(l),s.start,p.clone()))return e.createSelection(a.start,a.end),!0;h=t?s.start:s.end-1}h+=t?-1:1}return!1}function d(e){var t=!0;return h(e,!1,function(e,n){return t?(t=!1,function(e,t){var n;for(;t>=0;){if(n=m(e,t))return n;t--}return null}(e,n)):m(e,n)},function(e,t,n){return y(e,t,n,!1)})}function f(e,t,n){n=n||0;var o,s,l=[],u=-1,c="",p="";return t.forEach(function(t){switch(t.type){case"tag":s=e.substring(t.start,t.end),/^<[\w\:\-]/.test(s)&&l.push(i({start:t.start+1,end:t.end}));break;case"attribute":u=t.start,c=e.substring(t.start,t.end);break;case"string":l.push(i(u,t.end-u)),o=i(t),g((p=o.substring(e)).charAt(0))&&o.start++,g(p.charAt(p.length-1))&&o.end--,l.push(o),"class"==c&&(l=l.concat(function(e,t){t=t||0;var n,r=[],o=a.create(e);o.eatSpace(),o.start=o.pos;for(;n=o.next();)/[\s\u00a0]/.test(n)&&(r.push(i(o.start+t,o.pos-o.start-1)),o.eatSpace(),o.start=o.pos);return r.push(i(o.start+t,o.pos-o.start)),r}(o.substring(e),o.start)))}}),l=l.filter(function(e){if(e.length())return e.shift(n),!0}),r.unique(l,function(e){return e.toString()})}function y(e,t,n,i){var o=f(e,l.parse(e),t);i&&o.reverse();var s=r.find(o,function(e){return e.equal(n)});if(s){var a=o.indexOf(s);return a1)return u[1]}return r.find(o,function(e){return e.end>n.end})}function m(e,t){var n;if("<"==e.charAt(t)&&(n=e.substring(t,e.length).match(p)))return i(t,n[0])}function g(e){return'"'==e||"'"==e}function _(e){var t=[e.nameRange(!0)];return c.nestedSectionsInRule(e).forEach(function(e){t.push(i.create2(e.start,e._selectorEnd))}),e.list().forEach(function(e){t=t.concat(function(e){var t=e.valueRange(!0),n=[e.range(!0),t],r=e.value();return e.valueParts().forEach(function(e){var o=e.clone();n.push(o.shift(t.start));var s=a.create(e.substring(r));if(s.match(/^[\w\-]+\(/,!0)){s.start=s.pos,s.backUp(1),s.skipToPair("(",")"),s.backUp(1);var l=s.current();n.push(i(o.start+s.start,l)),u.findParts(l).forEach(function(e){n.push(i(o.start+s.start+e.start,e.substring(l)))})}}),n}(e))}),t=(t=i.sort(t)).filter(function(e){return!!e.length()}),r.unique(t,function(e){return e.toString()})}function v(e,t,n){var i=_(e);n&&i.reverse();var o=r.find(i,function(e){return e.equal(t)});if(o)return i[i.indexOf(o)+1];var s=i.filter(function(e){return e.inside(t.end)});if(s.length)return s.sort(function(e,t){return e.length()-t.length()})[0];o=r.find(i,n?function(e){return e.endt.start});return o||(o=i[0]),o}function b(e,t,n){return v(u.parse(e,{offset:t}),n,!1)}function x(e,t,n){return v(u.parse(e,{offset:t}),n,!0)}return{selectNextItemAction:function(e){return s.isSupportedCSS(e.getSyntax())?function(e){return h(e,!1,c.locateRule.bind(c),b)}(e):d(e)},selectPreviousItemAction:function(e){return s.isSupportedCSS(e.getSyntax())?function(e){return h(e,!0,c.locateRule.bind(c),x)}(e):function(e){return h(e,!0,m,function(e,t,n){return y(e,t,n,!0)})}(e)}}})},{"../assets/range":30,"../assets/stringStream":32,"../editTree/css":37,"../parser/xml":62,"../utils/action":70,"../utils/common":73,"../utils/cssSections":74,"../utils/editor":75}],17:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){return{selectLineAction:function(e){var t=e.getCurrentLineRange();return e.createSelection(t.start,t.end),!0}}})},{}],18:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r=(e("../assets/resources"),e("../assets/htmlMatcher")),o=e("../utils/editor"),s=e("../assets/profile");return{splitJoinTagAction:function(e,t){var n=o.outputInfo(e,null,t),a=s.get(n.profile),l=r.tag(n.content,e.getCaretPos());return!!l&&(l.close?function(e,t,n){var r=t.selfClosing()||" /",o=n.open.range.substring(n.source).replace(/\s*>$/,r+">"),s=e.getCaretPos();return o.length+n.outerRange.start$/,">");return r=n.outerRange.start+s.length,s+=o+"",s=i.escapeText(s),e.replaceContent(s,n.outerRange.start,n.outerRange.end),e.setCaretPos(r),!0}(e,a,l))}}})},{"../assets/htmlMatcher":26,"../assets/profile":29,"../assets/resources":31,"../utils/common":73,"../utils/editor":75}],19:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/preferences"),r=e("../assets/range"),o=e("../utils/common"),s=e("../utils/action"),a=e("../utils/editor"),l=e("../assets/htmlMatcher"),u=e("../editTree/css");function c(e){var t=r(e.getSelectionRange()),n=a.outputInfo(e);if(!t.length()){var i=u.parseFromPosition(n.content,e.getCaretPos());if(i){var s=function(e,t){var n=t-(e.options.offset||0),i=/^[\s\n\r]/;return o.find(e.list(),function(t){return t.range().end===n?i.test(e.source.charAt(n)):t.range().inside(n)})}(i,e.getCaretPos());t=s?s.range(!0):r(i.nameRange(!0).start,i.source)}}return t.length()||(t=r(e.getCurrentLineRange()),o.narrowToNonSpace(n.content,t)),h(e,"/*","*/",t)}function p(e,t,n,i){for(var o=-1,s=-1,a=function(t,n){return e.substr(n,t.length)==t};t--;)if(a(n,t)){o=t;break}if(-1!=o){t=o;for(var l=e.length;l>=t++;)if(a(i,t)){s=t+i.length;break}}return-1!=o&&-1!=s?r(o,s-o):null}function h(e,t,n,i){var r=a.outputInfo(e).content,s=e.getCaretPos(),l=null;var u=p(r,s,t,n);return u&&u.overlap(i)?l=(i=u).substring(r).replace(new RegExp("^"+o.escapeForRegexp(t)+"\\s*"),function(e){return s-=e.length,""}).replace(new RegExp("\\s*"+o.escapeForRegexp(n)+"$"),""):(l=t+" "+i.substring(r).replace(new RegExp(o.escapeForRegexp(t)+"\\s*|\\s*"+o.escapeForRegexp(n),"g"),"")+" "+n,s+=t.length+1),null!==l&&(l=o.escapeText(l),e.setCaretPos(i.start),e.replaceContent(a.unindent(e,l),i.start,i.end),e.setCaretPos(s),!0)}return{toggleCommentAction:function(e){var t=a.outputInfo(e);if(s.isSupportedCSS(t.syntax)){var n=e.getCaretPos(),o=l.tag(t.content,n);o&&o.open.range.inside(n)&&(t.syntax="html")}return~i.getArray("css.syntaxes").indexOf(t.syntax)?c(e):"javascript"===t.syntax?c(e):function(e){var t=r(e.getSelectionRange()),n=a.outputInfo(e);if(!t.length()){var i=l.tag(n.content,e.getCaretPos());i&&(t=i.outerRange)}return h(e,"\x3c!--","--\x3e",t)}(e)}}})},{"../assets/htmlMatcher":26,"../assets/preferences":28,"../assets/range":30,"../editTree/css":37,"../utils/action":70,"../utils/common":73,"../utils/editor":75}],20:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r=e("../utils/editor"),o=e("../utils/action"),s=e("../editTree/xml"),a=e("../editTree/css"),l=e("../utils/base64"),u=e("../plugin/file");function c(e,t,n){var i;if(t){if(/^data:/.test(t))return i=l.decode(t.replace(/^data\:.+?;.+?,/,"")),n(o.getImageSize(i));var r=u.locateFile(e.getFilePath(),t);if(null===r)throw"Can't find "+t+" file";u.read(r,function(e,t){if(e)throw"Unable to read "+r+": "+e;t=String(t),n(o.getImageSize(t))})}}return{updateImageSizeAction:function(e){return o.isSupportedCSS(e.getSyntax())?function(e){var t=e.getCaretPos(),n=r.outputInfo(e),s=a.parseFromPosition(n.content,t,!0);if(s){var l,u=s.itemFromPosition(t,!0);u&&(l=/url\((["']?)(.+?)\1\)/i.exec(u.value()||""))&&c(e,l[2],function(n){if(n){var r=s.range(!0);s.value("width",n.width+"px"),s.value("height",n.height+"px",s.indexOf("width")+1),o.compoundUpdate(e,i.extend(r,{data:s.toString(),caret:t}))}})}}(e):function(e){var t=e.getCaretPos(),n=r.outputInfo(e),a=s.parseFromPosition(n.content,t,!0);a&&"img"==(a.name()||"").toLowerCase()&&c(e,a.value("src"),function(n){if(n){var r=a.range(!0);a.value("width",n.width),a.value("height",n.height,a.indexOf("width")+1),o.compoundUpdate(e,i.extend(r,{data:a.toString(),caret:t}))}})}(e),!0}}})},{"../editTree/css":37,"../editTree/xml":38,"../plugin/file":63,"../utils/action":70,"../utils/base64":71,"../utils/common":73,"../utils/editor":75}],21:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../editTree/xml"),r=(e("../utils/editor"),e("../utils/action")),o=e("../utils/common"),s=e("../parser/abbreviation");return{updateTagAction:function(e,t){if(!(t=t||e.prompt("Enter abbreviation")))return!1;var n=e.getContent(),i=r.captureContext(e),o=this.getUpdatedTag(t,i,n);return!!o&&(o.name()!=i.name&&i.match.close&&e.replaceContent("",i.match.close.range.start,i.match.close.range.end,!0),e.replaceContent(o.source,i.match.open.range.start,i.match.open.range.end,!0),!0)},getUpdatedTag:function(e,t,n,r){if(!t)return null;var a=s.parse(e,r||{}),l=i.parse(t.match.open.range.substring(n),{offset:t.match.outerRange.start});a.children.forEach(function(e,t){!function(e,t,n){var i=(t.attribute("class")||"").split(/\s+/g);n&&i.push("+"+t.name());var r=function(e){return o.replaceCounter(e,t.counter)};i.forEach(function(t){if(t){var n=(t=r(t)).charAt(0);"+"==n?e.addClass(t.substr(1)):"-"==n?e.removeClass(t.substr(1)):e.value("class",t)}}),t.attributeList().forEach(function(t){if("class"!=t.name.toLowerCase()){var n=t.name.charAt(0);if("+"==n){var i=t.name.substr(1),o=e.get(i);o?o.value(o.value()+r(t.value)):e.value(i,r(t.value))}else"-"==n?e.remove(t.name.substr(1)):e.value(t.name,r(t.value))}})}(l,e,t)});var u=a.children[0];return u.data("nameResolved")||l.name(u.name()),l}}})},{"../editTree/xml":38,"../parser/abbreviation":55,"../utils/action":70,"../utils/common":73,"../utils/editor":75}],22:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../assets/range"),r=e("../assets/htmlMatcher"),o=e("../utils/common"),s=e("../utils/editor"),a=e("../utils/action"),l=e("../parser/abbreviation");return{wrapWithAbbreviationAction:function(e,t,n,u){var c=s.outputInfo(e,n,u);if(!(t=t||e.prompt("Enter abbreviation")))return null;t=String(t);var p=i(e.getSelectionRange());if(!p.length()){var h=r.tag(c.content,p.start);if(!h)return!1;p=o.narrowToNonSpace(c.content,h.range)}var d=o.escapeText(p.substring(c.content)),f=l.expand(t,{pastedContent:s.unindent(e,d),syntax:c.syntax,profile:c.profile,contextNode:a.captureContext(e)});return!!f&&(e.replaceContent(f,p.start,p.end),!0)}}})},{"../assets/htmlMatcher":26,"../assets/range":30,"../parser/abbreviation":55,"../utils/action":70,"../utils/common":73,"../utils/editor":75}],23:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var r=e("./preferences"),o=e("../utils/common");r.define("caniuse.enabled",!0,"Enable support of Can I Use database. When enabled,\t\tCSS abbreviation resolver will look at Can I Use database first before detecting\t\tCSS properties that should be resolved"),r.define("caniuse.vendors","all","A comma-separated list vendor identifiers\t\t(as described in Can I Use database) that should be supported\t\twhen resolving vendor-prefixed properties. Set value to all\t\tto support all available properties"),r.define("caniuse.era","e-2","Browser era, as defined in Can I Use database.\t\tExamples: e0 (current version), e1 (near future)\t\te-2 (2 versions back) and so on.");var s={"border-image":["border-image"],"css-boxshadow":["box-shadow"],"css3-boxsizing":["box-sizing"],multicolumn:["column-width","column-count","columns","column-gap","column-rule-color","column-rule-style","column-rule-width","column-rule","column-span","column-fill"],"border-radius":["border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],transforms2d:["transform"],"css-hyphens":["hyphens"],"css-transitions":["transition","transition-property","transition-duration","transition-timing-function","transition-delay"],"font-feature":["font-feature-settings"],"css-animation":["animation","animation-name","animation-duration","animation-timing-function","animation-iteration-count","animation-direction","animation-play-state","animation-delay","animation-fill-mode","@keyframes"],"css-gradients":["linear-gradient"],"css-masks":["mask-image","mask-source-type","mask-repeat","mask-position","mask-clip","mask-origin","mask-size","mask","mask-type","mask-box-image-source","mask-box-image-slice","mask-box-image-width","mask-box-image-outset","mask-box-image-repeat","mask-box-image","clip-path","clip-rule"],"css-featurequeries":["@supports"],flexbox:["flex","inline-flex","flex-direction","flex-wrap","flex-flow","order","flex"],calc:["calc"],"object-fit":["object-fit","object-position"],"css-grid":["grid","inline-grid","grid-template-rows","grid-template-columns","grid-template-areas","grid-template","grid-auto-rows","grid-auto-columns"," grid-auto-flow","grid-auto-position","grid"," grid-row-start","grid-column-start","grid-row-end","grid-column-end","grid-column","grid-row","grid-area","justify-self","justify-items","align-self","align-items"],"css-repeating-gradients":["repeating-linear-gradient"],"css-filters":["filter"],"user-select-none":["user-select"],"intrinsic-width":["min-content","max-content","fit-content","fill-available"],"css3-tabsize":["tab-size"]},a=null,l=null,u=null;function c(e,t){"string"==typeof e&&(e=JSON.parse(e)),t||(e=p(e)),l=e.vendors,a=e.css,u=e.era}function p(e){return"string"==typeof e&&(e=JSON.parse(e)),{vendors:function(e){var t={};return Object.keys(e.agents).forEach(function(n){var i=e.agents[n];t[n]={prefix:i.prefix,versions:i.versions}}),t}(e),css:function(e){var t={};e.cats.CSS;return Object.keys(e.data).forEach(function(n){var i=e.data[n];n in s&&s[n].forEach(function(e){t[e]=i.stats})}),t}(e),era:function(e){return Object.keys(e.eras).sort(function(e,t){return parseInt(e.substr(1))-parseInt(t.substr(1))})}(e)}}var h=null;return function(e){if(void 0===i||!i.amd)try{var t=e("fs"),n=e("path");h=t.readFileSync(n.join(__dirname,"../caniuse.json"),{encoding:"utf8"})}catch(e){}}(e),h&&c(h),{load:c,optimize:p,resolvePrefixes:function(e){if(!(r.get("caniuse.enabled")&&a&&e in a))return null;var t,n,i,s,c,p,h,d,f,y=[],m=a[e],g=(t=r.get("caniuse.era"),~(n=u.indexOf(t))||(n=u.indexOf("e-2")),n);return(d=Object.keys(l),f=r.getArray("caniuse.vendors"),f&&"all"!=f[0]?(c=[],h=s=f,(p=i=d).length>h.length&&(p=s,h=i),h.forEach(function(e){~p.indexOf(e)&&c.push(e)}),c):d).forEach(function(e){for(var t,n=l[e].versions.slice(g),i=0;i\s]+))?)*)\s*(\/?)>/,o=/^<\/([\w\:\-]+)[^>]*>/;function s(e,t){return{range:i(e,"number"==typeof t?t-e:t[0]),type:"comment"}}function a(e){var t,n={};return{open:function(e){var t=this.matches(e);return t&&"open"==t.type?t:null},close:function(e){var t=this.matches(e);return t&&"close"==t.type?t:null},matches:function(s){var a="p"+s;if(!(a in n)&&(n[a]=!1,"<"==e.charAt(s))){var l=e.slice(s);(t=l.match(r))?n[a]=function(e,t){return{name:t[1],selfClose:!!t[3],range:i(e,t[0]),type:"open"}}(s,t):(t=l.match(o))&&(n[a]=function(e,t){return{name:t[1],range:i(e,t[0]),type:"close"}}(s,t))}return n[a]},text:function(){return e},clean:function(){n=e=t=null}}}function l(e,t,n){return e.substring(t,t+n.length)==n}function u(e,t){for(var n=[],i=null,r=t.text(),o=e.range.end,s=r.length;o=0;h--)if(c=o.open(h)){if(c.selfClose){if(c.range.cmp(t,"lt","gt"))break;continue}if(p=u(c,o)){if(i.create2(c.range.start,p.range.end).contains(t))break}else if(c.range.contains(t))break;c=null}else if(l(e,h,"--\x3e")){for(n=h-1;n>=0&&!l(e,n,"--\x3e");n--)if(l(e,n,"\x3c!--")){h=n;break}}else if(l(e,h,"\x3c!--")){for(n=h+4,r=e.length;n$/,"").length}return{open:c,close:p,type:"comment"==c.type?"comment":"tag",innerRange:f,innerContent:function(){return this.innerRange.substring(e)},outerRange:d,outerContent:function(){return this.outerRange.substring(e)},range:f.length()&&f.cmp(t,"lte","gte")?f:d,content:function(){return this.range.substring(e)},source:e}}},tag:function(e,t){var n=this.find(e,t);if(n&&"tag"==n.type)return n}}})},{"./range":30}],27:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){return{log:function(){"undefined"!=typeof console&&console.log&&console.log.apply(console,arguments)}}})},{}],28:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r={},o={},s=null,a=null;return{define:function(e,t,n){var i=e;"string"==typeof e&&((i={})[e]={value:t,description:n}),Object.keys(i).forEach(function(e){var t,n=i[e];o[e]="object"==typeof(t=n)&&!Array.isArray(t)&&"value"in t&&Object.keys(t).length<3?n:{value:n}})},set:function(e,t){var n=e;"string"==typeof e&&((n={})[e]=t),Object.keys(n).forEach(function(e){var t,i=n[e];if(!(e in o))throw new Error('Property "'+e+'" is not defined. You should define it first with `define` method of current module');if(i!==o[e].value){switch(typeof o[e].value){case"boolean":i="string"==typeof(t=i)?"yes"==(t=t.toLowerCase())||"true"==t||"1"==t:!!t;break;case"number":i=parseInt(i+"",10)||0;break;default:null!==i&&(i+="")}r[e]=i}else e in r&&delete r[e]})},get:function(e){return e in r?r[e]:e in o?o[e].value:void 0},getArray:function(e){var t=this.get(e);return void 0===t||null===t||""===t?null:(t=t.split(",").map(i.trim)).length?t:null},getDict:function(e){var t={};return this.getArray(e).forEach(function(e){var n=e.split(":");t[n[0]]=n[1]}),t},description:function(e){return e in o?o[e].description:void 0},remove:function(e){Array.isArray(e)||(e=[e]),e.forEach(function(e){e in r&&delete r[e],e in o&&delete o[e]})},list:function(){return Object.keys(o).sort().map(function(e){return{name:e,value:this.get(e),type:typeof o[e].value,description:o[e].description}},this)},load:function(e){Object.keys(e).forEach(function(t){this.set(t,e[t])},this)},exportModified:function(){return i.extend({},r)},reset:function(){r={}},_startTest:function(){s=o,a=r,o={},r={}},_stopTest:function(){o=s,r=a}}})},{"../utils/common":73}],29:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var i=e("../utils/common"),r=e("./resources"),o=e("./preferences");o.define("profile.allowCompactBoolean",!0,'This option can be used to globally disable compact form of boolean attribues (attributes where name and value are equal). With compactform enabled, HTML tags can be outputted as <div contenteditable> instead of <div contenteditable="contenteditable">'),o.define("profile.booleanAttributes","^contenteditable|seamless$","A regular expression for attributes that should be boolean by default.If attribute name matches this expression, you don’t have to write dot after attribute name in Emmet abbreviation to mark it as boolean.");var s={},a={tag_case:"asis",attr_case:"asis",attr_quotes:"double",tag_nl:"decide",tag_nl_leaf:!1,place_cursor:!0,indent:!0,inline_break:3,compact_bool:!1,self_closing_tag:"xhtml",filters:"",extraFilters:""};function l(e){i.extend(this,a,e)}function u(e,t){switch(String(t||"").toLowerCase()){case"lower":return e.toLowerCase();case"upper":return e.toUpperCase()}return e}function c(e,t){return s[e.toLowerCase()]=new l(t)}function p(){c("xhtml"),c("html",{self_closing_tag:!1,compact_bool:!0}),c("xml",{self_closing_tag:!0,tag_nl:!0}),c("plain",{tag_nl:!1,indent:!1,place_cursor:!1}),c("line",{tag_nl:!1,indent:!1,extraFilters:"s"}),c("css",{tag_nl:!0}),c("css_line",{tag_nl:!1})}return l.prototype={tagName:function(e){return u(e,this.tag_case)},attributeName:function(e){return u(e,this.attr_case)},attributeQuote:function(){return"single"==this.attr_quotes?"'":'"'},selfClosing:function(){return"xhtml"==this.self_closing_tag?" /":!0===this.self_closing_tag?"/":""},cursor:function(){return this.place_cursor?i.getCaretPlaceholder():""},isBoolean:function(e,t){if(e==t)return!0;var n=o.get("profile.booleanAttributes");return!(t||!n)&&(n=new RegExp(n,"i")).test(e)},allowCompactBoolean:function(){return this.compact_bool&&o.get("profile.allowCompactBoolean")}},p(),{create:function(e,t){return 2==arguments.length?c(e,t):new l(i.defaults(e||{},a))},get:function(e,t){if(!e&&t){var n=r.findItem(t,"profile");n&&(e=n)}return e?e instanceof l?e:"string"==typeof e&&e.toLowerCase()in s?s[e.toLowerCase()]:this.create(e):s.plain},remove:function(e){(e=(e||"").toLowerCase())in s&&delete s[e]},reset:function(){s={},p()},stringCase:u}})},{"../utils/common":73,"./preferences":28,"./resources":31}],30:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){function i(e,t,n){switch(n){case"eq":case"==":return e===t;case"lt":case"<":return e":return e>t;case"gte":case">=":return e>=t}}function r(e,t){"object"==typeof e&&"start"in e?(this.start=Math.min(e.start,e.end),this.end=Math.max(e.start,e.end)):Array.isArray(e)?(this.start=e[0],this.end=e[1]):(t="string"==typeof t?t.length:+t,this.start=e,this.end=e+t)}return r.prototype={length:function(){return Math.abs(this.end-this.start)},equal:function(e){return this.cmp(e,"eq","eq")},shift:function(e){return this.start+=e,this.end+=e,this},overlap:function(e){return e.start<=this.end&&e.end>=this.start},intersection:function(e){if(this.overlap(e)){var t=Math.max(e.start,this.start);return new r(t,Math.min(e.end,this.end)-t)}return null},union:function(e){if(this.overlap(e)){var t=Math.min(e.start,this.start);return new r(t,Math.max(e.end,this.end)-t)}return null},inside:function(e){return this.cmp(e,"lte","gt")},contains:function(e){return this.cmp(e,"lt","gt")},include:function(e){return this.cmp(e,"lte","gte")},cmp:function(e,t,n){var o,s;return e instanceof r?(o=e.start,s=e.end):o=s=e,i(this.start,o,t||"<=")&&i(this.end,s,n||">")},substring:function(e){return this.length()>0?e.substring(this.start,this.end):""},clone:function(){return new r(this.start,this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return this.valueOf()},valueOf:function(){return"{"+this.start+", "+this.length()+"}"}},n.exports=function(e,t){return void 0===e||null===e?null:e instanceof r?e:("object"==typeof e&&"start"in e&&"end"in e&&(t=e.end-e.start,e=e.start),new r(e,t))},n.exports.create=n.exports,n.exports.isRange=function(e){return e instanceof r},n.exports.create2=function(e,t){return"number"==typeof e&&"number"==typeof t&&(t-=e),this.create(e,t)},n.exports.sort=function(e,t){return e=e.sort(function(e,t){return e.start===t.start?t.end-e.end:e.start-t.start}),t&&e.reverse(),e},n.exports})},{}],31:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){var r=e("./handlerList"),o=e("../utils/common"),s=e("./elements"),a=(e("../assets/logger"),e("../vendor/stringScore")),l=e("../resolver/css"),u={},c=/^<(\w+\:?[\w\-]*)((?:\s+[@\!]?[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/,p={},h={},d=r.create();function f(e,t){e&&Object.keys(e).forEach(function(n){t(e[n],n)})}function y(e,t,n){var i;return i=t,t=o.replaceUnescapedSymbol(i,"|",o.getCaretPlaceholder()),"snippets"==n?s.create("snippet",t):"abbreviations"==n?function(e,t){var n;return e=o.trim(e),(n=c.exec(t))?s.create("element",n[1],n[2],"/"==n[4]):s.create("reference",t)}(e,t):void 0}function m(e){return e.replace(/:$/,"").replace(/:/g,"-")}return o.extend(t,{setVocabulary:function(e,t){u={};var n={};f(e,function(e,t){var i={};f(e,function(e,t){var n;"abbreviations"!=t&&"snippets"!=t||(n={},f(e,function(e,t){for(var i=t.split("|"),r=i.length-1;r>=0;r--)n[i[r]]=e}),e=n),i[t]=e}),n[t]=i}),"system"==t?p=n:h=n},getVocabulary:function(e){return"system"==e?p:h},getMatchedResource:function(e,t){return d.exec(null,o.toArray(arguments))||this.findSnippet(t,e.name())},getVariable:function(e){return(this.getSection("variables")||{})[e]},setVariable:function(e,t){var n=this.getVocabulary("user")||{};"variables"in n||(n.variables={}),n.variables[e]=t,this.setVocabulary(n,"user")},hasSyntax:function(e){return e in this.getVocabulary("user")||e in this.getVocabulary("system")},addResolver:function(e,t){d.add(e,t)},removeResolver:function(e){d.remove(e)},getSection:function(e){if(!e)return null;e in u||(u[e]=o.deepMerge({},p[e],h[e]));for(var t,n=u[e],i=o.toArray(arguments,1);n&&(t=i.shift());){if(!(t in n))return null;n=n[t]}return n},findItem:function(e,t){for(var n=this.getSection(e);n;){if(t in n)return n[t];n=this.getSection(n.extends)}},findSnippet:function(e,t,n){if(!e||!t)return null;n=n||[];var i=[t];~t.indexOf("-")&&i.push(t.replace(/\-/g,":"));var r=this.getSection(e),o=null;return["snippets","abbreviations"].some(function(t){var n=this.getSection(e,t);if(n)return i.some(function(e){if(n[e])return o=y(e,n[e],t)})},this),n.push(e),o||!r.extends||~n.indexOf(r.extends)?o:this.findSnippet(r.extends,t,n)},fuzzyFindSnippet:function(e,t,n){var i=this.fuzzyFindMatches(e,t,n)[0];if(i)return i.value.parsedValue},fuzzyFindMatches:function(e,t,n){n=n||.3,t=m(t);var i=this.getAllSnippets(e);return Object.keys(i).map(function(e){var n=i[e];return{key:e,score:a.score(n.nk,t,.1),value:n}}).filter(function(e){return e.score>=n}).sort(function(e,t){return e.score-t.score}).reverse()},getAllSnippets:function(e){var t="all-"+e;if(!u[t]){var n=[],i=e,r=[];do{var s=this.getSection(i);if(!s)break;["snippets","abbreviations"].forEach(function(e){var t={};f(s[e]||null,function(n,i){t[i]={nk:m(i),value:n,parsedValue:y(i,n,e),type:e}}),n.push(t)}),r.push(i),i=s.extends}while(i&&!~r.indexOf(i));u[t]=o.extend.apply(o,n.reverse())}return u[t]},getNewline:function(){var e=this.getVariable("newline");return"string"==typeof e?e:"\n"},setNewline:function(e){this.setVariable("newline",e),this.setVariable("nl",e)}}),t.addResolver(l.resolve.bind(l)),function(e){if(void 0===i||!i.amd)try{var n=e("fs"),r=e("path"),o=n.readFileSync(r.join(__dirname,"../snippets.json"),{encoding:"utf8"});t.setVocabulary(JSON.parse(o),"system")}catch(e){}}(e),t})},{"../assets/logger":27,"../resolver/css":64,"../utils/common":73,"../vendor/stringScore":79,"./elements":24,"./handlerList":25}],32:[function(e,t,n){if("object"==typeof t&&"function"!=typeof i)var i=function(i){t.exports=i(e,n,t)};i(function(e,t,n){function i(e){this.pos=this.start=0,this.string=e,this._length=e.length}return i.prototype={eol:function(){return this.pos>=this._length},sol:function(){return 0===this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this._length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},skipToPair:function(e,t,n){for(var i,r=0,o=this.pos,s=this._length;on&&(n=i),e.placeholder?"${"+(i+t)+":"+e.placeholder+"}":"${"+(i+t)+"}"}};return["start","end","content"].forEach(function(t){e[t]=this.processText(e[t],i)},this),n},variablesResolver:function(e){var t={};return function(n,r){if("child"==r)return n;if("cursor"==r)return i.getCaretPlaceholder();var a=e.attribute(r);if(void 0!==a&&a!==n)return a;var l=o.getVariable(r);return l||(t[r]||(t[r]=s++),"${"+t[r]+":"+r+"}")}},replaceVariables:function(e,t){var n="function"==typeof(t=t||{})?t:function(e,n){return n in t?t[n]:null};return this.processText(e,{variable:function(e){var t=n(e.token,e.name,e);return null===t&&(t=o.getVariable(e.name)),null!==t&&void 0!==t||(t=e.token),t}})},resetTabstopIndex:function(){a=0,s=100},abbrOutputProcessor:function(e,t,n){var i=0,r=this,o={tabstop:function(e){var t=parseInt(e.group,10);return 0===t?"${0}":(t>i&&(i=t),e.placeholder?"${"+(t+a)+":"+r.processText(e.placeholder,o)+"}":"${"+(t+a)+"}")}};return e=this.processText(e,o),e=this.replaceVariables(e,this.variablesResolver(t)),a+=i+1,e}}})},{"../utils/common":73,"./resources":31,"./stringStream":32}],34:[function(e,t,n){if("object"==typeof t&&"function"!=typeof r)var r=function(i){t.exports=i(e,n,t)};r(function(e,t,n){function r(e){this.tokens=e,this._position=0,this.reset()}return r.prototype={next:function(){if(this.hasNext()){var e=this.tokens[++this._i];return this._position=e.start,e}return this._i=this._il,null},current:function(){return this.tokens[this._i]},peek:function(){return this.tokens[this._i+i]},position:function(){return this._position},hasNext:function(){return this._ispecific handling to run the video element.',usage_perc_y:80.71,usage_perc_a:.11,ucprefix:!1,parent:"",keywords:"