UNPKG

1.81 MBJavaScriptView Raw
1function universalModule(){function e(e,t,n,r){var i;if(r){var o=r.prototype;i=yt.create(o)}else i=e.prototype;return yt.keys(t).forEach(function(e){i[e]=t[e]}),yt.keys(n).forEach(function(t){e[t]=n[t]}),i.constructor=e,e.prototype=i,e}function t(e,t,n,r){return yt.getPrototypeOf(t)[n].apply(e,r)}function n(e,n,r){t(e,n,"constructor",r)}function r(e){return e.value=!1,e}function i(e){e&&(e.value=!0)}function o(){}function a(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;n>i;i++)r[i]=e[i+t];return r}function s(e){return kt.value=e,kt.done=!1,kt}function l(){return kt.value=void 0,kt.done=!0,kt}function c(e,t){if(!e)throw new Error(t)}function u(e){if(!e)return 0;if(e===!0)return 1;var t=typeof e;if("number"===t){if((0|e)===e)return e&Dt;e=""+e,t="string"}return"string"===t?e.length>Rt?d(e):p(e):e.hashCode?u("function"==typeof e.hashCode?e.hashCode():e.hashCode):f(e)}function d(e){var t=Pt[e];return null==t&&(t=p(e),Nt===At&&(Nt=0,Pt={}),Nt++,Pt[e]=t),t}function p(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)&Dt;return t}function f(e){if(e[Ot])return e[Ot];var t=++Mt&Dt;if(!Lt)try{return Object.defineProperty(e,Ot,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}catch(n){Lt=!0}return e[Ot]=t,t}function h(){return Object.create(Ut)}function m(e){var t=Object.create(Bt);return t.__reversedIndices=e?e.__reversedIndices:!1,t}function g(e,t,n,r){var i=e.get?e.get(t[r],St):St;return i===St?n:++r===t.length?i:g(i,t,n,r)}function v(e,t,n){return(0===e||null!=n&&-n>=e)&&(null==t||null!=n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return null==e?n:0>e?Math.max(0,t+e):t?Math.min(t,e):e}function E(e){return e}function w(e,t){return[t,e]}function S(){return!0}function C(){return this}function I(e){return(e||0)+1}function k(e,t,n,r,i){var o=e.__makeSequence();return o.__iterateUncached=function(o,a,s){var l=0,c=e.__iterate(function(e,i,a){if(t.call(n,e,i,a)){if(o(e,r?i:l,a)===!1)return!1;l++}},a,s);return i?c:l},o}function x(e){return function(){return!e.apply(this,arguments)}}function T(e){return"string"==typeof e?JSON.stringify(e):e}function D(e,t){for(var n="";t;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n}function M(e,t){return e>t?1:t>e?-1:0}function O(e){c(1/0!==e,"Cannot perform this action with an infinite sequence.")}function L(e,t){var n=new qt;return n.next=function(){var n=e.next();return n.done?n:(n.value=t(n.value),n)},n}function R(e,t,n){return n instanceof Ft?A(e,t,n):n}function A(e,t,n){return new Gt(e._rootData,e._keyPath.concat(t),e._onChange,n)}function N(e,t,n){var r=e._rootData.updateIn(e._keyPath,n?Kt.empty():void 0,t),i=e._keyPath||[];return e._onChange&&e._onChange.call(void 0,r,e._rootData,n?i.concat(n):i),new Gt(r,e._keyPath,e._onChange)}function P(e,t){return e instanceof Gt&&(e=e.deref()),t instanceof Gt&&(t=t.deref()),e===t?0!==e||0!==t||1/e===1/t:e!==e?t!==t:e instanceof Ft?e.equals(t):!1}function F(e,t){return s(0===e||1===e?t[e]:[t[0],t[1]])}function $(e,t){return{node:e,index:0,__prev:t}}function U(e,t,n,r){var i=Object.create(Yt);return i.length=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function j(e,t,n){var i=r(Ct),o=r(It),a=V(e._root,e.__ownerID,0,u(t),t,n,i,o);if(!o.value)return e;var s=e.length+(i.value?n===St?-1:1:0);return e.__ownerID?(e.length=s,e._root=a,e.__hash=void 0,e.__altered=!0,e):a?U(s,a):Kt.empty()}function V(e,t,n,r,o,a,s,l){return e?e.update(t,n,r,o,a,s,l):a===St?e:(i(l),i(s),new rn(t,r,[o,a]))}function B(e){return e.constructor===rn||e.constructor===tn}function W(e,t,n,r,i){if(e.hash===r)return new tn(t,r,[e.entry,i]);var o,a=(0===n?e.hash:e.hash>>>n)&wt,s=(0===n?r:r>>>n)&wt,l=a===s?[W(e,t,n+bt,r,i)]:(o=new rn(t,r,i),s>a?[e,o]:[o,e]);return new Qt(t,1<<a|1<<s,l)}function H(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,l=1,c=t.length;c>s;s++,l<<=1){var u=t[s];null!=u&&s!==r&&(i|=l,a[o++]=u)}return new Qt(e,i,a)}function q(e,t,n,r,i){for(var o=0,a=new Array(Et),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:null;return a[r]=i,new Zt(e,o+1,a)}function z(e,t,n){for(var r=[],i=0;i<n.length;i++){var o=n[i];o&&r.push(Array.isArray(o)?Ft(o).fromEntrySeq():Ft(o))}return K(e,t,r)}function G(e){return function(t,n){return t&&t.mergeDeepWith?t.mergeDeepWith(e,n):e?e(t,n):n}}function K(e,t,n){return 0===n.length?e:e.withMutations(function(e){for(var r=t?function(n,r){var i=e.get(r,St);e.set(r,i===St?n:t(i,n))}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)})}function X(e,t,n,r,i){var o=t.length;if(i===o)return r(e);c(e.set,"updateIn with invalid keyPath");var a=i===o-1?n:Kt.empty(),s=t[i],l=e.get(s,a),u=X(l,t,n,r,i+1);return u===l?e:e.set(s,u)}function Y(e){return e-=e>>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,127&e}function Q(e,t,n,r){var i=r?e:a(e);return i[t]=n,i}function J(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;i>s;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function Z(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;r>a;a++)a===t&&(o=1),i[a]=e[a+o];return i}function et(e,t,n,r,i,o){if(e){var a,s=e.array,l=s.length-1;if(0===t)for(a=0;l>=a;a++){var c=o?l-a:a;if(s.hasOwnProperty(c)){var u=c+n;if(u>=0&&r>u&&i(s[c],u)===!1)return!1}}else{var d=1<<t,p=t-bt;for(a=0;l>=a;a++){var f=o?l-a:a,h=n+f*d;if(r>h&&h+d>0){var m=s[f];if(m&&!et(m,p,h,r,i,o))return!1}}}}return!0}function tt(e,t,n,r,i){return{array:e,level:t,offset:n,max:r,rawMax:r-n>>t,index:0,__prev:i}}function nt(e,t,n,r,i,o,a){var s=Object.create(pn);return s.length=t-e,s._origin=e,s._size=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function rt(e,t,n){if(t>=e.length)return n===St?e:e.withMutations(function(e){st(e,0,t+1).set(t,n)});t=ct(t,e._origin);var i=e._tail,o=e._root,a=r(It);return t>=ut(e._size)?i=it(i,e.__ownerID,0,t,n,a):o=it(o,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=o,e._tail=i,e.__hash=void 0,e.__altered=!0,e):nt(e._origin,e._size,e._level,o,i):e}function it(e,t,n,r,o,a){var s,l=o===St,c=r>>>n&wt,u=e&&c<e.array.length&&e.array.hasOwnProperty(c);if(l&&!u)return e;if(n>0){var d=e&&e.array[c],p=it(d,t,n-bt,r,o,a);return p===d?e:(s=ot(e,t),s.array[c]=p,s)}return!l&&u&&e.array[c]===o?e:(i(a),s=ot(e,t),l?delete s.array[c]:s.array[c]=o,s)}function ot(e,t){return t&&e&&t===e.ownerID?e:new fn(e?e.array.slice():[],t)}function at(e,t){if(t>=ut(e._size))return e._tail;if(t<1<<e._level+bt){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&wt],r-=bt;return n}}function st(e,t,n){var r=e.__ownerID||new o,i=e._origin,a=e._size,s=i+t,l=null==n?a:0>n?a+n:i+n;if(s===i&&l===a)return e;if(s>=l)return e.clear();for(var c=e._level,u=e._root,d=0;0>s+d;)u=new fn(u&&u.array.length?[null,u]:[],r),c+=bt,d+=1<<c;d&&(s+=d,i+=d,l+=d,a+=d);for(var p=ut(a),f=ut(l);f>=1<<c+bt;)u=new fn(u&&u.array.length?[u]:[],r),c+=bt;var h=e._tail,m=p>f?at(e,l-1):f>p?new fn([],r):h;if(h&&f>p&&a>s&&h.array.length){u=ot(u,r);for(var g=u,v=c;v>bt;v-=bt){var y=p>>>v&wt;g=g.array[y]=ot(g.array[y],r)}g.array[p>>>bt&wt]=h}if(a>l&&(m=m&&m.removeAfter(r,0,l)),s>=f)s-=f,l-=f,c=bt,u=null,m=m&&m.removeBefore(r,0,s);else if(s>i||p>f){var _,b;d=0;do _=s>>>c&wt,b=f-1>>>c&wt,_===b&&(_&&(d+=(1<<c)*_),c-=bt,u=u&&u.array[_]);while(u&&_===b);u&&s>i&&(u=u&&u.removeBefore(r,c,s-d)),u&&p>f&&(u=u&&u.removeAfter(r,c,f-d)),d&&(s-=d,l-=d)}return e.__ownerID?(e.length=l-s,e._origin=s,e._size=l,e._level=c,e._root=u,e._tail=m,e.__hash=void 0,e.__altered=!0,e):nt(s,l,c,u,m)}function lt(e,t,n){for(var r=[],i=0;i<n.length;i++){var o=n[i];o&&r.push(Ft(o))}var a=Math.max.apply(null,r.map(function(e){return e.length||0}));return a>e.length&&(e=e.setLength(a)),K(e,t,r)}function ct(e,t){return c(e>=0,"Index out of bounds"),e+t}function ut(e){return Et>e?0:e-1>>>bt<<bt}function dt(e,t){var n=Object.create(_n);return n.length=e?e.length:0,n._map=e,n.__ownerID=t,n}function pt(e,t,n,r){var i=Object.create(En.prototype);return i.length=e?e.length:0,i._map=e,i._vector=t,i.__ownerID=n,i.__hash=r,i}function ft(e,t,n){var r=e._map,i=e._vector,o=r.get(t),a=void 0!==o,s=n===St;if(!a&&s||a&&n===i.get(o)[1])return e;a||(o=i.length);var l=s?r.remove(t):a?r:r.set(t,o),c=s?i.remove(o):i.set(o,[t,n]);return e.__ownerID?(e.length=l.length,e._map=l,e._vector=c,e.__hash=void 0,e):pt(l,c)}function ht(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function mt(e,t){return t?gt(t,e,"",{"":e}):vt(e)}function gt(e,t,n,r){return t&&(Array.isArray(t)||t.constructor===Object)?e.call(r,n,Ft(t).map(function(n,r){return gt(e,n,r,t)})):t}function vt(e){if(e){if(Array.isArray(e))return Ft(e).map(vt).toVector();if(e.constructor===Object)return Ft(e).map(vt).toMap()}return e}var yt=Object,_t={};_t.createClass=e,_t.superCall=t,_t.defaultSuperCall=n;var bt=5,Et=1<<bt,wt=Et-1,St={},Ct={value:!1},It={value:!1},kt={value:void 0,done:!1},xt="delete",Tt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Dt=2147483647,Mt=0,Ot="__immutablehash__";"undefined"!=typeof Symbol&&(Ot=Symbol(Ot));var Lt=!1,Rt=16,At=255,Nt=0,Pt={},Ft=function(e){return $t.from(1===arguments.length?e:Array.prototype.slice.call(arguments))},$t=Ft;_t.createClass(Ft,{toString:function(){return this.__toString("Seq {","}")},__toString:function(e,t){return 0===this.length?e+t:e+" "+this.map(this.__toStringMapper).join(", ")+" "+t},__toStringMapper:function(e,t){return t+": "+T(e)},toJS:function(){return this.map(function(e){return e instanceof $t?e.toJS():e}).__toJS()},toArray:function(){O(this.length);var e=new Array(this.length||0);return this.valueSeq().forEach(function(t,n){e[n]=t}),e},toObject:function(){O(this.length);var e={};return this.forEach(function(t,n){e[n]=t}),e},toVector:function(){return O(this.length),un.from(this)},toMap:function(){return O(this.length),Kt.from(this)},toOrderedMap:function(){return O(this.length),En.from(this)},toSet:function(){return O(this.length),vn.from(this)},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(e,t,n){return e+(u(t)^(t===n?0:u(n)))&Dt},0))},equals:function(e){if(this===e)return!0;if(!(e instanceof $t))return!1;if(null!=this.length&&null!=e.length){if(this.length!==e.length)return!1;if(0===this.length&&0===e.length)return!0}return null!=this.__hash&&null!=e.__hash&&this.__hash!==e.__hash?!1:this.__deepEquals(e)},__deepEquals:function(e){var t=this.cacheResult().entrySeq().toArray(),n=0;return e.every(function(e,r){var i=t[n++];return P(r,i[0])&&P(e,i[1])})},join:function(e){e=e||",";var t="",n=!0;return this.forEach(function(r){n?(n=!1,t+=r):t+=e+r}),t},count:function(e,t){return e?this.filter(e,t).count():(null==this.length&&(this.length=this.forEach(S)),this.length)},countBy:function(e){var t=this;return En.empty().withMutations(function(n){t.forEach(function(t,r,i){n.update(e(t,r,i),I)})})},concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[this].concat(e.map(function(e){return $t(e)})),r=this.__makeSequence();return r.length=n.reduce(function(e,t){return null!=e&&null!=t.length?e+t.length:void 0},0),r.__iterateUncached=function(e,t){for(var r,i=0,o=n.length-1,a=0;o>=a&&!r;a++){var s=n[t?o-a:a];i+=s.__iterate(function(t,n,i){return e(t,n,i)===!1?(r=!0,!1):void 0},t)}return i},r},reverse:function(){var e=this,t=e.__makeSequence();return t.length=e.length,t.__iterateUncached=function(t,n){return e.__iterate(t,!n)},t.reverse=function(){return e},t},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var e=this,t=m(e);return t.length=e.length,t.valueSeq=C,t.__iterateUncached=function(t,n,r){if(r&&null==this.length)return this.cacheResult().__iterate(t,n,r);var i,o=0;return r?(o=this.length-1,i=function(e,n,r){return t(e,o--,r)!==!1}):i=function(e,n,r){return t(e,o++,r)!==!1},e.__iterate(i,n),r?this.length:o},t},entrySeq:function(){var e=this;if(e._cache)return $t(e._cache);var t=e.map(w).valueSeq();return t.fromEntries=function(){return e},t},forEach:function(e,t){return this.__iterate(t?e.bind(t):e)},reduce:function(e,t,n){var r=t;return this.forEach(function(t,i,o){r=e.call(n,r,t,i,o)}),r},reduceRight:function(e,t,n){return this.reverse(!0).reduce(e,t,n)},every:function(e,t){var n=!0;return this.forEach(function(r,i,o){return e.call(t,r,i,o)?void 0:(n=!1,!1)}),n},some:function(e,t){return!this.every(x(e),t)},first:function(){return this.find(S)},last:function(){return this.findLast(S)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(e){return this.get(e,St)!==St},get:function(e,t){return this.find(function(t,n){return P(n,e)},null,t)},getIn:function(e,t){return e&&0!==e.length?g(this,e,t,0):this},contains:function(e){return this.find(function(t){return P(t,e)},null,St)!==St},find:function(e,t,n){var r=n;return this.forEach(function(n,i,o){return e.call(t,n,i,o)?(r=n,!1):void 0}),r},findKey:function(e,t){var n;return this.forEach(function(r,i,o){return e.call(t,r,i,o)?(n=i,!1):void 0}),n},findLast:function(e,t,n){return this.reverse(!0).find(e,t,n)},findLastKey:function(e,t){return this.reverse(!0).findKey(e,t)},flip:function(){var e=this,t=h();return t.length=e.length,t.flip=function(){return e},t.__iterateUncached=function(t,n){return e.__iterate(function(e,n,r){return t(n,e,r)!==!1},n)},t},map:function(e,t){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,o){return r(e.call(t,n,i,o),i,o)!==!1},i)},r},mapKeys:function(e,t){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,o){return r(n,e.call(t,i,n,o),o)!==!1},i)},r},filter:function(e,t){return k(this,e,t,!0,!1)},slice:function(e,t){if(v(e,t,this.length))return this;var n=y(e,this.length),r=_(t,this.length);if(n!==n||r!==r)return this.entrySeq().slice(e,t).fromEntrySeq();var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(e){var t=this;if(e>t.length)return t;var n=t.__makeSequence();return n.__iterateUncached=function(n,r,i){if(r)return this.cacheResult().__iterate(n,r,i);var o=0;return t.__iterate(function(t,r,i){return e>o&&n(t,r,i)!==!1?void o++:!1},r,i),o},n.length=this.length&&Math.min(this.length,e),n},takeLast:function(e,t){return this.reverse(t).take(e).reverse(t)},takeWhile:function(e,t){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,o){if(i)return this.cacheResult().__iterate(r,i,o);var a=0;return n.__iterate(function(n,i,o){return e.call(t,n,i,o)&&r(n,i,o)!==!1?void a++:!1},i,o),a},r},takeUntil:function(e,t,n){return this.takeWhile(x(e),t,n)},skip:function(e){var t=this;if(0===e)return t;var n=t.__makeSequence();return n.__iterateUncached=function(n,r,i){if(r)return this.cacheResult().__iterate(n,r,i);var o=!0,a=0,s=0;return t.__iterate(function(t,r,i){if(!o||!(o=s++<e)){if(n(t,r,i)===!1)return!1;a++}},r,i),a},n.length=this.length&&Math.max(0,this.length-e),n},skipLast:function(e,t){return this.reverse(t).skip(e).reverse(t)},skipWhile:function(e,t){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,o){if(i)return this.cacheResult().__iterate(r,i,o);var a=!0,s=0;return n.__iterate(function(n,i,o){if(!a||!(a=e.call(t,n,i,o))){if(r(n,i,o)===!1)return!1;s++}},i,o),s},r},skipUntil:function(e,t,n){return this.skipWhile(x(e),t,n)},groupBy:function(e){var t=this,n=En.empty().withMutations(function(n){t.forEach(function(t,r,i){var o=e(t,r,i),a=n.get(o,St);a===St&&(a=[],n.set(o,a)),a.push([r,t])})});return n.map(function(e){return $t(e).fromEntrySeq()})},sort:function(e,t){return this.sortBy(E,e,t)},sortBy:function(e,t){t=t||M;var n=this;return $t(this.entrySeq().entrySeq().toArray().sort(function(r,i){return t(e(r[1][1],r[1][0],n),e(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(O(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(e,t,n){if(!this._cache)return this.__iterateUncached(e,t,n);var r=this.length-1,i=this._cache,o=this;if(t)for(var a=i.length-1;a>=0;a--){var s=i[a];if(e(s[1],n?s[0]:r-s[0],o)===!1)break}else i.every(n?function(t){return e(t[1],r-t[0],o)!==!1}:function(t){return e(t[1],t[0],o)!==!1});return this.length},__makeSequence:function(){return h()}},{from:function(e){if(e instanceof $t)return e;if(!Array.isArray(e)){if(e&&e.constructor===Object)return new Wt(e);e=[e]}return new Ht(e)}});var Ut=Ft.prototype;Ut.toJSON=Ut.toJS,Ut.__toJS=Ut.toObject,Ut.inspect=Ut.toSource=function(){return this.toString()};var jt=function(){_t.defaultSuperCall(this,Vt.prototype,arguments)},Vt=jt;_t.createClass(jt,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){O(this.length);var e=new Array(this.length||0);return e.length=this.forEach(function(t,n){e[n]=t}),e},fromEntrySeq:function(){var e=this,t=h();return t.length=e.length,t.entrySeq=function(){return e},t.__iterateUncached=function(t,n,r){return e.__iterate(function(e,n,r){return t(e[1],e[0],r)},n,r)},t},join:function(e){e=e||",";var t="",n=0;return this.forEach(function(r,i){var o=i-n;n=i,t+=(1===o?e:D(e,o))+r}),this.length&&n<this.length-1&&(t+=D(e,this.length-1-n)),t},concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[this].concat(e).map(function(e){return Ft(e)}),r=this.__makeSequence();return r.length=n.reduce(function(e,t){return null!=e&&null!=t.length?e+t.length:void 0},0),r.__iterateUncached=function(e,t,r){if(r&&!this.length)return this.cacheResult().__iterate(e,t,r);for(var i,o=0,a=r&&this.length-1,s=n.length-1,l=0;s>=l&&!i;l++){var c=n[t?s-l:l];c instanceof Vt||(c=c.valueSeq()),o+=c.__iterate(function(t,n,s){return n+=o,e(t,r?a-n:n,s)===!1?(i=!0,!1):void 0},t)}return o},r},reverse:function(e){var t=this,n=t.__makeSequence();return n.length=t.length,n.__reversedIndices=!!(e^t.__reversedIndices),n.__iterateUncached=function(n,r,i){return t.__iterate(n,!r,i^e)},n.reverse=function(n){return e===n?t:Bt.reverse.call(this,n)},n},valueSeq:function(){var e=_t.superCall(this,Vt.prototype,"valueSeq",[]);return e.length=void 0,e},filter:function(e,t,n){var r=k(this,e,t,n,n);return n&&(r.length=this.length),r},indexOf:function(e){return this.findIndex(function(t){return P(t,e)})},lastIndexOf:function(e){return this.reverse(!0).indexOf(e)},findIndex:function(e,t){var n=this.findKey(e,t);return null==n?-1:n},findLastIndex:function(e,t){return this.reverse(!0).findIndex(e,t)},slice:function(e,t,n){var r=this;if(v(e,t,r.length))return r;var i=r.__makeSequence(),o=y(e,r.length),a=_(t,r.length);return i.length=r.length&&(n?r.length:a-o),i.__reversedIndices=r.__reversedIndices,i.__iterateUncached=function(i,s,l){if(s)return this.cacheResult().__iterate(i,s,l);var c=this.__reversedIndices^l;if(o!==o||a!==a||c&&null==r.length){var u=r.count();o=y(e,u),a=_(t,u)}var d=c?r.length-a:o,p=c?r.length-o:a,f=r.__iterate(function(e,t,r){return c?null!=p&&t>=p||t>=d&&i(e,n?t:t-d,r)!==!1:d>t||(null==p||p>t)&&i(e,n?t:t-d,r)!==!1},s,l);return null!=this.length?this.length:n?f:Math.max(0,f-d)},i},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,this.length);var r=this.slice(0,e);return 1===n?r:r.concat(a(arguments,2),this.slice(e+t))},take:function(e){var t=this;if(e>t.length)return t;var n=t.__makeSequence();return n.__iterateUncached=function(n,r,i){if(r)return this.cacheResult().__iterate(n,r,i);var o=0,a=0,s=!0,l=t.__iterate(function(t,r,i){return o++<e&&n(t,r,i)!==!1?void(a=r):(s=!1,!1)},r,i);return s?l:a+1},n.length=this.length&&Math.min(this.length,e),n},takeWhile:function(e,t,n){var r=this,i=r.__makeSequence();return i.__iterateUncached=function(o,a,s){if(a)return this.cacheResult().__iterate(o,a,s);var l=0,c=!0,u=r.__iterate(function(n,r,i){return e.call(t,n,r,i)&&o(n,r,i)!==!1?void(l=r):(c=!1,!1)},a,s);return n?i.length:c?u:l+1},n&&(i.length=this.length),i},skip:function(e,t){var n=this;if(0===e)return n;var r=n.__makeSequence();return t&&(r.length=this.length),r.__iterateUncached=function(r,i,o){if(i)return this.cacheResult().__iterate(r,i,o);var a=n.__reversedIndices^o,s=!0,l=0,c=0,u=n.__iterate(function(n,i,a){return s&&(s=c++<e,s||(l=i)),s||r(n,o||t?i:i-l,a)!==!1},i,o);return t?u:a?l+1:u-l},r.length=this.length&&Math.max(0,this.length-e),r},skipWhile:function(e,t,n){var r=this,i=r.__makeSequence();return n&&(i.length=this.length),i.__iterateUncached=function(i,o,a){if(o)return this.cacheResult().__iterate(i,o,a);var s=r.__reversedIndices^a,l=!0,c=0,u=r.__iterate(function(r,o,s){return l&&(l=e.call(t,r,o,s),l||(c=o)),l||i(r,a||n?o:o-c,s)!==!1},o,a);return n?u:s?c+1:u-c},i},groupBy:function(e,t,n){var r=this,i=En.empty().withMutations(function(t){r.forEach(function(i,o,a){var s=e(i,o,a),l=t.get(s,St);l===St&&(l=new Array(n?r.length:0),t.set(s,l)),n?l[o]=i:l.push(i)})});return i.map(function(e){return Ft(e)})},sortBy:function(e,t,n){var r=_t.superCall(this,Vt.prototype,"sortBy",[e,t]);return n||(r=r.valueSeq()),r.length=this.length,r},__makeSequence:function(){return m(this)}},{},Ft);var Bt=jt.prototype;Bt.__toJS=Bt.toArray,Bt.__toStringMapper=T;var Wt=function(e){var t=Object.keys(e);this._object=e,this._keys=t,this.length=t.length};_t.createClass(Wt,{toObject:function(){return this._object},get:function(e,t){return void 0===t||this.has(e)?this._object[e]:t},has:function(e){return this._object.hasOwnProperty(e)},__iterate:function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;i>=o;o++){var a=t?i-o:o;if(e(n[r[a]],r[a],n)===!1)break}return o}},{},Ft);var Ht=function(e){this._array=e,this.length=e.length};_t.createClass(Ht,{toArray:function(){return this._array},__iterate:function(e,t,n){var r=this._array,i=r.length-1,o=-1;if(t){for(var a=i;a>=0;a--){if(r.hasOwnProperty(a)&&e(r[a],n?a:i-a,r)===!1)return o+1;o=a}return r.length}var s=r.every(function(t,a){return e(t,n?i-a:a,r)===!1?!1:(o=a,!0)});return s?r.length:o+1}},{},jt),Ht.prototype.get=Wt.prototype.get,Ht.prototype.has=Wt.prototype.has;var qt=function(){};_t.createClass(qt,{toString:function(){return"[Iterator]"}},{});var zt=qt.prototype;zt[Tt]=C,zt.inspect=zt.toSource=function(){return this.toString()};var Gt=function(e,t,n,r){r=r?r:e.getIn(t),this.length=r instanceof Ft?r.length:null,this._rootData=e,this._keyPath=t,this._onChange=n};_t.createClass(Gt,{deref:function(e){return this._rootData.getIn(this._keyPath,e)},get:function(e,t){if(Array.isArray(e)&&0===e.length)return this;var n=this._rootData.getIn(this._keyPath.concat(e),St);return n===St?t:R(this,e,n)},set:function(e,t){return N(this,function(n){return n.set(e,t)},e)},remove:function(e){return N(this,function(t){return t.remove(e)},e)},clear:function(){return N(this,function(e){return e.clear()})},update:function(e,t,n){return 1===arguments.length?N(this,e):N(this,function(r){return r.update(e,t,n)},e)},withMutations:function(e){return N(this,function(t){return(t||Kt.empty()).withMutations(e)})},cursor:function(e){return Array.isArray(e)&&0===e.length?this:A(this,e)},__iterate:function(e,t,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(t,n,i){return e(R(r,n,t),n,i)},t,n):0}},{},Ft),Gt.prototype[xt]=Gt.prototype.remove,Gt.prototype.getIn=Gt.prototype.get;var Kt=function(e){var t=Xt.empty();return e?e.constructor===Xt?e:t.merge(e):t},Xt=Kt;_t.createClass(Kt,{toString:function(){return this.__toString("Map {","}")},get:function(e,t){return this._root?this._root.get(0,u(e),e,t):t},set:function(e,t){return j(this,e,t)},remove:function(e){return j(this,e,St)},update:function(e,t,n){return 1===arguments.length?this.updateIn([],null,e):this.updateIn([e],t,n)},updateIn:function(e,t,n){var r;return n||(r=[t,n],n=r[0],t=r[1],r),X(this,e,t,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xt.empty()},merge:function(){return z(this,null,arguments)},mergeWith:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return z(this,e,t)},mergeDeep:function(){return z(this,G(null),arguments)},mergeDeepWith:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return z(this,G(e),t)},cursor:function(e,t){return t||"function"!=typeof e?0===arguments.length?e=[]:Array.isArray(e)||(e=[e]):(t=e,e=[]),new Gt(this,e,t)},withMutations:function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new o)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new an(this,0)},values:function(){return new an(this,1)},entries:function(){return new an(this,2)},__iterator:function(e){return new an(this,2,e)},__iterate:function(e,t){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(t){return e(t[1],t[0],n)===!1?!1:void r++},t),r},__deepEquals:function(e){var t=this;return e.every(function(e,n){return P(t.get(n,St),e)})},__ensureOwner:function(e){return e===this.__ownerID?this:e?U(this.length,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)}},{empty:function(){return sn||(sn=U(0))}},Ft);var Yt=Kt.prototype;Yt[xt]=Yt.remove,Yt[Tt]=function(){return this.entries()},Kt.from=Kt;var Qt=function(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n},Jt=Qt;_t.createClass(Qt,{get:function(e,t,n,r){var i=1<<((0===e?t:t>>>e)&wt),o=this.bitmap;return 0===(o&i)?r:this.nodes[Y(o&i-1)].get(e+bt,t,n,r)},update:function(e,t,n,r,i,o,a){var s=(0===t?n:n>>>t)&wt,l=1<<s,c=this.bitmap,u=0!==(c&l);if(!u&&i===St)return this;var d=Y(c&l-1),p=this.nodes,f=u?p[d]:null,h=V(f,e,t+bt,n,r,i,o,a);if(h===f)return this;if(!u&&h&&p.length>=ln)return q(e,p,c,s,h);if(u&&!h&&2===p.length&&B(p[1^d]))return p[1^d];if(u&&h&&1===p.length&&B(h))return h;var m=e&&e===this.ownerID,g=u?h?c:c^l:c|l,v=u?h?Q(p,d,h,m):Z(p,d,m):J(p,d,h,m);return m?(this.bitmap=g,this.nodes=v,this):new Jt(e,g,v)},iterate:function(e,t){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[t?i-r:r].iterate(e,t)===!1)return!1}},{});var Zt=function(e,t,n){this.ownerID=e,this.count=t,this.nodes=n},en=Zt;_t.createClass(Zt,{get:function(e,t,n,r){var i=(0===e?t:t>>>e)&wt,o=this.nodes[i];return o?o.get(e+bt,t,n,r):r},update:function(e,t,n,r,i,o,a){var s=(0===t?n:n>>>t)&wt,l=i===St,c=this.nodes,u=c[s];if(l&&!u)return this;var d=V(u,e,t+bt,n,r,i,o,a);if(d===u)return this;var p=this.count;if(u){if(!d&&(p--,cn>p))return H(e,c,p,s)}else p++;var f=e&&e===this.ownerID,h=Q(c,s,d,f);return f?(this.count=p,this.nodes=h,this):new en(e,p,h)},iterate:function(e,t){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var o=n[t?i-r:r];if(o&&o.iterate(e,t)===!1)return!1}}},{});var tn=function(e,t,n){this.ownerID=e,this.hash=t,this.entries=n},nn=tn;_t.createClass(tn,{get:function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;a>o;o++)if(P(n,i[o][0]))return i[o][1];return r},update:function(e,t,n,r,o,s,l){var c=o===St;if(n!==this.hash)return c?this:(i(l),i(s),W(this,e,t,n,[r,o]));for(var u=this.entries,d=0,p=u.length;p>d&&!P(r,u[d][0]);d++);var f=p>d;if(c&&!f)return this;if(i(l),(c||!f)&&i(s),c&&2===p)return new rn(e,this.hash,u[1^d]);var h=e&&e===this.ownerID,m=h?u:a(u);return f?c?d===p-1?m.pop():m[d]=m.pop():m[d]=[r,o]:m.push([r,o]),h?(this.entries=m,this):new nn(e,this.hash,m)},iterate:function(e,t){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(e(n[t?i-r:r])===!1)return!1}},{});var rn=function(e,t,n){this.ownerID=e,this.hash=t,this.entry=n},on=rn;_t.createClass(rn,{get:function(e,t,n,r){return P(n,this.entry[0])?this.entry[1]:r},update:function(e,t,n,r,o,a,s){var l=o===St,c=P(r,this.entry[0]);return(c?o===this.entry[1]:l)?this:(i(s),l?(i(a),null):c?e&&e===this.ownerID?(this.entry[1]=o,this):new on(e,n,[r,o]):(i(a),W(this,e,t,n,[r,o])))},iterate:function(e){return e(this.entry)}},{});var an=function(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$(e._root)};_t.createClass(an,{next:function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,i=t.index++;if(r.entry){if(0===i)return F(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return F(e,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return F(e,o.entry);t=this._stack=$(o,t)}continue}t=this._stack=this._stack.__prev}return l()}},{},qt);var sn,ln=Et/2,cn=Et/4,un=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dn.from(e)},dn=un;_t.createClass(un,{toString:function(){return this.__toString("Vector [","]")},get:function(e,t){if(e=ct(e,this._origin),e>=this._size)return t;var n=at(this,e),r=e&wt;return n&&(void 0===t||n.array.hasOwnProperty(r))?n.array[r]:t},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(e,t){return rt(this,e,t)},remove:function(e){return rt(this,e,St)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=bt,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):dn.empty()},push:function(){var e=arguments,t=this.length;return this.withMutations(function(n){st(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},pop:function(){return st(this,0,-1)},unshift:function(){var e=arguments;return this.withMutations(function(t){st(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},shift:function(){return st(this,1)},merge:function(){return lt(this,null,arguments)},mergeWith:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return lt(this,e,t)},mergeDeep:function(){return lt(this,G(null),arguments)},mergeDeepWith:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return lt(this,G(e),t)},setLength:function(e){return st(this,0,e)},slice:function(e,t,n){var r=_t.superCall(this,dn.prototype,"slice",[e,t,n]);if(!n&&r!==this){var i=this,o=i.length;r.toVector=function(){return st(i,0>e?Math.max(0,o+e):o?Math.min(o,e):e,null==t?o:0>t?Math.max(0,o+t):o?Math.min(o,t):t)}}return r},keys:function(e){return new mn(this,0,e)},values:function(e){return new mn(this,1,e)},entries:function(e){return new mn(this,2,e)},__iterator:function(e,t,n){return new mn(this,2,n,e,t)},__iterate:function(e,t,n){var r=this,i=0,o=r.length-1;n^=t;var a,s=function(t,a){return e(t,n?o-a:a,r)===!1?!1:(i=a,!0)},l=ut(this._size);return a=t?et(this._tail,0,l-this._origin,this._size-this._origin,s,t)&&et(this._root,this._level,-this._origin,l-this._origin,s,t):et(this._root,this._level,-this._origin,l-this._origin,s,t)&&et(this._tail,0,l-this._origin,this._size-this._origin,s,t),(a?o:t?o-i:i)+1},__deepEquals:function(e){var t=this.entries(!0);return e.every(function(e,n){var r=t.next().value;return r&&r[0]===n&&P(r[1],e)})},__ensureOwner:function(e){return e===this.__ownerID?this:e?nt(this._origin,this._size,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)}},{empty:function(){return gn||(gn=nt(0,0,bt))},from:function(e){if(!e||0===e.length)return dn.empty();if(e.constructor===dn)return e;var t=Array.isArray(e);return e.length>0&&e.length<Et?nt(0,e.length,bt,null,new fn(t?a(e):Ft(e).toArray())):(t||(e=Ft(e),e instanceof jt||(e=e.valueSeq())),dn.empty().merge(e))}},jt);var pn=un.prototype;pn[xt]=pn.remove,pn[Tt]=pn.values,pn.update=Yt.update,pn.updateIn=Yt.updateIn,pn.cursor=Yt.cursor,pn.withMutations=Yt.withMutations,pn.asMutable=Yt.asMutable,pn.asImmutable=Yt.asImmutable,pn.wasAltered=Yt.wasAltered;var fn=function(e,t){this.array=e,this.ownerID=t},hn=fn;_t.createClass(fn,{removeBefore:function(e,t,n){if(n===t?1<<t:0||0===this.array.length)return this;var r=n>>>t&wt;if(r>=this.array.length)return new hn([],e);var i,o=0===r;if(t>0){var a=this.array[r];if(i=a&&a.removeBefore(e,t-bt,n),i===a&&o)return this}if(o&&!i)return this;var s=ot(this,e);if(!o)for(var l=0;r>l;l++)delete s.array[l];return i&&(s.array[r]=i),s},removeAfter:function(e,t,n){if(n===t?1<<t:0||0===this.array.length)return this;
2var r=n-1>>>t&wt;if(r>=this.array.length)return this;var i,o=r===this.array.length-1;if(t>0){var a=this.array[r];if(i=a&&a.removeAfter(e,t-bt,n),i===a&&o)return this}if(o&&!i)return this;var s=ot(this,e);return o||(s.array.length=r+1),i&&(s.array[r]=i),s}},{});var mn=function(e,t,n,r,i){this._type=t,this._sparse=!!n,this._reverse=!!r,this._flipIndices=!!(i^r),this._maxIndex=e.length-1;var o=ut(e._size),a=tt(e._root&&e._root.array,e._level,-e._origin,o-e._origin-1),s=tt(e._tail&&e._tail.array,0,o-e._origin,e._size-e._origin-1);this._stack=r?s:a,this._stack.__prev=r?a:s};_t.createClass(mn,{next:function(){for(var e=this._sparse,t=this._stack;t;){var n=t.array,r=t.index++;if(this._reverse&&(r=wt-r,r>t.rawMax&&(r=t.rawMax,t.index=Et-r)),r>=0&&Et>r&&r<=t.rawMax){var i=n&&n[r];if(0===t.level){if(!e||null!=i||n&&r<n.length&&n.hasOwnProperty(r)){var o,a=this._type;return 1!==a&&(o=t.offset+(r<<t.level),this._flipIndices&&(o=this._maxIndex-o)),s(0===a?o:1===a?i:[o,i])}}else e&&null==i||(this._stack=t=tt(i&&i.array,t.level-bt,t.offset+(r<<t.level),t.max,t))}else t=this._stack=this._stack.__prev}return l()}},{},qt);var gn,vn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yn.from(e)},yn=vn;_t.createClass(vn,{toString:function(){return this.__toString("Set {","}")},has:function(e){return this._map.has(e)},get:function(e,t){return this.has(e)?e:t},add:function(e){var t=this._map.set(e,null);return this.__ownerID?(this.length=t.length,this._map=t,this):t===this._map?this:dt(t)},remove:function(e){var t=this._map.remove(e);return this.__ownerID?(this.length=t.length,this._map=t,this):t===this._map?this:0===t.length?yn.empty():dt(t)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):yn.empty()},union:function(){var e=arguments;return 0===e.length?this:this.withMutations(function(t){for(var n=0;n<e.length;n++)Ft(e[n]).forEach(function(e){return t.add(e)})})},intersect:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return this;e=e.map(function(e){return Ft(e)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.every(function(e){return e.contains(n)})||t.remove(n)})})},subtract:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return this;e=e.map(function(e){return Ft(e)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.some(function(e){return e.contains(n)})&&t.remove(n)})})},isSubset:function(e){return e=Ft(e),this.every(function(t){return e.contains(t)})},isSuperset:function(e){var t=this;return e=Ft(e),e.every(function(e){return t.contains(e)})},wasAltered:function(){return this._map.wasAltered()},values:function(){return this._map.keys()},entries:function(){return L(this.values(),function(e){return[e,e]})},hashCode:function(){return this._map.hashCode()},__iterate:function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},__deepEquals:function(e){return this.isSuperset(e)},__ensureOwner:function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?dt(t,e):(this.__ownerID=e,this._map=t,this)}},{empty:function(){return bn||(bn=dt(Kt.empty()))},from:function(e){var t=yn.empty();return e?e.constructor===yn?e:t.union(e):t},fromKeys:function(e){return yn.from(Ft(e).flip())}},Ft);var _n=vn.prototype;_n[xt]=_n.remove,_n[Tt]=_n.keys=_n.values,_n.contains=_n.has,_n.mergeDeep=_n.merge=_n.union,_n.mergeDeepWith=_n.mergeWith=function(){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return this.merge.apply(this,e)},_n.withMutations=Yt.withMutations,_n.asMutable=Yt.asMutable,_n.asImmutable=Yt.asImmutable,_n.__toJS=Bt.__toJS,_n.__toStringMapper=Bt.__toStringMapper;var bn,En=function(e){var t=wn.empty();return e?e.constructor===wn?e:t.merge(e):t},wn=En;_t.createClass(En,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(e,t){var n=this._map.get(e);return null!=n?this._vector.get(n)[1]:t},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):wn.empty()},set:function(e,t){return ft(this,e,t)},remove:function(e){return ft(this,e,St)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return L(this.entries(),function(e){return e[0]})},values:function(){return L(this.entries(),function(e){return e[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(e,t){return this._vector.fromEntrySeq().__iterate(e,t)},__deepEquals:function(e){var t=this.entries();return e.every(function(e,n){var r=t.next().value;return r&&P(r[0],n)&&P(r[1],e)})},__ensureOwner:function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._vector.__ensureOwner(e);return e?pt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._vector=n,this)}},{empty:function(){return Sn||(Sn=pt(Kt.empty(),un.empty()))}},Kt),En.from=En,En.prototype[xt]=En.prototype.remove;var Sn,Cn=function(e,t){var n=function(e){return this instanceof n?void(this._map=Kt(e)):new n(e)};e=Ft(e);var r=n.prototype=Object.create(kn);r.constructor=n,r._name=t,r._defaultValues=e;var i=Object.keys(e);return n.prototype.length=i.length,Object.defineProperty&&e.forEach(function(e,t){Object.defineProperty(n.prototype,t,{get:function(){return this.get(t)},set:function(e){c(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}),n},In=Cn;_t.createClass(Cn,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(e){return this._defaultValues.has(e)},get:function(e,t){return void 0===t||this.has(e)?this._map.get(e,this._defaultValues.get(e)):t},clear:function(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;return In._empty||(In._empty=ht(this,Kt.empty()))},set:function(e,t){if(null==e||!this.has(e))return this;var n=this._map.set(e,t);return this.__ownerID||n===this._map?this:ht(this,n)},remove:function(e){if(null==e||!this.has(e))return this;var t=this._map.remove(e);return this.__ownerID||t===this._map?this:ht(this,t)},keys:function(){return this._map.keys()},values:function(){return this._map.values()},entries:function(){return this._map.entries()},wasAltered:function(){return this._map.wasAltered()},__iterate:function(e,t){var n=this;return this._defaultValues.map(function(e,t){return n.get(t)}).__iterate(e,t)},__ensureOwner:function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?ht(this,t,e):(this.__ownerID=e,this._map=t,this)}},{},Ft);var kn=Cn.prototype;kn[xt]=kn.remove,kn[Tt]=Yt[Tt],kn.merge=Yt.merge,kn.mergeWith=Yt.mergeWith,kn.mergeDeep=Yt.mergeDeep,kn.mergeDeepWith=Yt.mergeDeepWith,kn.update=Yt.update,kn.updateIn=Yt.updateIn,kn.cursor=Yt.cursor,kn.withMutations=Yt.withMutations,kn.asMutable=Yt.asMutable,kn.asImmutable=Yt.asImmutable,kn.__deepEquals=Yt.__deepEquals;var xn=function(e,t,n){return this instanceof Tn?(c(0!==n,"Cannot step a Range by 0"),e=e||0,null==t&&(t=1/0),e===t&&Mn?Mn:(n=null==n?1:Math.abs(n),e>t&&(n=-n),this._start=e,this._end=t,this._step=n,void(this.length=Math.max(0,Math.ceil((t-e)/n-1)+1)))):new Tn(e,t,n)},Tn=xn;_t.createClass(xn,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(e){return c(e>=0,"Index out of bounds"),e<this.length},get:function(e,t){return c(e>=0,"Index out of bounds"),1/0===this.length||e<this.length?this._start+e*this._step:t},contains:function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.length&&t===Math.floor(t)},slice:function(e,t,n){return v(e,t,this.length)?this:n?_t.superCall(this,Tn.prototype,"slice",[e,t,n]):(e=y(e,this.length),t=_(t,this.length),e>=t?Mn:new Tn(this.get(e,this._end),this.get(t,this._end),this._step))},indexOf:function(e){var t=e-this._start;if(t%this._step===0){var n=t/this._step;if(n>=0&&n<this.length)return n}return-1},lastIndexOf:function(e){return this.indexOf(e)},take:function(e){return this.slice(0,e)},skip:function(e,t){return t?_t.superCall(this,Tn.prototype,"skip",[e]):this.slice(e)},__iterate:function(e,t,n){for(var r=t^n,i=this.length-1,o=this._step,a=t?this._start+i*o:this._start,s=0;i>=s&&e(a,r?i-s:s,this)!==!1;s++)a+=t?-o:o;return r?this.length:s},__deepEquals:function(e){return this._start===e._start&&this._end===e._end&&this._step===e._step}},{},jt);var Dn=xn.prototype;Dn.__toJS=Dn.toArray,Dn.first=pn.first,Dn.last=pn.last;var Mn=xn(0,0),On=function(e,t){return 0===t&&An?An:this instanceof Ln?(this._value=e,void(this.length=null==t?1/0:Math.max(0,t))):new Ln(e,t)},Ln=On;_t.createClass(On,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(e,t){return c(e>=0,"Index out of bounds"),1/0===this.length||e<this.length?this._value:t},first:function(){return this._value},contains:function(e){return P(this._value,e)},slice:function(e,t,n){if(n)return _t.superCall(this,Ln.prototype,"slice",[e,t,n]);var r=this.length;return e=0>e?Math.max(0,r+e):Math.min(r,e),t=null==t?r:t>0?Math.min(r,t):Math.max(0,r+t),t>e?new Ln(this._value,t-e):An},reverse:function(e){return e?_t.superCall(this,Ln.prototype,"reverse",[e]):this},indexOf:function(e){return P(this._value,e)?0:-1},lastIndexOf:function(e){return P(this._value,e)?this.length:-1},__iterate:function(e,t,n){var r=t^n;c(!r||this.length<1/0,"Cannot access end of infinite range.");for(var i=this.length-1,o=0;i>=o&&e(this._value,r?i-o:o,this)!==!1;o++);return r?this.length:o},__deepEquals:function(e){return P(this._value,e._value)}},{},jt);var Rn=On.prototype;Rn.last=Rn.first,Rn.has=Dn.has,Rn.take=Dn.take,Rn.skip=Dn.skip,Rn.__toJS=Dn.__toJS;var An=new On(void 0,0),Nn={Sequence:Ft,Map:Kt,Vector:un,Set:vn,OrderedMap:En,Record:Cn,Range:xn,Repeat:On,is:P,fromJS:mt};return Nn}require.config({paths:{text:"thirdparty/text/text",i18n:"thirdparty/i18n/i18n",fileSystemImpl:"filesystem/impls/appshell/AppshellFileSystem"}}),window.location.search.indexOf("testEnvironment")>-1&&require.config({paths:{"preferences/PreferencesImpl":"../test/TestPreferencesImpl"}}),require.config({locale:window.localStorage.getItem("locale")||("undefined"!=typeof brackets?brackets.app.language:navigator.language)}),define("main",["require"],function(e){e(["utils/Compatibility"],function(){e(["brackets"])})}),define("utils/Compatibility",[],function(){String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/,"")}),String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/,"")})}),!function(e){function t(){e(r).each(function(){n(e(this)).removeClass("open")})}function n(t){var n,r=t.attr("data-target");return r||(r=t.attr("href"),r=r&&/#/.test(r)&&r.replace(/.*(?=#[^\s]*$)/,"")),n=r&&e(r),n&&n.length||(n=t.parent()),n}var r="[data-toggle=dropdown]",i=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};i.prototype={constructor:i,toggle:function(){var r,i,o=e(this);if(!o.is(".disabled, :disabled"))return r=n(o),i=r.hasClass("open"),t(),i||r.toggleClass("open"),o.focus(),!1},keydown:function(t){var i,o,a,s,l;if(/(38|40|27)/.test(t.keyCode)&&(i=e(this),t.preventDefault(),t.stopPropagation(),!i.is(".disabled, :disabled"))){if(a=n(i),s=a.hasClass("open"),!s||s&&27==t.keyCode)return 27==t.which&&a.find(r).focus(),i.click();o=e("[role=menu] li:not(.divider):visible a",a),o.length&&(l=o.index(o.filter(":focus")),38==t.keyCode&&l>0&&l--,40==t.keyCode&&l<o.length-1&&l++,~l||(l=0),o.eq(l).focus())}}};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),r=n.data("dropdown");r||n.data("dropdown",r=new i(this)),"string"==typeof t&&r[t].call(n)})},e.fn.dropdown.Constructor=i,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.dropdown.data-api",t).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api",r,i.prototype.toggle).on("keydown.dropdown.data-api",r+", [role=menu]",i.prototype.keydown)}(window.jQuery),define("widgets/bootstrap-dropdown",function(){}),!function(e){var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(this.options.selector),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")}))},hide:function(t){t&&t.preventDefault();t=e.Event("hide"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]===e.target||t.$element.has(e.target).length||t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var r=e.support.transition&&n;if(this.$backdrop=e('<div class="modal-backdrop '+n+'" />').appendTo(this.options.selector),this.$backdrop.click("static"==this.options.backdrop?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;r?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),o=e.extend({},e.fn.modal.defaults,r.data(),"object"==typeof n&&n);i||r.data("modal",i=new t(this,o)),"string"==typeof n?i[n]():o.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0,selector:"body"},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),o=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(o).one("hide",function(){n.focus()})})}(window.jQuery),define("widgets/bootstrap-modal",function(){}),!function(e){"use strict";function t(e,t,n){return"function"==typeof e?e.apply(t,n):e}var n;e(window).focus(function(){n=!0}).blur(function(){n=!1});var r;e(document).ready(function(){e.support.transition=function(){var e=function(){var e,t=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};for(e in n)if(void 0!==t.style[e])return n[e]}();return e&&{end:e}}(),e.support.transition&&(r=e.support.transition.end)});var i=function(t,n){this.$element=e(t),this.options=n,this.enabled=!0,this.autoHideTimeout=null,this.fixTitle()};i.prototype={show:function(){var t,r=this;if(this.hasContent()&&this.enabled){if(t=this.tip(),this.setContent(),this.options.animate&&t.addClass("fade"),t.remove().css({top:0,left:0,display:"block"}).prependTo(document.body),this.updatePosition(),e(window).off("resize",this.resizeHandler),this.resizeHandler=function(){r.updatePosition()},e(window).on("resize",this.resizeHandler),this.options.autoHideDelay){var i=function(){window.clearTimeout(r.autoHideTimeout),r.autoHideTimeout=window.setTimeout(function(){r.hide()},r.options.autoHideDelay)};n?i():e(window).one("focus",i)}t.addClass("in")}},updatePosition:function(){var n,r,i,o,a,s,l,c,u,d,p;switch(u=this.tip(),n=e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),o=parseInt(this.$element.css("padding-left"),10),a=parseInt(this.$element.css("padding-right"),10),n.left+=o,n.width-=o+a,r=u[0].offsetWidth,i=u[0].offsetHeight,c=t(this.options.placement,this,[u[0],this.$element[0]]),u.addClass(c),c){case"below":p={top:n.top+n.height+this.options.offset,left:n.left+n.width/2-r/2};break;case"above":p={top:n.top-i-this.options.offset,left:n.left+n.width/2-r/2};break;case"left":p={top:n.top+n.height+20-i,left:n.left-r-this.options.offset};break;case"right":p={top:n.top+n.height+20-i,left:n.left+n.width+this.options.offset}}l=0,s=p.left+r-e(document.body).width(),s>0?(l=s,p.left-=s):p.left<0&&(l=p.left,p.left=0),s>0&&(d=u.find(".tooltip-arrow"),this.defaultMargin||(this.defaultMargin=parseInt(d.css("margin-left"),10)),d.css("margin-left",this.defaultMargin+l)),u.css(p)},setContent:function(){var e=this.tip();e.find(".tooltip-inner")[this.options.html?"html":"text"](this.getTitle()),e[0].className="tooltip"},hide:function(){function t(){n.remove()}var n=this.tip();n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?n.bind(r,t):t(),window.clearTimeout(this.autoHideTimeout),e(window).off("resize",this.resizeHandler)},fixTitle:function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getTitle:function(){var e,t=this.$element,n=this.options;return this.fixTitle(),"string"==typeof n.title?e=t.attr("title"==n.title?"data-original-title":n.title):"function"==typeof n.title&&(e=n.title.call(t[0])),e=(""+e).replace(/(^\s*|\s*$)/,""),e||n.fallback},tip:function(){return this.$tip=this.$tip||e('<div class="tooltip" />').html(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},e.fn.twipsy=function(t){return e.fn.twipsy.initWith.call(this,t,i,"twipsy"),this},e.fn.twipsy.initWith=function(t,n,r){function i(i){var o=e.data(i,r);return o||(o=new n(i,e.fn.twipsy.elementOptions(i,t)),e.data(i,r,o)),o}function o(){var e=i(this);e.hoverState="in",0==t.delayIn?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},t.delayIn))}function a(){var e=i(this);e.hoverState="out",0==t.delayOut?e.hide():setTimeout(function(){"out"==e.hoverState&&e.hide()},t.delayOut)}var s,l,c,u;return t===!0?this.data(r):"string"==typeof t?(s=this.data(r),s&&s[t](),this):(t=e.extend({},e.fn[r].defaults,t),t.live||this.each(function(){i(this)}),"manual"!=t.trigger&&(l=t.live?"live":"bind",c="hover"==t.trigger?"mouseenter":"focus",u="hover"==t.trigger?"mouseleave":"blur",this[l](c,o)[l](u,a)),this)},e.fn.twipsy.Twipsy=i,e.fn.twipsy.defaults={animate:!0,delayIn:0,delayOut:0,fallback:"",placement:"above",html:!1,live:!1,offset:0,title:"title",trigger:"hover",template:'<div class="tooltip-arrow"></div><div class="tooltip-inner"></div>'},e.fn.twipsy.rejectAttrOptions=["title"],e.fn.twipsy.elementOptions=function(t,n){for(var r=e(t).data(),i=e.fn.twipsy.rejectAttrOptions,o=i.length;o--;)delete r[i[o]];return e.extend({},n,r)}}(window.jQuery||window.ender),define("widgets/bootstrap-twipsy-mod",function(){}),function(e){function t(e){return function(t){return i.parseUrl(t)[e]}}var n,r,i={urlParseRE:/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#\.]*(?:\.[^\?#\.]+)*(\.[^\?#\.]+)|[^\?#]*)))?(\?[^#]+)?)(#.*)?/,parsedUrlPropNames:"href,hrefNoHash,hrefNoSearch,domain,protocol,doubleSlash,authority,userinfo,username,password,host,hostname,port,pathname,directory,filename,filenameExtension,search,hash".split(","),defaultPorts:{http:"80",https:"443",ftp:"20",ftps:"990"},parseUrl:function(e){if(e&&"object"==typeof e)return e;var t,e=i.urlParseRE.exec(e||"")||[],n=i.parsedUrlPropNames,r=n.length,o={};for(t=0;r>t;t++)o[n[t]]=e[t]||"";return o},port:function(e){return e=i.parseUrl(e),e.port||i.defaultPorts[e.protocol]},isSameDomain:function(e,t){return i.parseUrl(e).domain===i.parseUrl(t).domain},isRelativeUrl:function(e){return""===i.parseUrl(e).protocol},isAbsoluteUrl:function(e){return""!==i.parseUrl(e).protocol},makePathAbsolute:function(e,t){if(e&&"/"===e.charAt(0))return e;for(var e=e||"",n=(t=t?t.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"")?t.split("/"):[],r=e.split("/"),i=0;i<r.length;i++){var o=r[i];switch(o){case".":break;case"..":n.length&&n.pop();break;default:n.push(o)}}return"/"+n.join("/")},makePathRelative:function(e,t){for(var t=t?t.replace(/^\/|\/?[^\/]*$/g,""):"",e=e?e.replace(/^\//,""):"",n=t?t.split("/"):[],r=e.split("/"),i=[],o=n.length,a=!1,s=0;o>s;s++)(a=a||r[0]!==n[s])?i.push(".."):r.shift();return i.concat(r).join("/")},makeUrlAbsolute:function(e,t){if(!i.isRelativeUrl(e))return e;var n=i.parseUrl(e),r=i.parseUrl(t),o=n.protocol||r.protocol,a=n.protocol?n.doubleSlash:n.doubleSlash||r.doubleSlash,s=n.authority||r.authority,l=""!==n.pathname,c=i.makePathAbsolute(n.pathname||r.filename,r.pathname);return o+a+s+c+(n.search||!l&&r.search||"")+n.hash}},o=i.parsedUrlPropNames,a=o.length;for(n=0;a>n;n++)r=o[n],i[r]||(i[r]=t(r));e.PathUtils=i}(window),define("thirdparty/path-utils/path-utils.min",function(){}),function(e){e.fn.smartAutoComplete=function(){if(arguments.length<1){var t=this[0];return e(t).data("smart-autocomplete")}var n=function(t,n){var r=new RegExp(t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i");return e.grep(n,function(e){return r.test(e)})},r={minCharLimit:1,maxCharLimit:null,maxResults:null,delay:0,disabled:!1,forceSelect:!1,typeAhead:!1,resultElement:"li",resultFormatter:function(e){return"<li>"+e+"</li>"},filter:function(t,r){{var i=this;e(i).data("smart-autocomplete")}if("array"===e.type(r)){var o=n(t,r,i);return o}return"string"===e.type(r)?e.Deferred(function(o){e.ajax({url:r,data:{term:t},dataType:"json"}).done(function(e){o.resolve(n(t,e,i))})}).promise():void 0},alignResultsContainer:!1,clearResults:function(){var t=e(this.context).prev(".smart_autocomplete_type_ahead_field");e(this.context).css({background:t.css("background")}),t.remove(),e(this.resultsContainer).html("")},setCurrentSelectionToContext:function(){this.rawResults.length>0&&this.currentSelection>=0&&e(this.context).val(this.rawResults[this.currentSelection])},setItemSelected:function(e){this.itemSelected=e},autocompleteFocused:!1,setAutocompleteFocused:function(e){this.autocompleteFocused=e}};e.event.special.keyIn={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete"),i=(r.source||null,r.filter),o=r.maxCharLimit>0?r.maxCharLimit:Number.POSITIVE_INFINITY,a=t.smartAutocompleteData.query;return r.disabled||a.length>o?(e(n).trigger("lostFocus"),!1):(r.setItemSelected(!1),r.setAutocompleteFocused(!0),void setTimeout(function(){e.when(i.apply(r,[a,r.source])).done(function(t){var i=r.maxResults>0?t.splice(0,r.maxResults):t;e(n).trigger("resultsReady",[i])})},r.delay))}},e.event.special.resultsReady={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete"),i=t.smartAutocompleteData.results;if(r.disabled)return!1;if(e(n).smartAutoComplete().clearResults(),r.rawResults=i,i.length<1)return e(n).trigger("noResults"),!1;var o=e.map(i,function(e){return r.resultFormatter.apply(r,[e])}),a=o.join("");r.resultsContainer&&e(r.resultsContainer).append(a),e(n).trigger("showResults",[i])}},e.event.special.showResults={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete"),i=e(r.resultsContainer),o=t.smartAutocompleteData.results;if(r.typeAhead&&o[0].substr(0,e(n).val().length)==e(n).val()){var a=o[0];e(n).before("<input class='smart_autocomplete_type_ahead_field' type='text' autocomplete='off' disabled='disabled' value='"+a+"'/>"),e(n).css({position:"relative",zIndex:2,background:"transparent"});var s=e(n).prev("input");s.css({position:"absolute",zIndex:1,overflow:"hidden",background:e(n).css("background"),borderColor:"transparent",width:e(n).width(),color:"silver"}),r.currentSelection=0,i&&e(n).trigger("itemFocus",i.children()[r.currentSelection])}i&&(r.alignResultsContainer&&i.css({position:"absolute",top:function(){return e(n).offset().top+e(n).height()},left:function(){return e(n).offset().left},width:function(){return e(n).width()},zIndex:1e3}),i.show())}},e.event.special.noResults={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete"),i=e(r.resultsContainer);i&&r.clearResults()}},e.event.special.itemSelect={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete"),i=t.smartAutocompleteData.item,o=e(i).text()||e(i).val();e(n).val(o),r.setItemSelected(!0),r.originalCharCount=e(n).val().length,e(n).trigger("lostFocus")}},e.event.special.itemFocus={setup:function(){return!1},_default:function(t){var n=t.smartAutocompleteData.item;e(n).addClass("smart_autocomplete_highlight")}},e.event.special.itemUnfocus={setup:function(){return!1},_default:function(t){var n=t.smartAutocompleteData.item;e(n).removeClass("smart_autocomplete_highlight")}},e.event.special.lostFocus={setup:function(){return!1},_default:function(t){var n=t.target,r=e(n).data("smart-autocomplete");r.forceSelect&&!r.itemSelected&&e(r.context).val(""),r.setAutocompleteFocused(!1),r.clearResults(),r.resultsContainer&&e(r.resultsContainer).hide(),r.currentSelection=null}};var i=arguments[0];return this.each(function(){var t=e.extend(r,e(this).data("smart-autocomplete"),i);if(t.context=this,"undefined"===e.type(t.resultsContainer)){var n=e("<ul class='smart_autocomplete_container' style='display:none'></ul>");n.appendTo("body"),t.resultsContainer=n,t.alignResultsContainer=!0}e(this).data("smart-autocomplete",t),e(this).on("keyup",function(t){var n=e(this).data("smart-autocomplete");if(38===t.keyCode){if(n.resultsContainer){var r=n.currentSelection||0,i=e(n.resultsContainer).children();r>0?(e(n.context).trigger("itemUnfocus",i[r]),r--):0>r-1&&(e(n.context).trigger("itemUnfocus",i[r]),r=i.length-1),n.currentSelection=r,e(n.context).trigger("itemFocus",[i[r]])}}else if(40===t.keyCode)if(n.resultsContainer&&n.resultsContainer.is(":visible")){var r=n.currentSelection,i=e(n.resultsContainer).children();r>=0&&e(n.context).trigger("itemUnfocus",i[r]),(isNaN(r)||null==r||++r>=i.length)&&(r=0),n.currentSelection=r,e(n.context).trigger("itemFocus",[i[r]])}else e(n.context).trigger("keyIn",[e(this).val()]);else{if(39===t.keyCode||13===t.keyCode){var o=e(n.context).prev(".smart_autocomplete_type_ahead_field");if(n.resultsContainer&&e(n.resultsContainer).is(":visible")){var r=n.currentSelection,i=e(n.resultsContainer).children();e(n.context).trigger("itemSelect",[i[r]])}else n.typeAhead&&o.is(":visible")&&e(n.context).trigger("itemSelect",[o]);return!1}if(255!==t.keyCode){var a=e(n.context).val().length;if(n.originalCharCount==a)return;a>=n.minCharLimit?e(n.context).trigger("keyIn",[e(this).val()]):n.autocompleteFocused&&(n.currentSelection=null,e(n.context).trigger("lostFocus"))}}}),e(this).focus(function(){e(this).closest("form").bind("keydown.block_for_smart_autocomplete",function(n){var r=e(t.context).prev(".smart_autocomplete_type_ahead_field");if(13===n.keyCode){if(t.resultsContainer&&e(t.resultsContainer).is(":visible")){var i=t.currentSelection,o=e(t.resultsContainer).children();return e(t.context).trigger("itemSelect",[o[i]]),!1}if(t.typeAhead&&r.is(":visible"))return e(t.context).trigger("itemSelect",[r]),!1}}),t.forceSelect&&e(this).select()}),e(document).bind("focusin click",function(n){if(t.autocompleteFocused){var r=e.contains(t.resultsContainer[0],n.target);if(n.target==t.resultsContainer[0]||n.target==t.context||r)return;e(t.context).closest("form").unbind("keydown.block_for_smart_autocomplete"),e(t.context).trigger("lostFocus")}}),e(t.resultsContainer).delegate(t.resultElement,"mousedown.smart_autocomplete",function(){return e(t.context).trigger("itemSelect",[this]),!1}),e(this).bind({keyIn:function(e,t){e.smartAutocompleteData={query:t}},resultsReady:function(e,t){e.smartAutocompleteData={results:t}},showResults:function(e,t){e.smartAutocompleteData={results:t}},noResults:function(){},lostFocus:function(){},itemSelect:function(e,t){e.smartAutocompleteData={item:t}},itemFocus:function(e,t){e.smartAutocompleteData={item:t}},itemUnfocus:function(e,t){e.smartAutocompleteData={item:t}}})})}}(jQuery),define("thirdparty/smart-auto-complete-local/jquery.smart_autocomplete",function(){}),function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define("thirdparty/CodeMirror2/lib/codemirror",[],e);this.CodeMirror=e()}}(function(){function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?go(r):{},go(Ra,r,!1),h(r);var i=r.value;"string"==typeof i&&(i=new rs(i,r.mode)),this.doc=i;var o=this.display=new t(n,i);o.wrapper.CodeMirror=this,u(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!ua&&kn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new lo},Zo&&11>ea&&setTimeout(vo(In,this,!0),20),Dn(this),Oo();var a=this;cn(this,function(){a.curOp.forceUpdate=!0,Di(a,i),r.autofocus&&!ua||Io()==o.input?setTimeout(vo(Jn,a),20):Zn(a);for(var e in Aa)Aa.hasOwnProperty(e)&&Aa[e](a,r[e],Na);b(a);for(var t=0;t<Ua.length;++t)Ua[t](a)})}function t(e,t){var n=this,r=n.input=Eo("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");ta?r.style.width="1000px":r.setAttribute("wrap","off"),ca&&(r.style.border="1px solid black"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","off"),r.setAttribute("spellcheck","false"),n.inputDiv=Eo("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),n.scrollbarH=Eo("div",[Eo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),n.scrollbarV=Eo("div",[Eo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n.scrollbarFiller=Eo("div",null,"CodeMirror-scrollbar-filler"),n.gutterFiller=Eo("div",null,"CodeMirror-gutter-filler"),n.lineDiv=Eo("div",null,"CodeMirror-code"),n.selectionDiv=Eo("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Eo("div",null,"CodeMirror-cursors"),n.measure=Eo("div",null,"CodeMirror-measure"),n.lineMeasure=Eo("div",null,"CodeMirror-measure"),n.lineSpace=Eo("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Eo("div",[Eo("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Eo("div",[n.mover],"CodeMirror-sizer"),n.heightForcer=Eo("div",null,null,"position: absolute; height: "+fs+"px; width: 1px;"),n.gutters=Eo("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Eo("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Eo("div",[n.inputDiv,n.scrollbarH,n.scrollbarV,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),Zo&&8>ea&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),ca&&(r.style.width="0px"),ta||(n.scroller.draggable=!0),aa&&(n.inputDiv.style.height="1px",n.inputDiv.style.position="absolute"),Zo&&8>ea&&(n.scrollbarH.style.minHeight=n.scrollbarV.style.minWidth="18px"),e.appendChild?e.appendChild(n.wrapper):e(n.wrapper),n.viewFrom=n.viewTo=t.first,n.view=[],n.externalMeasured=null,n.viewOffset=0,n.lastSizeC=0,n.updateLineNumbers=null,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.prevInput="",n.alignWidgets=!1,n.pollingFast=!1,n.poll=new lo,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.inaccurateSelection=!1,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null
3}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,wt(e,100),e.state.modeGen++,e.curOp&&mn(e)}function i(e){e.options.lineWrapping?(To(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth=""):(xo(e.display.wrapper,"CodeMirror-wrap"),f(e)),a(e),mn(e),jt(e),setTimeout(function(){v(e)},100)}function o(e){var t=Qt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Jt(e.display)-3);return function(i){if(ni(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&Ri(e,t)})}function s(e){var t=Ha[e.options.keyMap],n=t.style;e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(n?" cm-keymap-"+n:"")}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jt(e)}function c(e){u(e),mn(e),setTimeout(function(){_(e)},20)}function u(e){var t=e.display.gutters,n=e.options.gutters;wo(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(Eo("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",d(e)}function d(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px",e.display.scrollbarH.style.left=e.options.fixedGutter?t+"px":0}function p(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Xr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Yr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function f(e){var t=e.display,n=e.doc;t.maxLine=Mi(n,n.first),t.maxLineLength=p(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=p(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function h(e){var t=fo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function m(e){return e.display.scroller.clientHeight-e.display.wrapper.clientHeight<fs-3}function g(e){var t=e.display.scroller;return{clientHeight:t.clientHeight,barHeight:e.display.scrollbarV.clientHeight,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth,hScrollbarTakesSpace:m(e),barWidth:e.display.scrollbarH.clientWidth,docHeight:Math.round(e.doc.height+xt(e.display))}}function v(e,t){t||(t=g(e));var n=e.display,r=Ro(n.measure),i=t.docHeight+fs,o=t.scrollWidth>t.clientWidth;o&&t.scrollWidth<=t.clientWidth+1&&r>0&&!t.hScrollbarTakesSpace&&(o=!1);var a=i>t.clientHeight;if(a?(n.scrollbarV.style.display="block",n.scrollbarV.style.bottom=o?r+"px":"0",n.scrollbarV.firstChild.style.height=Math.max(0,i-t.clientHeight+(t.barHeight||n.scrollbarV.clientHeight))+"px"):(n.scrollbarV.style.display="",n.scrollbarV.firstChild.style.height="0"),o?(n.scrollbarH.style.display="block",n.scrollbarH.style.right=a?r+"px":"0",n.scrollbarH.firstChild.style.width=t.scrollWidth-t.clientWidth+(t.barWidth||n.scrollbarH.clientWidth)+"px"):(n.scrollbarH.style.display="",n.scrollbarH.firstChild.style.width="0"),o&&a?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=n.scrollbarFiller.style.width=r+"px"):n.scrollbarFiller.style.display="",o&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r+"px",n.gutterFiller.style.width=n.gutters.offsetWidth+"px"):n.gutterFiller.style.display="",!e.state.checkedOverlayScrollbar&&t.clientHeight>0){if(0===r){var s=da&&!sa?"12px":"18px";n.scrollbarV.style.minWidth=n.scrollbarH.style.minHeight=s;var l=function(t){eo(t)!=n.scrollbarV&&eo(t)!=n.scrollbarH&&un(e,Rn)(t)};cs(n.scrollbarV,"mousedown",l),cs(n.scrollbarH,"mousedown",l)}e.state.checkedOverlayScrollbar=!0}}function y(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-kt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Ni(t,r),a=Ni(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s)return{from:s,to:Ni(t,Pi(Mi(t,s))+e.wrapper.clientHeight)};if(Math.min(l,t.lastLine())>=a)return{from:Ni(t,Pi(Mi(t,l))-e.wrapper.clientHeight),to:l}}return{from:o,to:Math.max(a,o+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=w(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function b(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=E(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Eo("div",[Eo("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a),r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",d(e),!0}return!1}function E(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function w(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var r=e.display;this.viewport=t,this.visible=y(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.oldViewFrom=r.viewFrom,this.oldViewTo=r.viewTo,this.oldScrollerWidth=r.scroller.clientWidth,this.force=n,this.dims=O(e)}function C(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return vn(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&0==En(e))return!1;b(e)&&(vn(e),t.dims=O(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),va&&(o=ei(e.doc,o),a=ti(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastSizeC!=t.wrapperHeight;bn(e,o,a),n.viewOffset=Pi(Mi(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=En(e);if(!s&&0==l&&!t.force&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Io();return l>4&&(n.lineDiv.style.display="none"),L(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),c&&Io()!=c&&c.offsetHeight&&c.focus(),wo(n.cursorDiv),wo(n.selectionDiv),s&&(n.lastSizeC=t.wrapperHeight,wt(e,400)),n.updateLineNumbers=null,!0}function I(e,t){for(var n=t.force,r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldScrollerWidth!=e.display.scroller.clientWidth)n=!0;else if(n=!1,r&&null!=r.top&&(r={top:Math.min(e.doc.height+xt(e.display)-fs-e.display.scroller.clientHeight,r.top)}),t.visible=y(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!C(e,t))break;D(e);var o=g(e);yt(e),x(e,o),v(e,o)}no(e,"update",e),(e.display.viewFrom!=t.oldViewFrom||e.display.viewTo!=t.oldViewTo)&&no(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo)}function k(e,t){var n=new S(e,t);if(C(e,n)){D(e),I(e,n);var r=g(e);yt(e),x(e,r),v(e,r)}}function x(e,t){e.display.sizer.style.minHeight=e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight,t.clientHeight-fs)+"px"}function T(e,t){e.display.sizer.offsetWidth+e.display.gutters.offsetWidth<e.display.scroller.clientWidth-1&&(e.display.sizer.style.minHeight=e.display.heightForcer.style.top="0px",e.display.gutters.style.height=t.docHeight+"px")}function D(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(Zo&&8>ea){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;if(2>i&&(i=Qt(t)),(l>.001||-.001>l)&&(Ri(o.line,i),M(o.line),o.rest))for(var c=0;c<o.rest.length;c++)M(o.rest[c])}}}function M(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function O(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:w(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function L(e,t,n){function r(t){var n=t.nextSibling;return ta&&da&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,s=a.firstChild,l=i.view,c=i.viewFrom,u=0;u<l.length;u++){var d=l[u];if(d.hidden);else if(d.node){for(;s!=d.node;)s=r(s);var p=o&&null!=t&&c>=t&&d.lineNumber;d.changes&&(fo(d.changes,"gutter")>-1&&(p=!1),R(e,d,c,n)),p&&(wo(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(E(e.options,c)))),s=d.node.nextSibling}else{var f=V(e,d,c,n);a.insertBefore(f,s)}c+=d.size}for(;s;)s=r(s)}function R(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?F(e,t):"gutter"==o?U(e,t,n,r):"class"==o?$(t):"widget"==o&&j(t,r)}t.changes=null}function A(e){return e.node==e.text&&(e.node=Eo("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Zo&&8>ea&&(e.node.style.zIndex=2)),e.node}function N(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=A(e);e.background=n.insertBefore(Eo("div",null,t),n.firstChild)}}function P(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):vi(e,t)}function F(e,t){var n=t.text.className,r=P(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,$(t)):n&&(t.text.className=n)}function $(e){N(e),e.line.wrapClass?A(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function U(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=A(t),a=t.gutter=o.insertBefore(Eo("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px"),t.text);if(!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Eo("div",E(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s<e.options.gutters.length;++s){var l=e.options.gutters[s],c=i.hasOwnProperty(l)&&i[l];c&&a.appendChild(Eo("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function j(e,t){e.alignable&&(e.alignable=null);for(var n,r=e.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&e.node.removeChild(r)}B(e,t)}function V(e,t,n,r){var i=P(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),$(t),U(e,t,n,r),B(t,r),t.node}function B(e,t){if(W(e.line,e,t,!0),e.rest)for(var n=0;n<e.rest.length;n++)W(e.rest[n],e,t,!1)}function W(e,t,n,r){if(e.widgets)for(var i=A(t),o=0,a=e.widgets;o<a.length;++o){var s=a[o],l=Eo("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(l.ignoreEvents=!0),H(s,l,t,n),r&&s.above?i.insertBefore(l,t.gutter||t.text):i.appendChild(l),no(s,"redraw")}}function H(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function q(e){return ya(e.line,e.ch)}function z(e,t){return _a(e,t)<0?t:e}function G(e,t){return _a(e,t)<0?e:t}function K(e,t){this.ranges=e,this.primIndex=t}function X(e,t){this.anchor=e,this.head=t}function Y(e,t){var n=e[t];e.sort(function(e,t){return _a(e.from(),t.from())}),t=fo(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(_a(o.to(),i.from())>=0){var a=G(o.from(),i.from()),s=z(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new X(l?s:a,l?a:s))}}return new K(e,t)}function Q(e,t){return new K([new X(e,t||e)],0)}function J(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Z(e,t){if(t.line<e.first)return ya(e.first,0);var n=e.first+e.size-1;return t.line>n?ya(n,Mi(e,n).text.length):et(t,Mi(e,t.line).text.length)}function et(e,t){var n=e.ch;return null==n||n>t?ya(e.line,t):0>n?ya(e.line,0):e}function tt(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Z(e,t[r]);return n}function rt(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=_a(n,i)<0;o!=_a(r,i)<0?(i=n,n=r):o!=_a(n,r)<0&&(n=r)}return new X(i,n)}return new X(r||n,n)}function it(e,t,n,r){ut(e,new K([rt(e,e.sel.primary(),t,n)],0),r)}function ot(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=rt(e,e.sel.ranges[i],t[i],null);var o=Y(r,e.sel.primIndex);ut(e,o,n)}function at(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,ut(e,Y(i,e.sel.primIndex),r)}function st(e,t,n,r){ut(e,Q(t,n),r)}function lt(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new X(Z(e,t[n].anchor),Z(e,t[n].head))}};return ds(e,"beforeSelectionChange",e,n),e.cm&&ds(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Y(n.ranges,n.ranges.length-1):t}function ct(e,t,n){var r=e.history.done,i=po(r);i&&i.ranges?(r[r.length-1]=t,dt(e,t,n)):ut(e,t,n)}function ut(e,t,n){dt(e,t,n),Hi(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function dt(e,t,n){(ao(e,"beforeSelectionChange")||e.cm&&ao(e.cm,"beforeSelectionChange"))&&(t=lt(e,t));var r=n&&n.bias||(_a(t.primary().head,e.sel.primary().head)<0?-1:1);pt(e,ht(e,t,r,!0)),n&&n.scroll===!1||!e.cm||_r(e.cm)}function pt(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,oo(e.cm)),no(e,"cursorActivity",e))}function ft(e){pt(e,ht(e,e.sel,null,!1),ms)}function ht(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=mt(e,a.anchor,n,r),l=mt(e,a.head,n,r);(i||s!=a.anchor||l!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new X(s,l))}return i?Y(i,t.primIndex):t}function mt(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var s=Mi(e,o.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var c=s.markedSpans[l],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from<o.ch))&&(null==c.to||(u.inclusiveRight?c.to>=o.ch:c.to>o.ch))){if(r&&(ds(u,"beforeCursorEnter"),u.explicitlyCleared)){if(s.markedSpans){--l;continue}break}if(!u.atomic)continue;var d=u.find(0>a?-1:1);if(0==_a(d,o)&&(d.ch+=a,d.ch<0?d=d.line>e.first?Z(e,ya(d.line-1)):null:d.ch>s.text.length&&(d=d.line<e.first+e.size-1?ya(d.line+1,0):null),!d)){if(i)return r?(e.cantEdit=!0,ya(e.first,0)):mt(e,t,n,!0);i=!0,d=t,a=-a}o=d;continue e}}return o}}function gt(e){for(var t=e.display,n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){var s=n.sel.ranges[a],l=s.empty();(l||e.options.showCursorWhenSelecting)&&_t(e,s,i),l||bt(e,s,o)}if(e.options.moveInputWithCursor){var c=zt(e,n.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+d.top-u.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+d.left-u.left))}return r}function vt(e,t){So(e.display.cursorDiv,t.cursors),So(e.display.selectionDiv,t.selection),null!=t.teTop&&(e.display.inputDiv.style.top=t.teTop+"px",e.display.inputDiv.style.left=t.teLeft+"px")}function yt(e){vt(e,gt(e))}function _t(e,t,n){var r=zt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Eo("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(Eo("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function bt(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(Eo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return qt(e,ya(t,n),"div",d,r)}var s,l,d=Mi(a,t),p=d.text.length;return Fo(Fi(d),n||0,null==i?p:i,function(e,t,a){var d,f,h,m=o(e,"left");if(e==t)d=m,f=h=m.left;else{if(d=o(t-1,"right"),"rtl"==a){var g=m;m=d,d=g}f=m.left,h=d.right}null==n&&0==e&&(f=c),d.top-m.top>3&&(r(f,m.top,null,m.bottom),f=c,m.bottom<d.top&&r(f,m.bottom,null,d.top)),null==i&&t==p&&(h=u),(!s||m.top<s.top||m.top==s.top&&m.left<s.left)&&(s=m),(!l||d.bottom>l.bottom||d.bottom==l.bottom&&d.right>l.right)&&(l=d),c+1>f&&(f=c),r(f,d.top,h-f,d.bottom)}),{start:s,end:l}}var o=e.display,a=e.doc,s=document.createDocumentFragment(),l=Tt(e.display),c=l.left,u=o.lineSpace.offsetWidth-l.right,d=t.from(),p=t.to();if(d.line==p.line)i(d.line,d.ch,p.ch);else{var f=Mi(a,d.line),h=Mi(a,p.line),m=Jr(f)==Jr(h),g=i(d.line,d.ch,m?f.text.length+1:null).end,v=i(p.line,m?0:null,p.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(s)}function Et(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(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wt(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,vo(St,e))}function St(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Va(t.mode,It(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=fi(e,o,r,!0);o.styles=s.styles;var l=o.styleClasses,c=s.classes;c?o.styleClasses=c:l&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!u&&d<a.length;++d)u=a[d]!=o.styles[d];u&&i.push(t.frontier),o.stateAfter=Va(t.mode,r)}else mi(e,o.text,r),o.stateAfter=t.frontier%5==0?Va(t.mode,r):null;return++t.frontier,+new Date>n?(wt(e,e.options.workDelay),!0):void 0}),i.length&&cn(e,function(){for(var t=0;t<i.length;t++)gn(e,i[t],"text")})}}function Ct(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Mi(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var c=ys(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function It(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=Ct(e,t,n),a=o>r.first&&Mi(r,o-1).stateAfter;return a=a?Va(r.mode,a):Ba(r.mode),r.iter(o,t,function(n){mi(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?Va(r.mode,a):null,++o}),n&&(r.frontier=o),a}function kt(e){return e.lineSpace.offsetTop}function xt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Tt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=So(e.measure,Eo("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Dt(e,t,n){var r=e.options.lineWrapping,i=r&&e.display.scroller.clientWidth;if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Mt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(Ai(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ot(e,t){t=Jr(t);var n=Ai(t),r=e.display.externalMeasured=new fn(e.doc,t,n);r.lineN=n;var i=r.built=vi(e,r);return r.text=i.pre,So(e.display.lineMeasure,i.pre),r}function Lt(e,t,n,r){return Nt(e,At(e,t),n,r)}function Rt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[yn(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function At(e,t){var n=Ai(t),r=Rt(e,n);r&&!r.text?r=null:r&&r.changes&&R(e,r,n,O(e)),r||(r=Ot(e,t));var i=Mt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Nt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Dt(e,t.view,t.rect),t.hasHeights=!0),o=Pt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Pt(e,t,n,r){for(var i,o,a,s,l=t.map,c=0;c<l.length;c+=3){var u=l[c],d=l[c+1];if(u>n?(o=0,a=1,s="left"):d>n?(o=n-u,a=o+1):(c==l.length-3||n==d&&l[c+3]>n)&&(a=d-u,o=a-1,n>=d&&(s="right")),null!=o){if(i=l[c+2],u==d&&r==(i.insertLeft?"left":"right")&&(s=r),"left"==r&&0==o)for(;c&&l[c-2]==l[c-3]&&l[c-1].insertLeft;)i=l[(c-=3)+2],s="left";if("right"==r&&o==d-u)for(;c<l.length-3&&l[c+3]==l[c+4]&&!l[c+5].insertLeft;)i=l[(c+=3)+2],s="right";break}}var p;if(3==i.nodeType){for(var c=0;4>c;c++){for(;o&&bo(t.line.text.charAt(u+o));)--o;for(;d>u+a&&bo(t.line.text.charAt(u+a));)++a;if(Zo&&9>ea&&0==o&&a==d-u)p=i.parentNode.getBoundingClientRect();else if(Zo&&e.options.lineWrapping){var f=Es(i,o,a).getClientRects();p=f.length?f["right"==r?f.length-1:0]:Sa}else p=Es(i,o,a).getBoundingClientRect()||Sa;if(p.left||p.right||0==o)break;a=o,o-=1,s="right"}Zo&&11>ea&&(p=Ft(e.display.measure,p))}else{o>0&&(s=r="right");var f;p=e.options.lineWrapping&&(f=i.getClientRects()).length>1?f["right"==r?f.length-1:0]:i.getBoundingClientRect()}if(Zo&&9>ea&&!o&&(!p||!p.left&&!p.right)){var h=i.parentNode.getClientRects()[0];p=h?{left:h.left,right:h.left+Jt(e.display),top:h.top,bottom:h.bottom}:Sa}for(var m=p.top-t.rect.top,g=p.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,c=0;c<y.length-1&&!(v<y[c]);c++);var _=c?y[c-1]:0,b=y[c],E={left:("right"==s?p.right:p.left)-t.rect.left,right:("left"==s?p.left:p.right)-t.rect.left,top:_,bottom:b};return p.left||p.right||(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=m,E.rbottom=g),E}function Ft(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Po(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function $t(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Ut(e){e.display.externalMeasure=null,wo(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$t(e.display.view[t])}function jt(e){Ut(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Vt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bt(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Wt(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=oi(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Pi(t);if("local"==r?a+=kt(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Bt());var l=s.left+("window"==r?0:Vt());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Ht(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Vt(),i-=Bt();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function qt(e,t,n,r,i){return r||(r=Mi(e.doc,t.line)),Wt(e,r,Lt(e,r,t.ch,i),n)}function zt(e,t,n,r,i,o){function a(t,a){var s=Nt(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Wt(e,r,s,n)}function s(e,t){var n=l[t],r=n.level%2;return e==$o(n)&&t&&n.level<l[t-1].level?(n=l[--t],e=Uo(n)-(n.level%2?0:1),r=!0):e==Uo(n)&&t<l.length-1&&n.level<l[t+1].level&&(n=l[++t],e=$o(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Mi(e.doc,t.line),i||(i=At(e,r));var l=Fi(r),c=t.ch;if(!l)return a(c);var u=zo(l,c),d=s(c,u);return null!=Ns&&(d.other=s(c,Ns)),d}function Gt(e,t){var n=0,t=Z(e.doc,t);e.options.lineWrapping||(n=Jt(e.display)*t.ch);var r=Mi(e.doc,t.line),i=Pi(r)+kt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Kt(e,t,n,r){var i=ya(e,t);return i.xRel=r,n&&(i.outside=!0),i}function Xt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return Kt(r.first,0,!0,-1);var i=Ni(r,n),o=r.first+r.size-1;if(i>o)return Kt(r.first+r.size-1,Mi(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Mi(r,i);;){var s=Yt(e,a,i,t,n),l=Yr(a),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=Ai(a=c.to.line)}}function Yt(e,t,n,r,i){function o(r){var i=zt(e,ya(n,r),"line",t,c);return s=!0,a>i.bottom?i.left-l:a<i.top?i.left+l:(s=!1,i.left)}var a=i-Pi(t),s=!1,l=2*e.display.wrapper.clientWidth,c=At(e,t),u=Fi(t),d=t.text.length,p=jo(t),f=Vo(t),h=o(p),m=s,g=o(f),v=s;if(r>g)return Kt(n,f,v,1);for(;;){if(u?f==p||f==Ko(t,p,1):1>=f-p){for(var y=h>r||g-r>=r-h?p:f,_=r-(y==p?h:g);bo(t.text.charAt(y));)++y;var b=Kt(n,y,y==p?m:v,-1>_?-1:_>1?1:0);return b}var E=Math.ceil(d/2),w=p+E;if(u){w=p;for(var S=0;E>S;++S)w=Ko(t,w,1)}var C=o(w);C>r?(f=w,g=C,(v=s)&&(g+=1e3),d=E):(p=w,h=C,m=s,d-=E)}}function Qt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ba){ba=Eo("pre");for(var t=0;49>t;++t)ba.appendChild(document.createTextNode("x")),ba.appendChild(Eo("br"));ba.appendChild(document.createTextNode("x"))}So(e.measure,ba);var n=ba.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),wo(e.measure),n||1}function Jt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Eo("span","xxxxxxxxxx"),n=Eo("pre",[t]);So(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Zt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Ia},Ca?Ca.ops.push(e.curOp):e.curOp.ownsGroup=Ca={ops:[e.curOp],delayedCallbacks:[]}}function en(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function tn(e){var t=e.curOp,n=t.ownsGroup;if(n)try{en(n)}finally{Ca=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;nn(n)}}function nn(e){for(var t=e.ops,n=0;n<t.length;n++)rn(t[n]);for(var n=0;n<t.length;n++)on(t[n]);for(var n=0;n<t.length;n++)an(t[n]);for(var n=0;n<t.length;n++)sn(t[n]);for(var n=0;n<t.length;n++)ln(t[n])}function rn(e){var t=e.cm,n=t.display;e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&C(e.cm,e.update)}function an(e){var t=e.cm,n=t.display;e.updatedDisplay&&D(t),e.barMeasure=g(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Lt(t,n.maxLine,n.maxLine.text.length).left+3,e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo+fs-n.scroller.clientWidth)),(e.updatedDisplay||e.selectionChanged)&&(e.newSelectionNodes=gt(t))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.newSelectionNodes&&vt(t,e.newSelectionNodes),e.updatedDisplay&&x(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&v(t,e.barMeasure),e.selectionChanged&&Et(t),t.state.focused&&e.updateInput&&In(t,e.typing)}function ln(e){var t=e.cm,n=t.display,r=t.doc;if(null!=e.adjustWidthTo&&Math.abs(e.barMeasure.scrollWidth-t.display.scroller.scrollWidth)>1&&v(t),e.updatedDisplay&&I(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)){var i=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop));n.scroller.scrollTop=n.scrollbarV.scrollTop=r.scrollTop=i}if(null!=e.scrollLeft&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)){var o=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft));n.scroller.scrollLeft=n.scrollbarH.scrollLeft=r.scrollLeft=o,_(t)}if(e.scrollToPos){var a=mr(t,Z(r,e.scrollToPos.from),Z(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&hr(t,a)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var c=0;c<s.length;++c)s[c].lines.length||ds(s[c],"hide");if(l)for(var c=0;c<l.length;++c)l[c].lines.length&&ds(l[c],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.updatedDisplay&&ta&&(t.options.lineWrapping&&T(t,e.barMeasure),e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!m(t)&&v(t)),e.changeObjs&&ds(t,"changes",t,e.changeObjs)}function cn(e,t){if(e.curOp)return t();Zt(e);try{return t()}finally{tn(e)}}function un(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Zt(e);try{return t.apply(e,arguments)}finally{tn(e)}}}function dn(e){return function(){if(this.curOp)return e.apply(this,arguments);Zt(this);try{return e.apply(this,arguments)}finally{tn(this)}}}function pn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Zt(t);try{return e.apply(this,arguments)}finally{tn(t)}}}function fn(e,t,n){this.line=t,this.rest=Zr(t),this.size=this.rest?Ai(po(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function hn(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new fn(e.doc,Mi(e.doc,o),o);r=o+a.size,i.push(a)}return i}function mn(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;
4if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)va&&ei(e.doc,t)<i.viewTo&&vn(e);else if(n<=i.viewFrom)va&&ti(e.doc,n+r)>i.viewFrom?vn(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)vn(e);else if(t<=i.viewFrom){var o=_n(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):vn(e)}else if(n>=i.viewTo){var o=_n(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):vn(e)}else{var a=_n(e,t,t,-1),s=_n(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(hn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):vn(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function gn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[yn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==fo(a,n)&&a.push(n)}}}function vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function yn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function _n(e,t,n,r){var i,o=yn(e,t),a=e.display.view;if(!va||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=0,l=e.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;ei(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function bn(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=hn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=hn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(yn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(hn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,yn(e,n)))),r.viewTo=n}function En(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function wn(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){Cn(e),e.state.focused&&wn(e)})}function Sn(e){function t(){var r=Cn(e);r||n?(e.display.pollingFast=!1,wn(e)):(n=!0,e.display.poll.set(60,t))}var n=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function Cn(e){var t=e.display.input,n=e.display.prevInput,r=e.doc;if(!e.state.focused||Os(t)&&!n||Tn(e)||e.options.disableInput)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var i=t.value;if(i==n&&!e.somethingSelected())return!1;if(Zo&&ea>=9&&e.display.inputHasSelection===i||da&&/[\uf700-\uf7ff]/.test(i))return In(e),!1;var o=!e.curOp;o&&Zt(e),e.display.shift=!1,8203!=i.charCodeAt(0)||r.sel!=e.display.selForContextMenu||n||(n="​");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),c=Ms(l),u=null;e.state.pasteIncoming&&r.sel.ranges.length>1&&(ka&&ka.join("\n")==l?u=r.sel.ranges.length%ka.length==0&&ho(ka,Ms):c.length==r.sel.ranges.length&&(u=ho(c,function(e){return[e]})));for(var d=r.sel.ranges.length-1;d>=0;d--){var p=r.sel.ranges[d],f=p.from(),h=p.to();a<n.length?f=ya(f.line,f.ch-(n.length-a)):e.state.overwrite&&p.empty()&&!e.state.pasteIncoming&&(h=ya(h.line,Math.min(Mi(r,h.line).text.length,h.ch+po(c).length)));var m=e.curOp.updateInput,g={from:f,to:h,text:u?u[d%u.length]:c,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(sr(e.doc,g),no(e,"inputRead",e,g),l&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&p.head.ch<100&&(!d||r.sel.ranges[d-1].head.line!=p.head.line)){var v=e.getModeAt(p.head),y=La(g);if(v.electricChars){for(var _=0;_<v.electricChars.length;_++)if(l.indexOf(v.electricChars.charAt(_))>-1){Er(e,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Mi(r,y.line).text.slice(0,y.ch))&&Er(e,y.line,"smart")}}return _r(e),e.curOp.updateInput=m,e.curOp.typing=!0,i.length>1e3||i.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=i,o&&tn(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function In(e,t){var n,r,i=e.doc;if(e.somethingSelected()){e.display.prevInput="";var o=i.sel.primary();n=Ls&&(o.to().line-o.from().line>100||(r=e.getSelection()).length>1e3);var a=n?"-":r||e.getSelection();e.display.input.value=a,e.state.focused&&bs(e.display.input),Zo&&ea>=9&&(e.display.inputHasSelection=a)}else t||(e.display.prevInput=e.display.input.value="",Zo&&ea>=9&&(e.display.inputHasSelection=null));e.display.inaccurateSelection=n}function kn(e){"nocursor"==e.options.readOnly||ua&&Io()==e.display.input||e.display.input.focus()}function xn(e){e.state.focused||(kn(e),Jn(e))}function Tn(e){return e.options.readOnly||e.doc.cantEdit}function Dn(e){function t(){e.state.focused&&setTimeout(vo(kn,e),0)}function n(t){io(e,t)||ls(t)}function r(t){if(e.somethingSelected())ka=e.getSelections(),i.inaccurateSelection&&(i.prevInput="",i.inaccurateSelection=!1,i.input.value=ka.join("\n"),bs(i.input));else{for(var n=[],r=[],o=0;o<e.doc.sel.ranges.length;o++){var a=e.doc.sel.ranges[o].head.line,s={anchor:ya(a,0),head:ya(a+1,0)};r.push(s),n.push(e.getRange(s.anchor,s.head))}"cut"==t.type?e.setSelections(r,null,ms):(i.prevInput="",i.input.value=n.join("\n"),bs(i.input)),ka=n}"cut"==t.type&&(e.state.cutIncoming=!0)}var i=e.display;cs(i.scroller,"mousedown",un(e,Rn)),Zo&&11>ea?cs(i.scroller,"dblclick",un(e,function(t){if(!io(e,t)){var n=Ln(e,t);if(n&&!$n(e,t)&&!On(e.display,t)){as(t);var r=e.findWordAt(n);it(e.doc,r.anchor,r.head)}}})):cs(i.scroller,"dblclick",function(t){io(e,t)||as(t)}),cs(i.lineSpace,"selectstart",function(e){On(i,e)||as(e)}),ma||cs(i.scroller,"contextmenu",function(t){er(e,t)}),cs(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Vn(e,i.scroller.scrollTop),Bn(e,i.scroller.scrollLeft,!0),ds(e,"scroll",e))}),cs(i.scrollbarV,"scroll",function(){i.scroller.clientHeight&&Vn(e,i.scrollbarV.scrollTop)}),cs(i.scrollbarH,"scroll",function(){i.scroller.clientHeight&&Bn(e,i.scrollbarH.scrollLeft)}),cs(i.scroller,"mousewheel",function(t){Wn(e,t)}),cs(i.scroller,"DOMMouseScroll",function(t){Wn(e,t)}),cs(i.scrollbarH,"mousedown",t),cs(i.scrollbarV,"mousedown",t),cs(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),cs(i.input,"keyup",function(t){Yn.call(e,t)}),cs(i.input,"input",function(){Zo&&ea>=9&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),Sn(e)}),cs(i.input,"keydown",un(e,Kn)),cs(i.input,"keypress",un(e,Qn)),cs(i.input,"focus",vo(Jn,e)),cs(i.input,"blur",vo(Zn,e)),e.options.dragDrop&&(cs(i.scroller,"dragstart",function(t){jn(e,t)}),cs(i.scroller,"dragenter",n),cs(i.scroller,"dragover",n),cs(i.scroller,"drop",un(e,Un))),cs(i.scroller,"paste",function(t){On(i,t)||(e.state.pasteIncoming=!0,kn(e),Sn(e))}),cs(i.input,"paste",function(){if(ta&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=i.input.selectionStart,n=i.input.selectionEnd;i.input.value+="$",i.input.selectionEnd=n,i.input.selectionStart=t,e.state.fakedLastChar=!0}e.state.pasteIncoming=!0,Sn(e)}),cs(i.input,"cut",r),cs(i.input,"copy",r),aa&&cs(i.sizer,"mouseup",function(){Io()==i.input&&i.input.blur(),kn(e)})}function Mn(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,e.setSize()}function On(e,t){for(var n=eo(t);n!=e.wrapper;n=n.parentNode)if(!n||n.ignoreEvents||n.parentNode==e.sizer&&n!=e.mover)return!0}function Ln(e,t,n,r){var i=e.display;if(!n){var o=eo(t);if(o==i.scrollbarH||o==i.scrollbarV||o==i.scrollbarFiller||o==i.gutterFiller)return null}var a,s,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,s=t.clientY-l.top}catch(t){return null}var c,u=Xt(e,a,s);if(r&&1==u.xRel&&(c=Mi(e.doc,u.line).text).length==u.ch){var d=ys(c,c.length,e.options.tabSize)-c.length;u=ya(u.line,Math.max(0,Math.round((a-Tt(e.display).left)/Jt(e.display))-d))}return u}function Rn(e){if(!io(this,e)){var t=this,n=t.display;if(n.shift=e.shiftKey,On(n,e))return void(ta||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!$n(t,e)){var r=Ln(t,e);switch(window.focus(),to(e)){case 1:r?An(t,e,r):eo(e)==n.scroller&&as(e);break;case 2:ta&&(t.state.lastMiddleDown=+new Date),r&&it(t.doc,r),setTimeout(vo(kn,t),20),as(e);break;case 3:ma&&er(t,e)}}}}function An(e,t,n){setTimeout(vo(xn,e),0);var r,i=+new Date;wa&&wa.time>i-400&&0==_a(wa.pos,n)?r="triple":Ea&&Ea.time>i-400&&0==_a(Ea.pos,n)?(r="double",wa={time:i,pos:n}):(r="single",Ea={time:i,pos:n});var o=e.doc.sel,a=da?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ds&&!Tn(e)&&"single"==r&&o.contains(n)>-1&&o.somethingSelected()?Nn(e,t,n,a):Pn(e,t,n,r,a)}function Nn(e,t,n,r){var i=e.display,o=un(e,function(a){ta&&(i.scroller.draggable=!1),e.state.draggingText=!1,us(document,"mouseup",o),us(i.scroller,"drop",o),Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10&&(as(a),r||it(e.doc,n),kn(e),Zo&&9==ea&&setTimeout(function(){document.body.focus(),kn(e)},20))});ta&&(i.scroller.draggable=!0),e.state.draggingText=o,i.scroller.dragDrop&&i.scroller.dragDrop(),cs(document,"mouseup",o),cs(i.scroller,"drop",o)}function Pn(e,t,n,r,i){function o(t){if(0!=_a(m,t))if(m=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=ys(Mi(c,n.line).text,n.ch,o),s=ys(Mi(c,t.line).text,t.ch,o),l=Math.min(a,s),f=Math.max(a,s),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));g>=h;h++){var v=Mi(c,h).text,y=co(v,l,o);l==f?i.push(new X(ya(h,y),ya(h,y))):v.length>y&&i.push(new X(ya(h,y),ya(h,co(v,f,o))))}i.length||i.push(new X(n,n)),ut(c,Y(p.ranges.slice(0,d).concat(i),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var _=u,b=_.anchor,E=t;if("single"!=r){if("double"==r)var w=e.findWordAt(t);else var w=new X(ya(t.line,0),Z(c,ya(t.line+1,0)));_a(w.anchor,b)>0?(E=w.head,b=G(_.from(),w.anchor)):(E=w.anchor,b=z(_.to(),w.head))}var i=p.ranges.slice(0);i[d]=new X(Z(c,b),E),ut(c,Y(i,d),gs)}}function a(t){var n=++v,i=Ln(e,t,!0,"rect"==r);if(i)if(0!=_a(i,m)){xn(e),o(i);var s=y(l,c);(i.line>=s.to||i.line<s.from)&&setTimeout(un(e,function(){v==n&&a(t)}),150)}else{var u=t.clientY<g.top?-20:t.clientY>g.bottom?20:0;u&&setTimeout(un(e,function(){v==n&&(l.scroller.scrollTop+=u,a(t))}),50)}}function s(t){v=1/0,as(t),kn(e),us(document,"mousemove",_),us(document,"mouseup",b),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;as(t);var u,d,p=c.sel;if(i&&!t.shiftKey?(d=c.sel.contains(n),u=d>-1?c.sel.ranges[d]:new X(n,n)):u=c.sel.primary(),t.altKey)r="rect",i||(u=new X(n,n)),n=Ln(e,t,!0,!0),d=-1;else if("double"==r){var f=e.findWordAt(n);u=e.display.shift||c.extend?rt(c,u,f.anchor,f.head):f}else if("triple"==r){var h=new X(ya(n.line,0),Z(c,ya(n.line+1,0)));u=e.display.shift||c.extend?rt(c,u,h.anchor,h.head):h}else u=rt(c,u,n);i?d>-1?at(c,d,u,gs):(d=c.sel.ranges.length,ut(c,Y(c.sel.ranges.concat([u]),d),{scroll:!1,origin:"*mouse"})):(d=0,ut(c,new K([u],0),gs),p=c.sel);var m=n,g=l.wrapper.getBoundingClientRect(),v=0,_=un(e,function(e){to(e)?a(e):s(e)}),b=un(e,s);cs(document,"mousemove",_),cs(document,"mouseup",b)}function Fn(e,t,n,r,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&as(t);var s=e.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!ao(e,n))return Zi(t);a-=l.top-s.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=s.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=o){var d=Ni(e.doc,a),p=e.options.gutters[c];return i(e,n,e,d,p,t),Zi(t)}}}function $n(e,t){return Fn(e,t,"gutterClick",!0,no)}function Un(e){var t=this;if(!io(t,e)&&!On(t.display,e)){as(e),Zo&&(xa=+new Date);var n=Ln(t,e,!0),r=e.dataTransfer.files;if(n&&!Tn(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(e,r){var s=new FileReader;s.onload=un(t,function(){if(o[r]=s.result,++a==i){n=Z(t.doc,n);var e={from:n,to:n,text:Ms(o.join("\n")),origin:"paste"};sr(t.doc,e),ct(t.doc,Q(n,La(e)))}}),s.readAsText(e)},l=0;i>l;++l)s(r[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(vo(kn,t),20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(da?e.metaKey:e.ctrlKey))var c=t.listSelections();if(dt(t.doc,Q(n,n)),c)for(var l=0;l<c.length;++l)fr(t.doc,"",c[l].anchor,c[l].head,"drag");t.replaceSelection(o,"around","paste"),kn(t)}}catch(e){}}}}function jn(e,t){if(Zo&&(!e.state.draggingText||+new Date-xa<100))return void ls(t);if(!io(e,t)&&!On(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!oa)){var n=Eo("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ia&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),ia&&n.parentNode.removeChild(n)}}function Vn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Yo||k(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),Yo&&k(e),wt(e,100))}function Bn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,_(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function Wn(e,t){var n=t.wheelDeltaX,r=t.wheelDeltaY;null==n&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(n=t.detail),null==r&&t.detail&&t.axis==t.VERTICAL_AXIS?r=t.detail:null==r&&(r=t.wheelDelta);var i=e.display,o=i.scroller;if(n&&o.scrollWidth>o.clientWidth||r&&o.scrollHeight>o.clientHeight){if(r&&da&&ta)e:for(var a=t.target,s=i.view;a!=o;a=a.parentNode)for(var l=0;l<s.length;l++)if(s[l].node==a){e.display.currentWheelTarget=a;break e}if(n&&!Yo&&!ia&&null!=Da)return r&&Vn(e,Math.max(0,Math.min(o.scrollTop+r*Da,o.scrollHeight-o.clientHeight))),Bn(e,Math.max(0,Math.min(o.scrollLeft+n*Da,o.scrollWidth-o.clientWidth))),as(t),void(i.wheelStartX=null);if(r&&null!=Da){var c=r*Da,u=e.doc.scrollTop,d=u+i.wrapper.clientHeight;0>c?u=Math.max(0,u+c-50):d=Math.min(e.doc.height,d+c+50),k(e,{top:u,bottom:d})}20>Ta&&(null==i.wheelStartX?(i.wheelStartX=o.scrollLeft,i.wheelStartY=o.scrollTop,i.wheelDX=n,i.wheelDY=r,setTimeout(function(){if(null!=i.wheelStartX){var e=o.scrollLeft-i.wheelStartX,t=o.scrollTop-i.wheelStartY,n=t&&i.wheelDY&&t/i.wheelDY||e&&i.wheelDX&&e/i.wheelDX;i.wheelStartX=i.wheelStartY=null,n&&(Da=(Da*Ta+n)/(Ta+1),++Ta)}},200)):(i.wheelDX+=n,i.wheelDY+=r))}}function Hn(e,t,n){if("string"==typeof t&&(t=Wa[t],!t))return!1;e.display.pollingFast&&Cn(e)&&(e.display.pollingFast=!1);var r=e.display.shift,i=!1;try{Tn(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=hs}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function qn(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function zn(e,t){var n=xr(e.options.keyMap),r=n.auto;clearTimeout(Ma),r&&!za(t)&&(Ma=setTimeout(function(){xr(e.options.keyMap)==n&&(e.options.keyMap=r.call?r.call(null,e):r,s(e))},50));var i=Ga(t,!0),o=!1;if(!i)return!1;var a=qn(e);return o=t.shiftKey?qa("Shift-"+i,a,function(t){return Hn(e,t,!0)})||qa(i,a,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?Hn(e,t):void 0}):qa(i,a,function(t){return Hn(e,t)}),o&&(as(t),Et(e),no(e,"keyHandled",e,i,t)),o}function Gn(e,t,n){var r=qa("'"+n+"'",qn(e),function(t){return Hn(e,t,!0)});return r&&(as(t),Et(e),no(e,"keyHandled",e,"'"+n+"'",t)),r}function Kn(e){var t=this;if(xn(t),!io(t,e)){Zo&&11>ea&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=zn(t,e);ia&&(Oa=r?n:null,!r&&88==n&&!Ls&&(da?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Xn(t)}}function Xn(e){function t(e){18!=e.keyCode&&e.altKey||(xo(n,"CodeMirror-crosshair"),us(document,"keyup",t),us(document,"mouseover",t))}var n=e.display.lineDiv;To(n,"CodeMirror-crosshair"),cs(document,"keyup",t),cs(document,"mouseover",t)}function Yn(e){16==e.keyCode&&(this.doc.sel.shift=!1),io(this,e)}function Qn(e){var t=this;if(!(io(t,e)||e.ctrlKey&&!e.altKey||da&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(ia&&n==Oa)return Oa=null,void as(e);if(!(ia&&(!e.which||e.which<10)||aa)||!zn(t,e)){var i=String.fromCharCode(null==r?n:r);Gn(t,e,i)||(Zo&&ea>=9&&(t.display.inputHasSelection=null),Sn(t))}}}function Jn(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(ds(e,"focus",e),e.state.focused=!0,To(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(In(e),ta&&setTimeout(vo(In,e,!0),0))),wn(e),Et(e))}function Zn(e){e.state.focused&&(ds(e,"blur",e),e.state.focused=!1,xo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function er(e,t){function n(){if(null!=i.input.selectionStart){var t=e.somethingSelected(),n=i.input.value="​"+(t?i.input.value:"");i.prevInput=t?"":"​",i.input.selectionStart=1,i.input.selectionEnd=n.length,i.selForContextMenu=e.doc.sel}}function r(){if(i.inputDiv.style.position="relative",i.input.style.cssText=l,Zo&&9>ea&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=a),wn(e),null!=i.input.selectionStart){(!Zo||Zo&&9>ea)&&n();var t=0,r=function(){i.selForContextMenu==e.doc.sel&&0==i.input.selectionStart?un(e,Wa.selectAll)(e):t++<10?i.detectingSelectAll=setTimeout(r,500):In(e)};i.detectingSelectAll=setTimeout(r,200)}}if(!io(e,t,"contextmenu")){var i=e.display;if(!On(i,t)&&!tr(e,t)){var o=Ln(e,t),a=i.scroller.scrollTop;if(o&&!ia){var s=e.options.resetSelectionOnContextMenu;s&&-1==e.doc.sel.contains(o)&&un(e,ut)(e.doc,Q(o),ms);var l=i.input.style.cssText;if(i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Zo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ta)var c=window.scrollY;if(kn(e),ta&&window.scrollTo(null,c),In(e),e.somethingSelected()||(i.input.value=i.prevInput=" "),i.selForContextMenu=e.doc.sel,clearTimeout(i.detectingSelectAll),Zo&&ea>=9&&n(),ma){ls(t);var u=function(){us(window,"mouseup",u),setTimeout(r,20)};cs(window,"mouseup",u)}else setTimeout(r,50)}}}}function tr(e,t){return ao(e,"gutterContextMenu")?Fn(e,t,"gutterContextMenu",!1,ds):!1}function nr(e,t){if(_a(e,t.from)<0)return e;if(_a(e,t.to)<=0)return La(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=La(t).ch-t.to.ch),ya(n,r)}function rr(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new X(nr(i.anchor,t),nr(i.head,t)))}return Y(n,e.sel.primIndex)}function ir(e,t,n){return e.line==t.line?ya(n.line,e.ch-t.ch+n.ch):ya(n.line+(e.line-t.line),e.ch)}function or(e,t,n){for(var r=[],i=ya(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=ir(s.from,i,o),c=ir(La(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],d=_a(u.head,u.anchor)<0;r[a]=new X(d?c:l,d?l:c)}else r[a]=new X(l,l)}return new K(r,e.sel.primIndex)}function ar(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=Z(e,t)),n&&(this.to=Z(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),ds(e,"beforeChange",e,r),e.cm&&ds(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function sr(e,t,n){if(e.cm){if(!e.cm.curOp)return un(e.cm,sr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ao(e,"beforeChange")||e.cm&&ao(e.cm,"beforeChange"))||(t=ar(e,t,!0))){var r=ga&&!n&&Br(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)lr(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else lr(e,t)}}function lr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=_a(t.from,t.to)){var n=rr(e,t);Bi(e,t,n,e.cm?e.cm.curOp.id:0/0),dr(e,t,n,Ur(e,t));var r=[];Ti(e,function(e,n){n||-1!=fo(r,e.history)||(Ji(e.history,t),r.push(e.history)),dr(e,t,null,Ur(e,t))})}}function cr(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l<a.length&&(r=a[l],n?!r.ranges||r.equals(e.sel):r.ranges);l++);if(l!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(qi(r,s),n&&!r.equals(e.sel))return void ut(e,r,{clearRedo:!1});o=r}var c=[];qi(o,s),s.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=ao(e,"beforeChange")||e.cm&&ao(e.cm,"beforeChange"),l=r.changes.length-1;l>=0;--l){var d=r.changes[l];if(d.origin=t,u&&!ar(e,d,!1))return void(a.length=0);c.push(Ui(e,d));var p=l?rr(e,d):po(a);dr(e,d,p,Vr(e,d)),!l&&e.cm&&e.cm.scrollIntoView({from:d.from,to:La(d)});var f=[];Ti(e,function(e,t){t||-1!=fo(f,e.history)||(Ji(e.history,d),f.push(e.history)),dr(e,d,null,Vr(e,d))})}}}}function ur(e,t){if(0!=t&&(e.first+=t,e.sel=new K(ho(e.sel.ranges,function(e){return new X(ya(e.anchor.line+t,e.anchor.ch),ya(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){mn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)gn(e.cm,r,"gutter")}}function dr(e,t,n,r){if(e.cm&&!e.cm.curOp)return un(e.cm,dr)(e,t,n,r);if(t.to.line<e.first)return void ur(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ur(e,i),t={from:ya(e.first,0),to:ya(t.to.line+i,t.to.ch),text:[po(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ya(o,Mi(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Oi(e,t.from,t.to),n||(n=rr(e,t)),e.cm?pr(e.cm,t,r):Ii(e,t,r),dt(e,n,ms)}}function pr(e,t,n){var r=e.doc,i=e.display,a=t.from,s=t.to,l=!1,c=a.line;e.options.lineWrapping||(c=Ai(Jr(Mi(r,a.line))),r.iter(c,s.line+1,function(e){return e==i.maxLine?(l=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&oo(e),Ii(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=p(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),wt(e,400);var u=t.text.length-(s.line-a.line)-1;a.line!=s.line||1!=t.text.length||Ci(e.doc,t)?mn(e,a.line,s.line+1,u):gn(e,a.line,"text");var d=ao(e,"changes"),f=ao(e,"change");if(f||d){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};f&&no(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function fr(e,t,n,r,i){if(r||(r=n),_a(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=Ms(t)),sr(e,{from:n,to:r,text:t,origin:i})}function hr(e,t){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!la){var o=Eo("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-kt(e.display))+"px; height: "+(t.bottom-t.top+fs)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}function mr(e,t,n,r){for(null==r&&(r=0);;){var i=!1,o=zt(e,t),a=n&&n!=t?zt(e,n):o,s=vr(e,Math.min(o.left,a.left),Math.min(o.top,a.top)-r,Math.max(o.left,a.left),Math.max(o.bottom,a.bottom)+r),l=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=s.scrollTop&&(Vn(e,s.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(i=!0)),null!=s.scrollLeft&&(Bn(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(i=!0)),!i)return o}}function gr(e,t,n,r,i){var o=vr(e,t,n,r,i);null!=o.scrollTop&&Vn(e,o.scrollTop),null!=o.scrollLeft&&Bn(e,o.scrollLeft)}function vr(e,t,n,r,i){var o=e.display,a=Qt(e.display);0>n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=o.scroller.clientHeight-fs,c={};i-n>l&&(i=n+l);var u=e.doc.height+xt(o),d=a>n,p=i>u-a;if(s>n)c.scrollTop=d?0:n;else if(i>s+l){var f=Math.min(n,(p?u:i)-l);f!=s&&(c.scrollTop=f)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=o.scroller.clientWidth-fs-o.gutters.offsetWidth,g=r-t>m;return g&&(r=t+l),10>t?c.scrollLeft=0:h>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function yr(e,t,n){(null!=t||null!=n)&&br(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function _r(e){br(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?ya(t.line,t.ch-1):t,r=ya(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function br(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Gt(e,t.from),r=Gt(e,t.to),i=vr(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Er(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=It(e,t):n="prev");var a=e.options.tabSize,s=Mi(o,t),l=ys(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==hs||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?ys(Mi(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)p+=a,d+=" ";if(c>p&&(d+=uo(c-p)),d!=u)fr(o,d,ya(t,0),ya(t,u.length),"+input");else for(var f=0;f<o.sel.ranges.length;f++){var h=o.sel.ranges[f];if(h.head.line==t&&h.head.ch<u.length){var p=ya(t,u.length);at(o,f,new X(p,p));break}}s.stateAfter=null}function wr(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Mi(e,J(e,t)):i=Ai(t),null==i?null:(r(o,i)&&e.cm&&gn(e.cm,i,n),o)}function Sr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&_a(o.from,po(r).to)<=0;){var a=r.pop();if(_a(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}cn(e,function(){for(var t=r.length-1;t>=0;t--)fr(e.doc,"",r[t].from,r[t].to,"+delete");_r(e)})}function Cr(e,t,n,r,i){function o(){var t=s+n;return t<e.first||t>=e.first+e.size?d=!1:(s=t,u=Mi(e,t))}function a(e){var t=(i?Ko:Xo)(u,l,n,!0);if(null==t){if(e||!o())return d=!1;l=i?(0>n?Vo:jo)(u):0>n?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=n,u=Mi(e,s),d=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var p=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(0>n)||a(!m);m=!1){var g=u.text.charAt(l)||"\n",v=yo(g,h)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||m||v||(v="s"),p&&p!=v){0>n&&(n=1,a());break}if(v&&(p=v),n>0&&!a(!m))break}var y=mt(e,ya(s,l),c,!0);return d||(y.hitSide=!0),y}function Ir(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(0>n?1.5:.5)*Qt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=Xt(e,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function kr(t,n,r,i){e.defaults[t]=n,r&&(Aa[t]=i?function(e,t,n){n!=Na&&r(e,t,n)}:r)}function xr(e){return"string"==typeof e?Ha[e]:e}function Tr(e,t,n,r,i){if(r&&r.shared)return Dr(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return un(e.cm,Tr)(e,t,n,r,i);var o=new Xa(e,i),a=_a(t,n);if(r&&go(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Eo("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||(o.widgetNode.ignoreEvents=!0),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Qr(e,t.line,t,n,o)||t.line!=n.line&&Qr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");va=!0}o.addToHistory&&Bi(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&Jr(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ri(e,0),Pr(e,new Rr(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){ni(e,t)&&Ri(t,0)}),o.clearOnEnter&&cs(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(ga=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ya,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)mn(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle)for(var u=t.line;u<=n.line;u++)gn(c,u,"text");o.atomic&&ft(c.doc),no(c,"markerAdded",c,o)}return o}function Dr(e,t,n,r,i){r=go(r),r.shared=!1;var o=[Tr(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Ti(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Tr(e,Z(e,t),Z(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=po(o)}),new Qa(o,a)}function Mr(e){return e.findMarks(ya(e.first,0),e.clipPos(ya(e.lastLine())),function(e){return e.parent})}function Or(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(_a(o,a)){var s=Tr(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Lr(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Ti(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==fo(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Rr(e,t,n){this.marker=e,this.from=t,this.to=n}function Ar(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Nr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Pr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Fr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rr(a,o.from,l?null:o.to))}}return r}function $r(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rr(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Ur(e,t){var n=tt(e,t.from.line)&&Mi(e,t.from.line).markedSpans,r=tt(e,t.to.line)&&Mi(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==_a(t.from,t.to),s=Fr(n,i,a),l=$r(r,o,a),c=1==t.text.length,u=po(t.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var p=s[d];if(null==p.to){var f=Ar(l,p.marker);f?c&&(p.to=null==f.to?null:f.to+u):p.to=i}}if(l)for(var d=0;d<l.length;++d){var p=l[d];if(null!=p.to&&(p.to+=u),null==p.from){var f=Ar(s,p.marker);f||(p.from=u,c&&(s||(s=[])).push(p))}else p.from+=u,c&&(s||(s=[])).push(p)}s&&(s=jr(s)),l&&l!=s&&(l=jr(l));var h=[s];if(!c){var m,g=t.text.length-2;if(g>0&&s)for(var d=0;d<s.length;++d)null==s[d].to&&(m||(m=[])).push(new Rr(s[d].marker,null,null));for(var d=0;g>d;++d)h.push(m);h.push(l)}return h}function jr(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Vr(e,t){var n=Ki(e,t),r=Ur(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Br(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;
5!n.readOnly||r&&-1!=fo(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(_a(c.to,s.from)<0||_a(c.from,s.to)>0)){var u=[l,1],d=_a(c.from,s.from),p=_a(c.to,s.to);(0>d||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-1}}return i}function Wr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Hr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qr(e){return e.inclusiveLeft?-1:0}function zr(e){return e.inclusiveRight?1:0}function Gr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=_a(r.from,i.from)||qr(e)-qr(t);if(o)return-o;var a=_a(r.to,i.to)||zr(e)-zr(t);return a?a:t.id-e.id}function Kr(e,t){var n,r=va&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||Gr(n,i.marker)<0)&&(n=i.marker);return n}function Xr(e){return Kr(e,!0)}function Yr(e){return Kr(e,!1)}function Qr(e,t,n,r,i){var o=Mi(e,t),a=va&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=_a(c.from,n)||qr(l.marker)-qr(i),d=_a(c.to,r)||zr(l.marker)-zr(i);if(!(u>=0&&0>=d||0>=u&&d>=0)&&(0>=u&&(_a(c.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(_a(c.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function Jr(e){for(var t;t=Xr(e);)e=t.find(-1,!0).line;return e}function Zr(e){for(var t,n;t=Yr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ei(e,t){var n=Mi(e,t),r=Jr(n);return n==r?t:Ai(r)}function ti(e,t){if(t>e.lastLine())return t;var n,r=Mi(e,t);if(!ni(e,r))return t;for(;n=Yr(r);)r=n.find(1,!0).line;return Ai(r)+1}function ni(e,t){var n=va&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ri(e,t,r))return!0}}function ri(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return ri(e,r.line,Ar(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ri(e,t,i))return!0}function ii(e,t,n){Pi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&yr(e,null,n)}function oi(e){if(null!=e.height)return e.height;if(!Co(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.getGutterElement().offsetWidth+"px;"),So(e.cm.display.measure,Eo("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function ai(e,t,n,r){var i=new Ja(e,n,r);return i.noHScroll&&(e.display.alignWidgets=!0),wr(e.doc,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,!ni(e.doc,t)){var r=Pi(t)<e.doc.scrollTop;Ri(t,t.height+oi(i)),r&&yr(e,null,i.height),e.curOp.forceUpdate=!0}return!0}),i}function si(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Wr(e),Hr(e,n);var i=r?r(e):1;i!=e.height&&Ri(e,i)}function li(e){e.parent=null,Wr(e)}function ci(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function ui(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function di(e,t,n){for(var r=0;10>r;r++){var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}function pi(t,n,r,i,o,a,s){var l=r.flattenSpans;null==l&&(l=t.options.flattenSpans);var c,u=0,d=null,p=new Ka(n,t.options.tabSize);for(""==n&&ci(ui(r,i),a);!p.eol();){if(p.pos>t.options.maxHighlightLength?(l=!1,s&&mi(t,n,i,p.pos),p.pos=n.length,c=null):c=ci(di(r,p,i),a),t.options.addModeClass){var f=e.innerMode(r,i).mode.name;f&&(c="m-"+(c?f+" "+c:f))}l&&d==c||(u<p.start&&o(p.start,d),u=p.start,d=c),p.start=p.pos}for(;u<p.pos;){var h=Math.min(p.pos,u+5e4);o(h,d),u=h}}function fi(e,t,n,r){var i=[e.state.modeGen],o={};pi(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var s=e.state.overlays[a],l=1,c=0;pi(e,t.text,s.mode,!0,function(e,t){for(var n=l;e>c;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function hi(e,t){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=fi(e,t,t.stateAfter=It(e,Ai(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null)}return t.styles}function mi(e,t,n,r){var i=e.doc.mode,o=new Ka(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&ui(i,n);!o.eol()&&o.pos<=e.options.maxHighlightLength;)di(i,o,n),o.start=o.pos}function gi(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ts:es;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function vi(e,t){var n=Eo("span",null,null,ta?"padding-right: .1px":null),r={pre:Eo("pre",[n]),content:n,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=_i,(Zo||ta)&&e.getOption("lineWrapping")&&(r.addToken=bi(r.addToken)),No(e.display.measure)&&(o=Fi(a))&&(r.addToken=Ei(r.addToken,o)),r.map=[],Si(a,r,hi(e,a)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Do(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Do(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ao(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return ds(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Do(r.pre.className,r.textClass||"")),r}function yi(e){var t=Eo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t}function _i(e,t,n,r,i,o){if(t){var a=e.cm.options.specialChars,s=!1;if(a.test(t))for(var l=document.createDocumentFragment(),c=0;;){a.lastIndex=c;var u=a.exec(t),d=u?u.index-c:t.length-c;if(d){var p=document.createTextNode(t.slice(c,c+d));l.appendChild(Zo&&9>ea?Eo("span",[p]):p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!u)break;if(c+=d+1," "==u[0]){var f=e.cm.options.tabSize,h=f-e.col%f,p=l.appendChild(Eo("span",uo(h),"cm-tab"));e.col+=h}else{var p=e.cm.options.specialCharPlaceholder(u[0]);l.appendChild(Zo&&9>ea?Eo("span",[p]):p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var l=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,l),Zo&&9>ea&&(s=!0),e.pos+=t.length}if(n||r||i||s){var m=n||"";r&&(m+=r),i&&(m+=i);var g=Eo("span",[l],m);return o&&(g.title=o),e.content.appendChild(g)}e.content.appendChild(l)}}function bi(e){function t(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}return function(n,r,i,o,a,s){e(n,r.replace(/ {3,}/g,t),i,o,a,s)}}function Ei(e,t){return function(n,r,i,o,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,c=l+r.length;;){for(var u=0;u<t.length;u++){var d=t[u];if(d.to>l&&d.from<=l)break}if(d.to>=c)return e(n,r,i,o,a,s);e(n,r.slice(0,d.to-l),i,o,null,s),o=null,r=r.slice(d.to-l),l=d.to}}}function wi(e,t,n,r){var i=!r&&n.widgetNode;i&&(e.map.push(e.pos,e.pos+t,i),e.content.appendChild(i)),e.pos+=t}function Si(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,p=i.length,f=0,h=1,m="",g=0;;){if(g==f){s=l=c=u="",d=null,g=1/0;for(var v=[],y=0;y<r.length;++y){var _=r[y],b=_.marker;_.from<=f&&(null==_.to||_.to>f)?(null!=_.to&&g>_.to&&(g=_.to,l=""),b.className&&(s+=" "+b.className),b.startStyle&&_.from==f&&(c+=" "+b.startStyle),b.endStyle&&_.to==g&&(l+=" "+b.endStyle),b.title&&!u&&(u=b.title),b.collapsed&&(!d||Gr(d.marker,b)<0)&&(d=_)):_.from>f&&g>_.from&&(g=_.from),"bookmark"==b.type&&_.from==f&&b.widgetNode&&v.push(b)}if(d&&(d.from||0)==f&&(wi(t,(null==d.to?p+1:d.to)-f,d.marker,null==d.from),null==d.to))return;if(!d&&v.length)for(var y=0;y<v.length;++y)wi(t,0,v[y])}if(f>=p)break;for(var E=Math.min(p,g);;){if(m){var w=f+m.length;if(!d){var S=w>E?m.slice(0,E-f):m;t.addToken(t,S,a?a+s:s,c,f+S.length==g?l:"",u)}if(w>=E){m=m.slice(E-f),f=E;break}f=w,c=""}m=i.slice(o,o=n[h++]),a=gi(n[h++],t.cm.options)}}else for(var h=1;h<n.length;h+=2)t.addToken(t,i.slice(o,o=n[h]),gi(n[h+1],t.cm.options))}function Ci(e,t){return 0==t.from.ch&&0==t.to.ch&&""==po(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){si(e,n,i,r),no(e,"change",e,t)}var a=t.from,s=t.to,l=t.text,c=Mi(e,a.line),u=Mi(e,s.line),d=po(l),p=i(l.length-1),f=s.line-a.line;if(Ci(e,t)){for(var h=0,m=[];h<l.length-1;++h)m.push(new Za(l[h],i(h),r));o(u,u.text,p),f&&e.remove(a.line,f),m.length&&e.insert(a.line,m)}else if(c==u)if(1==l.length)o(c,c.text.slice(0,a.ch)+d+c.text.slice(s.ch),p);else{for(var m=[],h=1;h<l.length-1;++h)m.push(new Za(l[h],i(h),r));m.push(new Za(d+c.text.slice(s.ch),p,r)),o(c,c.text.slice(0,a.ch)+l[0],i(0)),e.insert(a.line+1,m)}else if(1==l.length)o(c,c.text.slice(0,a.ch)+l[0]+u.text.slice(s.ch),i(0)),e.remove(a.line+1,f);else{o(c,c.text.slice(0,a.ch)+l[0],i(0)),o(u,d+u.text.slice(s.ch),p);for(var h=1,m=[];h<l.length-1;++h)m.push(new Za(l[h],i(h),r));f>1&&e.remove(a.line+1,f-1),e.insert(a.line+1,m)}no(e,"change",e,t)}function ki(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function xi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Ti(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;(!n||l)&&(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function Di(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,mn(e)}function Mi(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Oi(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Li(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Ri(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ai(e){if(null==e.parent)return null;for(var t=e.parent,n=fo(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Ni(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],s=a.height;if(s>t)break;t-=s}return n+r}function Pi(e){e=Jr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function Fi(e){var t=e.order;return null==t&&(t=e.order=Ps(e.text)),t}function $i(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ui(e,t){var n={from:q(t.from),to:La(t),text:Oi(e,t.from,t.to)};return zi(e,n,t.from.line,t.to.line+1),Ti(e,function(e){zi(e,n,t.from.line,t.to.line+1)},!0),n}function ji(e){for(;e.length;){var t=po(e);if(!t.ranges)break;e.pop()}}function Vi(e,t){return t?(ji(e.done),po(e.done)):e.done.length&&!po(e.done).ranges?po(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),po(e.done)):void 0}function Bi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Vi(i,i.lastOp==r))){var s=po(o.changes);0==_a(t.from,t.to)&&0==_a(t.from,s.to)?s.to=La(t):o.changes.push(Ui(e,t))}else{var l=po(i.done);for(l&&l.ranges||qi(e.sel,i.done),o={changes:[Ui(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||ds(e,"historyAdded")}function Wi(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Hi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Wi(e,o,po(i.done),t))?i.done[i.done.length-1]=t:qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ji(i.undone)}function qi(e,t){var n=po(t);n&&n.ranges&&n.equals(e)||t.push(e)}function zi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Gi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ki(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(Gi(n[r]));return i}function Xi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?K.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var c,u=a[l];if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&fo(t,Number(c[1]))>-1&&(po(s)[d]=u[d],delete u[d])}}}return i}function Yi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Qi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)Yi(o.ranges[s].anchor,t,n,r),Yi(o.ranges[s].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var l=o.changes[s];if(n<l.from.line)l.from=ya(l.from.line+r,l.from.ch),l.to=ya(l.to.line+r,l.to.ch);else if(t<=l.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Ji(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Qi(e.done,n,r,i),Qi(e.undone,n,r,i)}function Zi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function eo(e){return e.target||e.srcElement}function to(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),da&&e.ctrlKey&&1==t&&(t=3),t}function no(e,t){function n(e){return function(){e.apply(null,o)}}var r=e._handlers&&e._handlers[t];if(r){var i,o=Array.prototype.slice.call(arguments,2);Ca?i=Ca.delayedCallbacks:ps?i=ps:(i=ps=[],setTimeout(ro,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function ro(){var e=ps;ps=null;for(var t=0;t<e.length;++t)e[t]()}function io(e,t,n){return ds(e,n||t.type,e,t),Zi(t)||t.codemirrorIgnore}function oo(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==fo(n,t[r])&&n.push(t[r])}function ao(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function so(e){e.prototype.on=function(e,t){cs(this,e,t)},e.prototype.off=function(e,t){us(this,e,t)}}function lo(){this.id=null}function co(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function uo(e){for(;_s.length<=e;)_s.push(po(_s)+" ");return _s[e]}function po(e){return e[e.length-1]}function fo(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function ho(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function mo(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&go(t,n),n}function go(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function vo(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function yo(e,t){return t?t.source.indexOf("\\w")>-1&&Ss(e)?!0:t.test(e):Ss(e)}function _o(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function bo(e){return e.charCodeAt(0)>=768&&Cs.test(e)}function Eo(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function wo(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function So(e,t){return wo(e).appendChild(t)}function Co(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function Io(){return document.activeElement}function ko(e){return new RegExp("\\b"+e+"\\b\\s*")}function xo(e,t){var n=ko(t);n.test(e.className)&&(e.className=e.className.replace(n,""))}function To(e,t){ko(t).test(e.className)||(e.className+=" "+t)}function Do(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!ko(n[r]).test(t)&&(t+=" "+n[r]);return t}function Mo(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Oo(){Ts||(Lo(),Ts=!0)}function Lo(){var e;cs(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Is=null,Mo(Mn)},100))}),cs(window,"blur",function(){Mo(Zn)})}function Ro(e){if(null!=Is)return Is;var t=Eo("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return So(e,t),t.offsetWidth&&(Is=t.offsetHeight-t.clientHeight),Is||0}function Ao(e){if(null==ks){var t=Eo("span","​");So(e,Eo("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ks=t.offsetWidth<=1&&t.offsetHeight>2&&!(Zo&&8>ea))}return ks?Eo("span","​"):Eo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function No(e){if(null!=xs)return xs;var t=So(e,document.createTextNode("AخA")),n=Es(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Es(t,1,2).getBoundingClientRect();return xs=r.right-n.right<3}function Po(e){if(null!=Rs)return Rs;var t=So(e,Eo("span","x")),n=t.getBoundingClientRect(),r=Es(t,0,1).getBoundingClientRect();return Rs=Math.abs(n.left-r.left)>1}function Fo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function $o(e){return e.level%2?e.to:e.from}function Uo(e){return e.level%2?e.from:e.to}function jo(e){var t=Fi(e);return t?$o(t[0]):0}function Vo(e){var t=Fi(e);return t?Uo(po(t)):e.text.length}function Bo(e,t){var n=Mi(e.doc,t),r=Jr(n);r!=n&&(t=Ai(r));var i=Fi(r),o=i?i[0].level%2?Vo(r):jo(r):0;return ya(t,o)}function Wo(e,t){for(var n,r=Mi(e.doc,t);n=Yr(r);)r=n.find(1,!0).line,t=null;var i=Fi(r),o=i?i[0].level%2?jo(r):Vo(r):r.text.length;return ya(null==t?Ai(r):t,o)}function Ho(e,t){var n=Bo(e,t.line),r=Mi(e.doc,n.line),i=Fi(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ya(n.line,a?0:o)}return n}function qo(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function zo(e,t){Ns=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return qo(e,i.level,e[n].level)?(i.from!=i.to&&(Ns=n),r):(i.from!=i.to&&(Ns=r),n);n=r}}return n}function Go(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&bo(e.text.charAt(t)));return t}function Ko(e,t,n,r){var i=Fi(e);if(!i)return Xo(e,t,n,r);for(var o=zo(i,t),a=i[o],s=Go(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s<a.to)return s;if(s==a.from||s==a.to)return zo(i,s)==o?s:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;s=n>0==a.level%2?Go(e,a.to,-1,r):Go(e,a.from,1,r)}}function Xo(e,t,n,r){var i=t+n;if(r)for(;i>0&&bo(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var Yo=/gecko\/\d/i.test(navigator.userAgent),Qo=/MSIE \d/.test(navigator.userAgent),Jo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Zo=Qo||Jo,ea=Zo&&(Qo?document.documentMode||6:Jo[1]),ta=/WebKit\//.test(navigator.userAgent),na=ta&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ra=/Chrome\//.test(navigator.userAgent),ia=/Opera\//.test(navigator.userAgent),oa=/Apple Computer/.test(navigator.vendor),aa=/KHTML\//.test(navigator.userAgent),sa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),la=/PhantomJS/.test(navigator.userAgent),ca=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ua=ca||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),da=ca||/Mac/.test(navigator.platform),pa=/win/i.test(navigator.platform),fa=ia&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);fa&&(fa=Number(fa[1])),fa&&fa>=15&&(ia=!1,ta=!0);var ha=da&&(na||ia&&(null==fa||12.11>fa)),ma=Yo||Zo&&ea>=9,ga=!1,va=!1,ya=e.Pos=function(e,t){return this instanceof ya?(this.line=e,void(this.ch=t)):new ya(e,t)},_a=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};K.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=_a(n.anchor,r.anchor)||0!=_a(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new X(q(this.ranges[t].anchor),q(this.ranges[t].head));return new K(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(_a(t,r.from())>=0&&_a(e,r.to())<=0)return n}return-1}},X.prototype={from:function(){return G(this.anchor,this.head)},to:function(){return z(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var ba,Ea,wa,Sa={left:0,right:0,top:0,bottom:0},Ca=null,Ia=0,ka=null,xa=0,Ta=0,Da=null;Zo?Da=-.53:Yo?Da=15:ra?Da=-.7:oa&&(Da=-1/3);var Ma,Oa=null,La=e.changeEnd=function(e){return e.text?ya(e.from.line+e.text.length-1,po(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),kn(this),Sn(this)},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,Aa.hasOwnProperty(e)&&un(this,Aa[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||"string"!=typeof t[n]&&t[n].name==e)return t.splice(n,1),!0},addOverlay:dn(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,mn(this)}),removeOverlay:dn(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void mn(this)}}),indentLine:dn(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),tt(this.doc,e)&&Er(this,e,t,n)}),indentSelection:dn(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Er(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&_r(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)Er(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&at(this.doc,r,new X(o,c[r].to()),ms)}}}),getTokenAt:function(e,t){var n=this.doc;e=Z(n,e);for(var r=It(this,e.line,t),i=this.doc.mode,o=Mi(n,e.line),a=new Ka(o.text,this.options.tabSize);a.pos<e.ch&&!a.eol();){a.start=a.pos;var s=di(i,a,r)}return{start:a.start,end:a.pos,string:a.current(),type:s||null,state:r}},getTokenTypeAt:function(e){e=Z(this.doc,e);var t,n=hi(this,Mi(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("cm-overlay "):-1;return 0>s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!ja.hasOwnProperty(t))return ja;var r=ja[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==fo(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=J(n,null==e?n.first+n.size-1:e),It(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?Z(this.doc,e):e?r.from():r.to(),zt(this,n,t||"page")},charCoords:function(e,t){return qt(this,Z(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Ht(this,e,t||"page"),Xt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Ht(this,{top:e,left:0},t||"page").top,Ni(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,r=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>r&&(e=r,n=!0);var i=Mi(this.doc,e);return Wt(this,i,{top:0,left:0},t||"page").top+(n?this.doc.height-Pi(i):0)},defaultTextHeight:function(){return Qt(this.display)},defaultCharWidth:function(){return Jt(this.display)},setGutterMarker:dn(function(e,t,n){return wr(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&_o(r)&&(e.gutterMarkers=null),!0})}),clearGutter:dn(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,gn(t,r,"gutter"),_o(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),addLineWidget:dn(function(e,t,n){return ai(this,e,t,n)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!tt(this.doc,e))return null;var t=e;if(e=Mi(this.doc,e),!e)return null}else{var t=Ai(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=zt(this,Z(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&gr(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:dn(Kn),triggerOnKeyPress:dn(Qn),triggerOnKeyUp:Yn,execCommand:function(e){return Wa.hasOwnProperty(e)?Wa[e](this):void 0},findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=Z(this.doc,e);t>o&&(a=Cr(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:dn(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Cr(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},vs)}),deleteH:dn(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Sr(this,function(n){var i=Cr(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,s=Z(this.doc,e);t>a;++a){var l=zt(this,s,"div");if(null==o?o=l.left:l.left=o,s=Ir(this,l,i,n),s.hitSide)break}return s},moveV:dn(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var s=zt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Ir(n,s,e,t);return"page"==t&&a==r.sel.primary()&&yr(n,null,qt(n,l,"div").top-s.top),l},vs),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Mi(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),s=yo(a,o)?function(e){return yo(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!yo(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new X(ya(e.line,r),ya(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?To(this.display.cursorDiv,"CodeMirror-overwrite"):xo(this.display.cursorDiv,"CodeMirror-overwrite"),ds(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return Io()==this.display.input},scrollTo:dn(function(e,t){(null!=e||null!=t)&&br(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller,t=fs;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:dn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ya(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)br(this),this.curOp.scrollToPos=e;else{var n=vr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:dn(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&Ut(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){gn(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,ds(r,"refresh",this)}),operation:function(e){return cn(this,e)},refresh:dn(function(){var e=this.display.cachedTextHeight;mn(this),this.curOp.forceUpdate=!0,jt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),d(this),(null==e||Math.abs(e-Qt(this.display))>.5)&&a(this),ds(this,"refresh",this)}),swapDoc:dn(function(e){var t=this.doc;return t.cm=null,Di(this,e),jt(this),In(this),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,no(this,"swapDoc",this,t),t
6}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},so(e);var Ra=e.defaults={},Aa=e.optionHandlers={},Na=e.Init={toString:function(){return"CodeMirror.Init"}};kr("value","",function(e,t){e.setValue(t)},!0),kr("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),kr("indentUnit",2,n,!0),kr("indentWithTabs",!1),kr("smartIndent",!0),kr("tabSize",4,function(e){r(e),jt(e),mn(e)},!0),kr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),kr("specialCharPlaceholder",yi,function(e){e.refresh()},!0),kr("electricChars",!0),kr("rtlMoveVisually",!pa),kr("wholeLineUpdateBefore",!0),kr("theme","default",function(e){l(e),c(e)},!0),kr("keyMap","default",s),kr("extraKeys",null),kr("lineWrapping",!1,i,!0),kr("gutters",[],function(e){h(e.options),c(e)},!0),kr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?w(e.display)+"px":"0",e.refresh()},!0),kr("coverGutterNextToScrollbar",!1,v,!0),kr("lineNumbers",!1,function(e){h(e.options),c(e)},!0),kr("firstLineNumber",1,c,!0),kr("lineNumberFormatter",function(e){return e},c,!0),kr("showCursorWhenSelecting",!1,yt,!0),kr("resetSelectionOnContextMenu",!0),kr("readOnly",!1,function(e,t){"nocursor"==t?(Zn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||In(e))}),kr("disableInput",!1,function(e,t){t||In(e)},!0),kr("dragDrop",!0),kr("cursorBlinkRate",530),kr("cursorScrollMargin",0),kr("cursorHeight",1,yt,!0),kr("singleCursorHeightPerLine",!0,yt,!0),kr("workTime",100),kr("workDelay",100),kr("flattenSpans",!0,r,!0),kr("addModeClass",!1,r,!0),kr("pollInterval",100),kr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),kr("historyEventDelay",1250),kr("viewportMargin",10,function(e){e.refresh()},!0),kr("maxHighlightLength",1e4,r,!0),kr("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),kr("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),kr("autofocus",null);var Pa=e.modes={},Fa=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Pa[t]=n},e.defineMIME=function(e,t){Fa[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Fa.hasOwnProperty(t))t=Fa[t];else if(t&&"string"==typeof t.name&&Fa.hasOwnProperty(t.name)){var n=Fa[t.name];"string"==typeof n&&(n={name:n}),t=mo(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=Pa[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if($a.hasOwnProperty(n.name)){var o=$a[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var $a=e.modeExtensions={};e.extendMode=function(e,t){var n=$a.hasOwnProperty(e)?$a[e]:$a[e]={};go(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){rs.prototype[e]=t},e.defineOption=kr;var Ua=[];e.defineInitHook=function(e){Ua.push(e)};var ja=e.helpers={};e.registerHelper=function(t,n,r){ja.hasOwnProperty(t)||(ja[t]=e[t]={_global:[]}),ja[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),ja[t]._global.push({pred:r,val:i})};var Va=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},Ba=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var Wa=e.commands={selectAll:function(e){e.setSelection(ya(e.firstLine(),0),ya(e.lastLine()),ms)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ms)},killLine:function(e){Sr(e,function(t){if(t.empty()){var n=Mi(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ya(t.head.line+1,0)}:{from:t.head,to:ya(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Sr(e,function(t){return{from:ya(t.from().line,0),to:Z(e.doc,ya(t.to().line+1,0))}})},delLineLeft:function(e){Sr(e,function(e){return{from:ya(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(ya(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(ya(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return Bo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return Ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return Wo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},vs)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},vs)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ho(e,t.head):r},vs)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=ys(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){cn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Mi(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ya(i.line,i.ch-1)),i.ch>0)i=new ya(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ya(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Mi(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),ya(i.line-1,a.length-1),ya(i.line,1),"+transpose")}n.push(new X(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){cn(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0),_r(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Ha=e.keyMap={};Ha.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"},Ha.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","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"},Ha.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",fallthrough:["basic","emacsy"]},Ha.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},Ha["default"]=da?Ha.macDefault:Ha.pcDefault;var qa=e.lookupKey=function(e,t,n){function r(t){t=xr(t);var i=t[e];if(i===!1)return"stop";if(null!=i&&n(i))return!0;if(t.nofallthrough)return"stop";var o=t.fallthrough;if(null==o)return!1;if("[object Array]"!=Object.prototype.toString.call(o))return r(o);for(var a=0;a<o.length;++a){var s=r(o[a]);if(s)return s}return!1}for(var i=0;i<t.length;++i){var o=r(t[i]);if(o)return"stop"!=o}},za=e.isModifierKey=function(e){var t=As[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},Ga=e.keyName=function(e,t){if(ia&&34==e.keyCode&&e["char"])return!1;var n=As[e.keyCode];return null==n||e.altGraphKey?!1:(e.altKey&&(n="Alt-"+n),(ha?e.metaKey:e.ctrlKey)&&(n="Ctrl-"+n),(ha?e.ctrlKey:e.metaKey)&&(n="Cmd-"+n),!t&&e.shiftKey&&(n="Shift-"+n),n)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Io();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(cs(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var s=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=s}}catch(l){}}t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c.save=r,c.getTextArea=function(){return t},c.toTextArea=function(){c.toTextArea=isNaN,r(),t.parentNode.removeChild(c.getWrapperElement()),t.style.display="",t.form&&(us(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))},c};var Ka=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Ka.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},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.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ys(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ys(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return ys(this.string,null,this.tabSize)-(this.lineStart?ys(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var Xa=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e};so(Xa),Xa.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Zt(e),ao(this,"clear")){var n=this.find();n&&no(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Ar(a.markedSpans,this);e&&!this.collapsed?gn(e,Ai(a),"text"):e&&(null!=s.to&&(i=Ai(a)),null!=s.from&&(r=Ai(a))),a.markedSpans=Nr(a.markedSpans,s),null==s.from&&this.collapsed&&!ni(this.doc,a)&&e&&Ri(a,Qt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=Jr(this.lines[o]),c=p(l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&mn(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ft(e.doc)),e&&no(e,"markerCleared",e,this),t&&tn(e),this.parent&&this.parent.clear()}},Xa.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ar(o.markedSpans,this);if(null!=a.from&&(n=ya(t?o:Ai(o),a.from),-1==e))return n;if(null!=a.to&&(r=ya(t?o:Ai(o),a.to),1==e))return r}return n&&{from:n,to:r}},Xa.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&cn(n,function(){var r=e.line,i=Ai(e.line),o=Rt(n,i);if(o&&($t(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ni(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var s=oi(t)-a;s&&Ri(r,r.height+s)}})},Xa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=fo(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Xa.prototype.detachLine=function(e){if(this.lines.splice(fo(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var Ya=0,Qa=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};so(Qa),Qa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();no(this,"clear")}},Qa.prototype.find=function(e,t){return this.primary.find(e,t)};var Ja=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=e,this.node=t};so(Ja),Ja.prototype.clear=function(){var e=this.cm,t=this.line.widgets,n=this.line,r=Ai(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=oi(this);cn(e,function(){ii(e,n,-o),gn(e,r,"widget"),Ri(n,Math.max(0,n.height-o))})}},Ja.prototype.changed=function(){var e=this.height,t=this.cm,n=this.line;this.height=null;var r=oi(this)-e;r&&cn(t,function(){t.curOp.forceUpdate=!0,ii(t,n,r),Ri(n,n.height+r)})};var Za=e.Line=function(e,t,n){this.text=e,Hr(this,t),this.height=n?n(this):1};so(Za),Za.prototype.lineNo=function(){return Ai(this)};var es={},ts={};ki.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,li(i),no(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},xi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ki))){var s=[];this.collapse(s),this.children=[new ki(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new ki(a);i.height-=s.height,this.children.splice(r+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new xi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=fo(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new xi(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ns=0,rs=e.Doc=function(e,t,n){if(!(this instanceof rs))return new rs(e,t,n);null==n&&(n=0),xi.call(this,[new ki([new Za("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=ya(n,0);this.sel=Q(r),this.history=new $i(null),this.id=++ns,this.modeOption=t,"string"==typeof e&&(e=Ms(e)),Ii(this,{from:r,to:r,text:e}),ut(this,Q(r),ms)};rs.prototype=mo(xi.prototype,{constructor:rs,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Li(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:pn(function(e){var t=ya(this.first,0),n=this.first+this.size-1;sr(this,{from:t,to:ya(n,Mi(this,n).text.length),text:Ms(e),origin:"setValue"},!0),ut(this,Q(t))}),replaceRange:function(e,t,n,r){t=Z(this,t),n=n?Z(this,n):t,fr(this,e,t,n,r)},getRange:function(e,t,n){var r=Oi(this,Z(this,e),Z(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return tt(this,e)?Mi(this,e):void 0},getLineNumber:function(e){return Ai(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Mi(this,e)),Jr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Z(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:pn(function(e,t,n){st(this,Z(this,"number"==typeof e?ya(e,t||0):e),null,n)}),setSelection:pn(function(e,t,n){st(this,Z(this,e),Z(this,t||e),n)}),extendSelection:pn(function(e,t,n){it(this,Z(this,e),t&&Z(this,t),n)}),extendSelections:pn(function(e,t){ot(this,nt(this,e,t))}),extendSelectionsBy:pn(function(e,t){ot(this,ho(this.sel.ranges,e),t)}),setSelections:pn(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new X(Z(this,e[r].anchor),Z(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ut(this,Y(i,t),n)}}),addSelection:pn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new X(Z(this,e),Z(this,t||e))),ut(this,Y(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Oi(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Oi(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n")),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:pn(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Ms(e[o]),origin:n}}for(var s=t&&"end"!=t&&or(this,r,t),o=r.length-1;o>=0;o--)sr(this,r[o]);s?ct(this,s):this.cm&&_r(this.cm)}),undo:pn(function(){cr(this,"undo")}),redo:pn(function(){cr(this,"redo")}),undoSelection:pn(function(){cr(this,"undo",!0)}),redoSelection:pn(function(){cr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new $i(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Xi(this.history.done),undone:Xi(this.history.undone)}},setHistory:function(e){var t=this.history=new $i(this.history.maxGeneration);t.done=Xi(e.done.slice(0),null,!0),t.undone=Xi(e.undone.slice(0),null,!0)},addLineClass:pn(function(e,t,n){return wr(this,e,"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[r]){if(new RegExp("(?:^|\\s)"+n+"(?:$|\\s)").test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:pn(function(e,t,n){return wr(this,e,"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(new RegExp("(?:^|\\s+)"+n+"(?:$|\\s+)"));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(e,t,n){return Tr(this,Z(this,e),Z(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};return e=Z(this,e),Tr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Z(this,e);var t=[],n=Mi(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Z(this,e),t=Z(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];i==e.line&&e.ch>l.to||null==l.from&&i!=e.line||i==t.line&&l.from>t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,void++n)}),Z(this,ya(n,t))},indexFromPos:function(e){e=Z(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new rs(Li(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new rs(Li(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Or(r,Mr(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Lr(Mr(this));break}}if(t.history==this.history){var i=[t.id];Ti(t,function(e){i.push(e.id)},!0),t.history=new $i(null),t.history.done=Xi(this.history.done,i),t.history.undone=Xi(this.history.undone,i)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),rs.prototype.eachLine=rs.prototype.iter;var is="iter insert remove copy getEditor".split(" ");for(var os in rs.prototype)rs.prototype.hasOwnProperty(os)&&fo(is,os)<0&&(e.prototype[os]=function(e){return function(){return e.apply(this.doc,arguments)}}(rs.prototype[os]));so(rs);var as=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},ss=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},ls=e.e_stop=function(e){as(e),ss(e)},cs=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},us=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},ds=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},ps=null,fs=30,hs=e.Pass={toString:function(){return"CodeMirror.Pass"}},ms={scroll:!1},gs={origin:"*mouse"},vs={origin:"+move"};lo.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ys=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var s=e.indexOf(" ",o);if(0>s||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}},_s=[""],bs=function(e){e.select()};ca?bs=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Zo&&(bs=function(e){try{e.select()}catch(t){}}),[].indexOf&&(fo=function(e,t){return e.indexOf(t)}),[].map&&(ho=function(e,t){return e.map(t)});var Es,ws=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ss=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ws.test(e))},Cs=/[\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]/;Es=document.createRange?function(e,t,n){var r=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}:function(e,t,n){var r=document.body.createTextRange();return r.moveToElementText(e.parentNode),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r},Zo&&11>ea&&(Io=function(){try{return document.activeElement}catch(e){return document.body}});var Is,ks,xs,Ts=!1,Ds=function(){if(Zo&&9>ea)return!1;var e=Eo("div");return"draggable"in e||"dragDrop"in e}(),Ms=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Os=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Ls=function(){var e=Eo("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Rs=null,As={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=As,function(){for(var e=0;10>e;e++)As[e+48]=As[e+96]=String(e);for(var e=65;90>=e;e++)As[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)As[e+111]=As[e+63235]="F"+e
7}();var Ns,Ps=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,d=[],p=0;u>p;++p)d.push(r=e(n.charCodeAt(p)));for(var p=0,f=c;u>p;++p){var r=d[p];"m"==r?d[p]=f:f=r}for(var p=0,h=c;u>p;++p){var r=d[p];"1"==r&&"r"==h?d[p]="n":a.test(r)&&(h=r,"r"==r&&(d[p]="R"))}for(var p=1,f=d[0];u-1>p;++p){var r=d[p];"+"==r&&"1"==f&&"1"==d[p+1]?d[p]="1":","!=r||f!=d[p+1]||"1"!=f&&"n"!=f||(d[p]=f),f=r}for(var p=0;u>p;++p){var r=d[p];if(","==r)d[p]="N";else if("%"==r){for(var m=p+1;u>m&&"%"==d[m];++m);for(var g=p&&"!"==d[p-1]||u>m&&"1"==d[m]?"1":"N",v=p;m>v;++v)d[v]=g;p=m-1}}for(var p=0,h=c;u>p;++p){var r=d[p];"L"==h&&"1"==r?d[p]="L":a.test(r)&&(h=r)}for(var p=0;u>p;++p)if(o.test(d[p])){for(var m=p+1;u>m&&o.test(d[m]);++m);for(var y="L"==(p?d[p-1]:c),_="L"==(u>m?d[m]:c),g=y||_?"L":"R",v=p;m>v;++v)d[v]=g;p=m-1}for(var b,E=[],p=0;u>p;)if(s.test(d[p])){var w=p;for(++p;u>p&&s.test(d[p]);++p);E.push(new t(0,w,p))}else{var S=p,C=E.length;for(++p;u>p&&"L"!=d[p];++p);for(var v=S;p>v;)if(l.test(d[v])){v>S&&E.splice(C,0,new t(1,S,v));var I=v;for(++v;p>v&&l.test(d[v]);++v);E.splice(C,0,new t(2,I,v)),S=v}else++v;p>S&&E.splice(C,0,new t(1,S,p))}return 1==E[0].level&&(b=n.match(/^\s+/))&&(E[0].from=b[0].length,E.unshift(new t(0,0,b[0].length))),1==po(E).level&&(b=n.match(/\s+$/))&&(po(E).to-=b[0].length,E.push(new t(0,u-b[0].length,u))),E[0].level!=po(E).level&&E.push(new t(E[0].level,u,u)),E}}();return e.version="4.6.1",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/fold/xml-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(p(e.line,t));return n&&/\btag\b/.test(n)}function i(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function o(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(r(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 u(e,t){for(var n=[];;){var r,i=l(e),o=e.line,s=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(0>c&&(!t||t==i[2]))return{tag:i[2],from:p(o,s),to:p(e.line,e.ch)}}else n.push(i[2])}}function d(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=s(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:p(e.line,e.ch),to:p(i,o)}}}else s(e)}}var p=e.Pos,f="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=f+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+f+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=l(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=p(r.line,r.ch),s=u(r,o[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),c=l&&p(o.line,o.ch),f=l&&s(o);if(l&&f&&!(t(o,r)>0)){var h={from:p(o.line,o.ch),to:c,tag:f[2]};return"selfClose"==l?{open:h,close:null,at:"open"}:f[1]?{open:d(o,f[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,f[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=d(i);if(!o)break;var a=new n(e,t.line,t.ch,r),s=u(a,o.tag);if(s)return{open:o,close:s}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/edit/matchtags",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){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 r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var o=e.findMatchingTag(n,r,i);if(o){if(n.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var s="close"==o.at?o.open:o.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/edit/matchbrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),l=t.ch-1,c=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(l==t.ch))return null;var d=e.getTokenTypeAt(a(t.line,l+1)),p=n(e,a(t.line,l+(u>0?1:0)),u,d||null,i);return null==p?null:{from:a(t.line,l),to:p&&p.pos,match:p&&p.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,d=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),p=t.line;p!=d;p+=n){var f=e.getLine(p);if(f){var h=n>0?0:f.length-1,m=n>0?f.length:-1;if(!(f.length>o))for(p==t.line&&(h=t.ch-(0>n?1:0));h!=m;h+=n){var g=f.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(p,h+1))==r)){var v=s[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(p,h),ch:g};c.pop()}}}}}return p-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c<l.length;c++){var u=l[c].empty()&&t(e,l[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var d=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:d})),u.to&&e.getLine(u.to.line).length<=i&&s.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:d}))}}if(s.length){o&&e.state.focused&&e.display.input.focus();var p=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!n)return p;setTimeout(p,800)}}function i(e){e.operation(function(){l&&(l(),l=null),l=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/edit/closebrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var n=e.getRange(l(t.line,t.ch-1),l(t.line,t.ch+1));return 2==n.length?n:null}function n(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var s=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function r(r){for(var i={name:"autoCloseBrackets",Backspace:function(n){if(n.getOption("disableInput"))return e.Pass;for(var i=n.listSelections(),o=0;o<i.length;o++){if(!i[o].empty())return e.Pass;var a=t(n,i[o].head);if(!a||r.indexOf(a)%2!=0)return e.Pass}for(var o=i.length-1;o>=0;o--){var s=i[o].head;n.replaceRange("",l(s.line,s.ch-1),l(s.line,s.ch+1))}}},o="",a=0;a<r.length;a+=2)(function(t,r){t!=r&&(o+=r),i["'"+t+"'"]=function(i){if(i.getOption("disableInput"))return e.Pass;for(var a,c,u=i.listSelections(),d=0;d<u.length;d++){var p,f=u[d],h=f.head,c=i.getRange(h,l(h.line,h.ch+1));if(f.empty())if(t==r&&c==r)p=i.getRange(h,l(h.line,h.ch+3))==t+t+t?"skipThree":"skip";else if(t==r&&h.ch>1&&i.getRange(l(h.line,h.ch-2),h)==t+t&&(h.ch<=2||i.getRange(l(h.line,h.ch-3),l(h.line,h.ch-2))!=t))p="addFour";else if('"'==t||"'"==t){if(e.isWordChar(c)||!n(i,h,t))return e.Pass;p="both"}else{if(!(i.getLine(h.line).length==h.ch||o.indexOf(c)>=0||s.test(c)))return e.Pass;p="both"}else p="surround";if(a){if(a!=p)return e.Pass}else a=p}i.operation(function(){if("skip"==a)i.execCommand("goCharRight");else if("skipThree"==a)for(var e=0;3>e;e++)i.execCommand("goCharRight");else if("surround"==a){for(var n=i.getSelections(),e=0;e<n.length;e++)n[e]=t+n[e]+r;i.replaceSelections(n,"around")}else"both"==a?(i.replaceSelection(t+r,null),i.execCommand("goCharLeft")):"addFour"==a&&(i.replaceSelection(t+t+t+t,"before"),i.execCommand("goCharRight"))})},t!=r&&(i["'"+r+"'"]=function(t){for(var n=t.listSelections(),i=0;i<n.length;i++){var o=n[i];if(!o.empty()||t.getRange(o.head,l(o.head.line,o.head.ch+1))!=r)return e.Pass}t.execCommand("goCharRight")})})(r.charAt(a),r.charAt(a+1));return i}function i(n){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var i=r.listSelections(),o=0;o<i.length;o++){if(!i[o].empty())return e.Pass;var a=t(r,i[o].head);if(!a||n.indexOf(a)%2!=0)return e.Pass}r.operation(function(){r.replaceSelection("\n\n",null),r.execCommand("goCharLeft"),i=r.listSelections();for(var e=0;e<i.length;e++){var t=i[e].head.line;r.indentLine(t,null,!0),r.indentLine(t+1,null,!0)}})}}var o="()[]{}''\"\"",a="[]{}",s=/\s/,l=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,s){if(s!=e.Init&&s&&t.removeKeyMap("autoCloseBrackets"),n){var l=o,c=a;"string"==typeof n?l=n:"object"==typeof n&&(null!=n.pairs&&(l=n.pairs),null!=n.explode&&(c=n.explode));var u=r(l);c&&(u.Enter=i(c)),t.addKeyMap(u)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/edit/closetag",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),s=[],l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var c=n[l].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),p=d.state;if("xml"!=d.mode.name||!p.tagName)return e.Pass;var f=t.getOption("autoCloseTags"),h="html"==d.mode.configuration,m="object"==typeof f&&f.dontCloseTags||h&&o,g="object"==typeof f&&f.indentTags||h&&a,v=p.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==p.type||u.string.indexOf("/")==u.string.length-1||m&&r(m,y)>-1||i(t,v,c,p,!0))return e.Pass;var _=g&&r(g,y)>-1;s[l]={indent:_,text:">"+(_?"\n\n":"")+"</"+v+">",newPos:_?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var b=s[l];t.replaceRange(b.text,n[l].head,n[l].anchor,"+insert");var E=t.listSelections().slice(0);E[l]={head:b.newPos,anchor:b.newPos},t.setSelections(E),b.indent&&(t.indentLine(b.newPos.line,null,!0),t.indentLine(b.newPos.line+1,null,!0))}}function n(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),r=[],o=0;o<n.length;o++){if(!n[o].empty())return e.Pass;var a=n[o].head,s=t.getTokenAt(a),l=e.innerMode(t.getMode(),s.state),c=l.state;if("string"==s.type||"<"!=s.string.charAt(0)||s.start!=a.ch-1)return e.Pass;if("xml"!=l.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==l.mode.name)r[o]="/script>";else{if("htmlmixed"!=t.getMode().name||"css"!=l.mode.name)return e.Pass;r[o]="/style>"}else{if(!c.context||!c.context.tagName||i(t,c.context.tagName,a,c))return e.Pass;r[o]="/"+c.context.tagName+">"}}t.replaceSelections(r),n=t.listSelections();for(var o=0;o<n.length;o++)(o==n.length-1||n[o].head.line<n[o+1].head.line)&&t.indentLine(n[o].head.line)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function i(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),s=e.scanForClosingTag(t,r,null,a);if(!s||s.tag!=n)return!1;for(var l=i.context,c=o?1:0;l&&l.tagName==n;l=l.prev)++c;r=s.to;for(var u=1;c>u;u++){var d=e.scanForClosingTag(t,r,null,a);if(!d||d.tag!=n)return!1;r=d.to}return!0}e.defineOption("autoCloseTags",!1,function(r,i,o){if(o!=e.Init&&o&&r.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var o=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=["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(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/scroll/scrollpastend",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t,r){e.changeEnd(r).line==t.lastLine()&&n(t)}function n(e){var t="";if(e.lineCount()>1){var n=e.display.scroller.clientHeight-30,r=e.getLineHandle(e.lastLine()).height;t=n-r+"px"}e.state.scrollPastEndPadding!=t&&(e.state.scrollPastEndPadding=t,e.display.lineSpace.parentNode.style.paddingBottom=t,e.setSize())}e.defineOption("scrollPastEnd",!1,function(r,i,o){o&&o!=e.Init&&(r.off("change",t),r.off("refresh",n),r.display.lineSpace.parentNode.style.paddingBottom="",r.state.scrollPastEndPadding=null),i&&(r.on("change",t),r.on("refresh",n),n(r))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/selection/active-line",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function r(e,r){for(var i=[],s=0;s<r.length;s++){var l=r[s];if(l.empty()){var c=e.getLineHandleVisualStart(l.head.line);i[i.length-1]!=c&&i.push(c)}}n(e.state.activeLines,i)||e.operation(function(){t(e);for(var n=0;n<i.length;n++)e.addLineClass(i[n],"wrap",o),e.addLineClass(i[n],"background",a);e.state.activeLines=i})}function i(e,t){r(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){var s=a&&a!=e.Init;o&&!s?(n.state.activeLines=[],r(n,n.listSelections()),n.on("beforeSelectionChange",i)):!o&&s&&(n.off("beforeSelectionChange",i),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/selection/mark-selection",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.operation(function(){a(e)})}function n(e){e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){if(0!=c(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var u=a==t.line?t:l(a,0),d=a+s,p=d>=n.line,f=p?n:l(d,0),h=e.markText(u,f,{className:o});if(null==r?i.push(h):i.splice(r++,0,h),p)break;a=d}}function i(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){i(e);for(var t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function a(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var l=a[0].find(),u=a[a.length-1].find();if(!l||!u||n.line-t.line<s||c(t,u.to)>=0||c(n,l.from)<=0)return o(e);for(;c(t,l.from)>0;)a.shift().clear(),l=a[0].find();for(c(t,l.from)<0&&(l.to.line-t.line<s?(a.shift().clear(),r(e,t,l.to,0)):r(e,t,l.from,0));c(n,u.to)<0;)a.pop().clear(),u=a[a.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<s?(a.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(r,a,s){var l=s&&s!=e.Init;a&&!l?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof a?a:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!a&&l&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});var s=8,l=e.Pos,c=e.cmpPos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/mode/multiplex",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.multiplexingMode=function(t){function n(e,t,n){if("string"==typeof t)return e.indexOf(t,n);var r=t.exec(n?e.slice(n):e);return r?r.index+n:-1}var r=Array.prototype.slice.call(arguments,1),i=r.length;return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(o,a){if(a.innerActive){var s=a.innerActive,l=o.string;if(!s.close&&o.sol())return a.innerActive=a.inner=null,this.token(o,a);var c=s.close?n(l,s.close,o.pos):-1;if(c==o.pos)return o.match(s.close),a.innerActive=a.inner=null,s.delimStyle;c>-1&&(o.string=l.slice(0,c));var u=s.mode.token(o,a.inner);return c>-1&&(o.string=l),s.innerStyle&&(u=u?u+" "+s.innerStyle:s.innerStyle),u}for(var d=1/0,l=o.string,p=0;i>p;++p){var f=r[p],c=n(l,f.open,o.pos);if(c==o.pos)return o.match(f.open),a.innerActive=f,a.inner=e.startState(f.mode,t.indent?t.indent(a.outer,""):0),f.delimStyle;-1!=c&&d>c&&(d=c)}1/0!=d&&(o.string=l.slice(0,d));var h=t.token(o,a.outer);return 1/0!=d&&(o.string=l),h},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var o=n.innerActive?n.innerActive.mode:t;if(o.blankLine&&o.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var a=0;i>a;++a){var s=r[a];"\n"===s.open&&(n.innerActive=s,n.inner=e.startState(s.mode,o.indent?o.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/mode/overlay",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,lineSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e.sol()||e.string!=i.lineSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.lineSeen=e.string,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/search/match-highlighter",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly),null==this.style&&(this.style=l),null==this.minChars&&(this.minChars=s),null==this.delay&&(this.delay=c),null==this.wordsOnly&&(this.wordsOnly=u),this.overlay=this.timeout=null}function n(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){r(e)},t.delay)}function r(e){e.operation(function(){var t=e.state.matchHighlighter;if(t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null),!e.somethingSelected()&&t.showToken){for(var n=t.showToken===!0?/[\w$]/:t.showToken,r=e.getCursor(),o=e.getLine(r.line),s=r.ch,l=s;s&&n.test(o.charAt(s-1));)--s;for(;l<o.length&&n.test(o.charAt(l));)++l;return void(l>s&&e.addOverlay(t.overlay=a(o.slice(s,l),n,t.style)))}var c=e.getCursor("from"),u=e.getCursor("to");if(c.line==u.line&&(!t.wordsOnly||i(e,c,u))){var d=e.getRange(c,u).replace(/^\s+|\s+$/g,"");d.length>=t.minChars&&e.addOverlay(t.overlay=a(d,!1,t.style))}})}function i(e,t,n){var r=e.getRange(t,n);if(null!==r.match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.ch<e.getLine(t.line).length){var i={line:n.line,ch:n.ch+1},o=e.getRange(n,i);if(null===o.match(/\W/))return!1}return!0}return!1}function o(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function a(e,t,n){return{token:function(r){return!r.match(e)||t&&!o(r,t)?(r.next(),void(r.skipTo(e.charAt(0))||r.skipToEnd())):n}}}var s=2,l="matchhighlight",c=100,u=!1;e.defineOption("highlightSelectionMatches",!1,function(i,o,a){if(a&&a!=e.Init){var s=i.state.matchHighlighter.overlay;s&&i.removeOverlay(s),clearTimeout(i.state.matchHighlighter.timeout),i.state.matchHighlighter=null,i.off("cursorActivity",n)}o&&(i.state.matchHighlighter=new t(o),r(i),i.on("cursorActivity",n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):r(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){t.lastIndex=0;for(var o,a,s=e.getLine(i.line).slice(0,i.ch),l=0;;){t.lastIndex=l;var c=t.exec(s);if(!c)break;if(o=c,a=o.index,l=o.index+(o[0].length||1),l==s.length)break}var u=o&&o[0].length||0;u||(0==a&&0==s.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var s=e.getLine(i.line),o=t.exec(s),u=o&&o[0].length||0,a=o&&o.index;a+u==s.length||u||(u=1)}return o&&u?{from:r(i.line,a),to:r(i.line,a+u),match:o}:void 0};else{var a=t;o&&(t=t.toLowerCase());var s=o?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)this.matches=t.length?function(i,o){if(i){var l=e.getLine(o.line).slice(0,o.ch),c=s(l),u=c.lastIndexOf(t);if(u>-1)return u=n(l,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var l=e.getLine(o.line).slice(o.ch),c=s(l),u=c.indexOf(t);if(u>-1)return u=n(l,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=l.length-1;if(t){if(n.line-(l.length-1)<e.firstLine())return;if(s(e.getLine(n.line).slice(0,c[i].length))!=l[l.length-1])return;for(var o=r(n.line,c[i].length),a=n.line-1,u=i-1;u>=1;--u,--a)if(l[u]!=s(e.getLine(a)))return;var d=e.getLine(a),p=d.length-c[0].length;if(s(d.slice(p))!=l[0])return;return{from:r(a,p),to:o}}if(!(n.line+(l.length-1)>e.lastLine())){var d=e.getLine(n.line),p=d.length-c[0].length;if(s(d.slice(p))==l[0]){for(var f=r(n.line,p),a=n.line+1,u=1;i>u;++u,++a)if(l[u]!=s(e.getLine(a)))return;if(s(e.getLine(a).slice(0,c[i].length))==l[i])return{from:f,to:r(a,c[i].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(n>i)++r;else{if(!(i>n))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var n=e.splitLines(t);this.doc.replaceRange(n,this.pos.from,this.pos.to),this.pos.to=r(this.pos.from.line+n.length-1,n[n.length-1].length+(1==n.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r,i=[],o=this.getSearchCursor(t,this.getCursor("from"),n);(r=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)i.push({anchor:o.from(),head:o.to()});i.length&&this.setSelections(i,0)})}),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("thirdparty/CodeMirror2/keymap/sublime",["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(p(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(p(n.line+1,0));for(var o,a="start",s=n.ch,l=0>r?0:i.length,c=0;s!=l;s+=r,c++){var u=i.charAt(0>r?s-1:s),d="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==d&&u.toUpperCase()==u&&(d="W"),"start"==a)"o"!=d&&(a="in",o=d);else if("in"==a&&o!=d){if("w"==o&&"W"==d&&0>r&&s--,"W"==o&&"w"==d&&r>0){o="w";continue}break}}return p(n.line,s)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(e,t){e.operation(function(){for(var n=e.listSelections().length,r=[],i=-1,o=0;n>o;o++){var a=e.listSelections()[o].head;if(!(a.line<=i)){var s=p(a.line+(t?0:1),0);e.replaceRange("\n",s,null,"+insertLine"),e.indentLine(s.line,null,!0),r.push({head:s,anchor:s}),i=a.line+1}}e.setSelections(r)})}function i(t,n){for(var r=n.ch,i=r,o=t.getLine(n.line);r&&e.isWordChar(o.charAt(r-1));)--r;for(;i<o.length&&e.isWordChar(o.charAt(i));)++i;return{from:p(n.line,r),to:p(n.line,i),word:o.slice(r,i)}}function o(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==m.charAt(m.indexOf(n.ch)+1))return e.setSelection(p(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=p(r.pos.line,r.pos.ch+1)}}function a(e,t){for(var n,r=e.listSelections(),i=[],o=0;o<r.length;o++){var a=r[o];if(!a.empty()){for(var s=a.from().line,l=a.to().line;o<r.length-1&&r[o+1].from().line==l;)l=a[++o].to().line;i.push(s,l)}}i.length?n=!0:i.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var r=[],o=0;o<i.length;o+=2){var a=i[o],s=i[o+1],l=p(a,0),c=p(s),u=e.getRange(l,c,!1);t?u.sort():u.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),e.replaceRange(u,l,c),n&&r.push({anchor:l,head:c})}n&&e.setSelections(r,0)})}function s(t,n){t.operation(function(){for(var r=t.listSelections(),o=[],a=[],s=0;s<r.length;s++){var l=r[s];l.empty()?(o.push(s),a.push("")):a.push(n(t.getRange(l.from(),l.to())))}t.replaceSelections(a,"around","case");for(var c,s=o.length-1;s>=0;s--){var l=r[o[s]];if(!(c&&e.cmpPos(l.head,c)>0)){var u=i(t,l.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}})}function l(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=l(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?p(e.firstLine(),0):e.clipPos(p(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},d=e.commands,p=e.Pos,f=e.keyMap["default"]==e.keyMap.macDefault,h=f?"Cmd-":"Ctrl-";d[u["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},d[u["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)},d[u[h+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},d[u[h+"Down"]="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")
8}e.scrollTo(null,t.top+e.defaultTextHeight())},d[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var i=t[r].from(),o=t[r].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:p(a,0),head:a==o.line?o:p(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",d[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},d[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r];n.push({anchor:p(i.from().line,0),head:p(i.to().line+1,0)})}e.setSelections(n)},u["Shift-"+h+"K"]="deleteLine",d[u[h+"Enter"]="insertLineAfter"]=function(e){r(e,!1)},d[u["Shift-"+h+"Enter"]="insertLineBefore"]=function(e){r(e,!0)},d[u[h+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),o=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=i(t,n);if(!a.word)return;t.setSelection(a.from,a.to),o=!0}else{var s=t.getRange(n,r),l=o?new RegExp("\\b"+s+"\\b"):s,c=t.getSearchCursor(l,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(l,p(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}o&&(t.state.sublimeFindFullWord=t.doc.sel)};var m="(){}[]";d[u["Shift-"+h+"Space"]="selectScope"]=function(e){o(e)||e.execCommand("selectAll")},d[u["Shift-"+h+"M"]="selectBetweenBrackets"]=function(t){return o(t)?void 0:e.Pass},d[u[h+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var i=t.scanForBracket(n.head,-1);return i&&p(i.pos.line,i.pos.ch+1)||n.head})};var g=f?"Cmd-Ctrl-":"Shift-Ctrl-";d[u[g+"Up"]="swapLineUp"]=function(e){for(var t=e.listSelections(),n=[],r=e.firstLine()-1,i=[],o=0;o<t.length;o++){var a=t[o],s=a.from().line-1,l=a.to().line;i.push({anchor:p(a.anchor.line-1,a.anchor.ch),head:p(a.head.line-1,a.head.ch)}),0!=a.to().ch||a.empty()||--l,s>r?n.push(s,l):n.length&&(n[n.length-1]=l),r=l}e.operation(function(){for(var t=0;t<n.length;t+=2){var r=n[t],o=n[t+1],a=e.getLine(r);e.replaceRange("",p(r,0),p(r+1,0),"+swapLine"),o>e.lastLine()?e.replaceRange("\n"+a,p(e.lastLine()),null,"+swapLine"):e.replaceRange(a+"\n",p(o,0),null,"+swapLine")}e.setSelections(i),e.scrollIntoView()})},d[u[g+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],r=e.lastLine()+1,i=t.length-1;i>=0;i--){var o=t[i],a=o.to().line+1,s=o.from().line;0!=o.to().ch||o.empty()||a--,r>a?n.push(a,s):n.length&&(n[n.length-1]=s),r=s}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var r=n[t],i=n[t+1],o=e.getLine(r);r==e.lastLine()?e.replaceRange("",p(r-1),p(r),"+swapLine"):e.replaceRange("",p(r,0),p(r+1,0),"+swapLine"),e.replaceRange(o+"\n",p(i,0),null,"+swapLine")}e.scrollIntoView()})},u[h+"/"]="toggleComment",d[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var i=t[r],o=i.from(),a=o.line,s=i.to().line;r<t.length-1&&t[r+1].from().line==s;)s=t[++r].to().line;n.push({start:a,end:s,anchor:!i.empty()&&o})}e.operation(function(){for(var t=0,r=[],i=0;i<n.length;i++){for(var o,a=n[i],s=a.anchor&&p(a.anchor.line-t,a.anchor.ch),l=a.start;l<=a.end;l++){var c=l-t;l==a.end&&(o=p(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",p(c),p(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}r.push({anchor:s||o,head:o})}e.setSelections(r,0)})},d[u["Shift-"+h+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",p(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},u[h+"T"]="transposeChars",d[u.F9="sortLines"]=function(e){a(e,!0)},d[u[h+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},d[u.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},d[u["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},d[u[h+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),a=e.findMarks(i,o),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<n.length;l++)n[l]==a[s]&&n.splice(l--,1);break}s==a.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},d[u["Shift-"+h+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},d[u["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},u["Alt-Q"]="wrapLines";var v=e.keyMap["sublime-Ctrl-K"]={auto:"sublime",nofallthrough:!0};u[h+"K"]=function(e){e.setOption("keyMap","sublime-Ctrl-K")},v[h+"Backspace"]="delLineLeft",d[v[h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,p(t[n].to().line),"+delete");e.scrollIntoView()})},d[v[h+"U"]="upcaseAtCursor"]=function(e){s(e,function(e){return e.toUpperCase()})},d[v[h+"L"]="downcaseAtCursor"]=function(e){s(e,function(e){return e.toLowerCase()})},d[v[h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},d[v[h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},d[v[h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},d[v[h+"X"]="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))},d[v[h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},v[h+"G"]="clearBookmarks",d[v[h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},d[u["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(p(r.head.line-1,r.head.ch))}})},d[u["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(p(r.head.line+1,r.head.ch))}})},d[u[h+"F3"]="findUnder"]=function(e){c(e,!0)},d[u["Shift-"+h+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},d[u["Alt-F3"]="findAllUnder"]=function(e){var t=l(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}},u["Shift-"+h+"["]="fold",u["Shift-"+h+"]"]="unfold",v[h+"0"]=v[h+"j"]="unfoldAll",u[h+"I"]="findIncremental",u["Shift-"+h+"I"]="findIncrementalReverse",u[h+"H"]="replace",u.F3="findNext",u["Shift-F3"]="findPrev"}),define("utils/AppInit",["require","exports","module"],function(e,t){function n(e){try{e()}catch(t){console.error("Exception when calling a 'brackets done loading' handler:"),console.log(t.stack)}}function r(e){var t,r=p[e];for(d[e]=!0,t=0;t<r.length;t++)n(r[t]);p[e]=[]}function i(e,t){d[e]?n(t):p[e].push(t)}function o(e){i(c,e)}function a(e){i(l,e)}function s(e){i(u,e)}var l="htmlReady",c="appReady",u="extensionsLoaded",d={HTML_READY:!1,APP_READY:!1,EXTENSIONS_LOADED:!1},p={};p[l]=[],p[c]=[],p[u]=[],t.appReady=o,t.htmlReady=a,t.extensionsLoaded=s,t.HTML_READY=l,t.APP_READY=c,t.EXTENSIONS_LOADED=u,t._dispatchReady=r}),define("utils/Async",["require","exports","module"],function(e,t){function n(e,t,n){var r=[],i=new $.Deferred;if(0===e.length)i.resolve();else{var o=0,a=!1;e.forEach(function(s,l){var c=t(s,l);r.push(c),c.fail(function(){n?i.reject():a=!0}),c.always(function(){o++,o===e.length&&(a?i.reject():i.resolve())})})}return i.promise()}function r(e,t,n){function r(a){if(a>=e.length)return void(o?i.reject():i.resolve());var s=t(e[a],a);s.done(function(){r(a+1)}),s.fail(function(){n?i.reject():(o=!0,r(a+1))})}var i=new $.Deferred,o=!1;return r(0),i.promise()}function i(e,t,n,i){n=n||15,i=i||30;var o=(new Date).getTime();return r(e,function(e,r){var a=new $.Deferred;return t(e,r),(new Date).getTime()-o>=n?window.setTimeout(function(){o=(new Date).getTime(),a.resolve()},i):a.resolve(),a},!1)}function o(e,t){function n(i){return i>=e.length?void r.reject():void t(e[i],i).fail(function(){n(i+1)}).done(function(){r.resolve(e[i])})}var r=new $.Deferred;return n(0),r.promise()}function a(e,t){var r=[],i=new $.Deferred,o=n(e,function(e,n){var i=t(e,n);return i.fail(function(t){r.push({item:e,error:t})}),i},!1);return o.done(function(){i.resolve()}).fail(function(){i.reject(r)}),i.promise()}function s(e,t,n){var r=new $.Deferred,i=window.setTimeout(function(){n?r.resolve():r.reject(p)},t);return e.always(function(){window.clearTimeout(i)}),e.then(r.resolve,r.reject),r.promise()}function l(e,t,n){var r=new $.Deferred,i=[],o=0,a=!1;return e&&0!==e.length?(t=void 0===t?!1:!0,void 0!==n&&s(r,n),e.forEach(function(n){n.fail(function(){a=!0}).done(function(e){i.push(e)}).always(function(){o++,o===e.length&&(t&&a?r.reject():r.resolve(i))})}),r.promise()):(r.resolve(),r.promise())}function c(e,t){function n(t,i){if(e.length===t)r.resolveWith(null,i);else{var o=e[t++];try{var a=o.apply(null,i);a.hasOwnProperty("done")&&a.hasOwnProperty("fail")?(a.done(function(){n(t,arguments)}),a.fail(function(){r.rejectWith(null,arguments)})):n(t,[a])}catch(s){r.reject(s)}}}var r=$.Deferred();return n(0,t||[]),r.promise()}function u(e,t){var n=new $.Deferred,r=Array.prototype.slice.call(arguments,2);return r.push(function(e){e?n.reject(e):n.resolve.apply(n,Array.prototype.slice.call(arguments,1))}),e[t].apply(e,r),n.promise()}function d(){this._queue=[]}var p={};d.prototype._queue=null,d.prototype._curPromise=null,Object.defineProperties(d.prototype,{length:{get:function(){return this._queue.length},set:function(){throw new Error("Cannot set length")}}}),d.prototype.add=function(e){this._queue.push(e),this._curPromise||this._doNext()},d.prototype.removeAll=function(){this._queue=[]},d.prototype._doNext=function(){var e=this;if(this._queue.length){var t=this._queue.shift();this._curPromise=t(),this._curPromise.always(function(){e._curPromise=null,e._doNext()})}},t.doInParallel=n,t.doSequentially=r,t.doSequentiallyInBackground=i,t.doInParallel_aggregateErrors=a,t.firstSequentially=o,t.withTimeout=s,t.waitForAll=l,t.ERROR_TIMEOUT=p,t.chain=c,t.promisify=u,t.PromiseQueue=d}),function(){function e(e,t,n){n=(n||0)-1;for(var r=e?e.length:0;++n<r;)if(e[n]===t)return n;return-1}function t(t,n){var r=typeof n;if(t=t.l,"boolean"==r||null==n)return t[n]?0:-1;"number"!=r&&"string"!=r&&(r="object");var i="number"==r?n:y+n;return t=(t=t[r])&&t[i],"object"==r?t&&-1<e(t,n)?0:-1:t?0:-1}function n(e){var t=this.l,n=typeof e;if("boolean"==n||null==e)t[e]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?e:y+e,t=t[n]||(t[n]={});"object"==n?(t[r]||(t[r]=[])).push(e):t[r]=!0}}function r(e){return e.charCodeAt(0)}function i(e,t){var n=e.m,r=t.m;if(n!==r){if(n>r||"undefined"==typeof n)return 1;if(r>n||"undefined"==typeof r)return-1}return e.n-t.n}function o(e){var t=-1,r=e.length,i=e[0],o=e[0|r/2],a=e[r-1];if(i&&"object"==typeof i&&o&&"object"==typeof o&&a&&"object"==typeof a)return!1;for(i=l(),i["false"]=i["null"]=i["true"]=i.undefined=!1,o=l(),o.k=e,o.l=i,o.push=n;++t<r;)o.push(e[t]);return o}function a(e){return"\\"+G[e]}function s(){return m.pop()||[]}function l(){return g.pop()||{k:null,l:null,m:null,"false":!1,n:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,o:null}}function c(){}function u(e){e.length=0,m.length<b&&m.push(e)}function d(e){var t=e.l;t&&d(t),e.k=e.l=e.m=e.object=e.number=e.string=e.o=null,g.length<b&&g.push(e)}function p(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);var r=-1;n=n-t||0;for(var i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function f(n){function m(e){if(!e||wn.call(e)!=j)return!1;var t=e.valueOf,n="function"==typeof t&&(n=mn(t))&&mn(n);return n?e==n||mn(e)==n:dt(e)}function g(e,t,n){if(!e||!z[typeof e])return e;t=t&&"undefined"==typeof n?t:nt(t,n,3);for(var r=-1,i=z[typeof e]&&Bn(e),o=i?i.length:0;++r<o&&(n=i[r],!1!==t(e[n],n,e)););return e}function b(e,t,n){var r;if(!e||!z[typeof e])return e;t=t&&"undefined"==typeof n?t:nt(t,n,3);for(r in e)if(!1===t(e[r],r,e))break;return e}function G(e,t,n){var r,i=e,o=i;if(!i)return o;for(var a=arguments,s=0,l="number"==typeof n?2:a.length;++s<l;)if((i=a[s])&&z[typeof i])for(var c=-1,u=z[typeof i]&&Bn(i),d=u?u.length:0;++c<d;)r=u[c],"undefined"==typeof o[r]&&(o[r]=i[r]);return o}function X(e,t,n){var r,i=e,o=i;if(!i)return o;var a=arguments,s=0,l="number"==typeof n?2:a.length;if(l>3&&"function"==typeof a[l-2])var c=nt(a[--l-1],a[l--],2);else l>2&&"function"==typeof a[l-1]&&(c=a[--l]);for(;++s<l;)if((i=a[s])&&z[typeof i])for(var u=-1,d=z[typeof i]&&Bn(i),p=d?d.length:0;++u<p;)r=d[u],o[r]=c?c(o[r],i[r]):i[r];return o}function Y(e){var t,n=[];if(!e||!z[typeof e])return n;for(t in e)gn.call(e,t)&&n.push(t);return n}function Z(e){return e&&"object"==typeof e&&!Vn(e)&&gn.call(e,"__wrapped__")?e:new et(e)}function et(e,t){this.__chain__=!!t,this.__wrapped__=e}function tt(e,t,n,r,i){if(n){var o=n(e);if("undefined"!=typeof o)return o}if(!yt(e))return e;var a=wn.call(e);if(!W[a])return e;var l=$n[a];switch(a){case P:case F:return new l(+e);case U:case B:return new l(e);case V:return o=l(e.source,k.exec(e)),o.lastIndex=e.lastIndex,o}if(a=Vn(e),t){var c=!r;r||(r=s()),i||(i=s());for(var d=r.length;d--;)if(r[d]==e)return i[d];o=a?l(e.length):{}}else o=a?p(e):X({},e);return a&&(gn.call(e,"index")&&(o.index=e.index),gn.call(e,"input")&&(o.input=e.input)),t?(r.push(e),i.push(o),(a?kt:g)(e,function(e,a){o[a]=tt(e,t,n,r,i)}),c&&(u(r),u(i)),o):o}function nt(e,t,n){if("function"!=typeof e)return zt;if("undefined"==typeof t)return e;var r=e.__bindData__||Un.funcNames&&!e.name;if("undefined"==typeof r){var i=O&&hn.call(e);Un.funcNames||!i||x.test(i)||(r=!0),(Un.funcNames||!r)&&(r=!Un.funcDecomp||O.test(i),jn(e,r))}if(!0!==r&&r&&1&r[1])return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return Wt(e,t)}function rt(e,t,n,r){r=(r||0)-1;for(var i=e?e.length:0,o=[];++r<i;){var a=e[r];if(a&&"object"==typeof a&&"number"==typeof a.length&&(Vn(a)||ft(a))){t||(a=rt(a,t,n));var s=-1,l=a.length,c=o.length;for(o.length+=l;++s<l;)o[c++]=a[s]}else n||o.push(a)}return o}function it(e,t,n,r,i,o){if(n){var a=n(e,t);if("undefined"!=typeof a)return!!a}if(e===t)return 0!==e||1/e==1/t;if(e===e&&!(e&&z[typeof e]||t&&z[typeof t]))return!1;if(null==e||null==t)return e===t;var l=wn.call(e),c=wn.call(t);if(l==A&&(l=j),c==A&&(c=j),l!=c)return!1;switch(l){case P:case F:return+e==+t;case U:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case V:case B:return e==on(t)}if(c=l==N,!c){if(gn.call(e,"__wrapped__")||gn.call(t,"__wrapped__"))return it(e.__wrapped__||e,t.__wrapped__||t,n,r,i,o);if(l!=j)return!1;var l=e.constructor,d=t.constructor;if(l!=d&&!(vt(l)&&l instanceof l&&vt(d)&&d instanceof d))return!1}for(d=!i,i||(i=s()),o||(o=s()),l=i.length;l--;)if(i[l]==e)return o[l]==t;var p=0,a=!0;if(i.push(e),o.push(t),c){if(l=e.length,p=t.length,a=p==e.length,!a&&!r)return a;for(;p--;)if(c=l,d=t[p],r)for(;c--&&!(a=it(e[c],d,n,r,i,o)););else if(!(a=it(e[p],d,n,r,i,o)))break;return a}return b(t,function(t,s,l){return gn.call(l,s)?(p++,a=gn.call(e,s)&&it(e[s],t,n,r,i,o)):void 0}),a&&!r&&b(e,function(e,t,n){return gn.call(n,t)?a=-1<--p:void 0}),d&&(u(i),u(o)),a}function ot(e,t,n,r,i){(Vn(t)?kt:g)(t,function(t,o){var a,s,l=t,c=e[o];if(t&&((s=Vn(t))||m(t))){for(l=r.length;l--;)if(a=r[l]==t){c=i[l];break}if(!a){var u;n&&(l=n(c,t),u="undefined"!=typeof l)&&(c=l),u||(c=s?Vn(c)?c:[]:m(c)?c:{}),r.push(t),i.push(c),u||ot(c,t,n,r,i)}}else n&&(l=n(c,t),"undefined"==typeof l&&(l=t)),"undefined"!=typeof l&&(c=l);e[o]=c})}function at(n,r,i){var a=-1,l=ut(),c=n?n.length:0,p=[],f=!r&&c>=_&&l===e,h=i||f?s():p;if(f){var m=o(h);m?(l=t,h=m):(f=!1,h=i?h:(u(h),p))}for(;++a<c;){var m=n[a],g=i?i(m,a,n):m;(r?!a||h[h.length-1]!==g:0>l(h,g))&&((i||f)&&h.push(g),p.push(m))}return f?(u(h.k),d(h)):i&&u(h),p}function st(e){return function(t,n,r){var i={};n=Z.createCallback(n,r,3),r=-1;var o=t?t.length:0;if("number"==typeof o)for(;++r<o;){var a=t[r];e(i,a,n(a,r,t),t)}else g(t,function(t,r,o){e(i,t,n(t,r,o),o)});return i}}function lt(e,t,n,r,i,o){var a=1&t,s=2&t,l=4&t,c=8&t,u=16&t,d=32&t,p=e;if(!s&&!vt(e))throw new an;u&&!n.length&&(t&=-17,u=n=!1),d&&!r.length&&(t&=-33,d=r=!1);var f=e&&e.__bindData__;if(f)return!a||1&f[1]||(f[4]=i),!a&&1&f[1]&&(t|=8),!l||4&f[1]||(f[5]=o),u&&yn.apply(f[2]||(f[2]=[]),n),d&&yn.apply(f[3]||(f[3]=[]),r),f[1]|=t,lt.apply(null,f);if(!a||s||l||d||!(Un.fastBind||In&&u))m=function(){var f=arguments,h=a?i:this;return(l||u||d)&&(f=Nn.call(f),u&&Sn.apply(f,n),d&&yn.apply(f,r),l&&f.length<o)?(t|=16,lt(e,c?t:-4&t,f,null,i,o)):(s&&(e=h[p]),this instanceof m?(h=yt(e.prototype)?kn(e.prototype):{},f=e.apply(h,f),yt(f)?f:h):e.apply(h,f))};else{if(u){var h=[i];yn.apply(h,n)}var m=u?In.apply(e,h):In.call(e,i)}return jn(m,Nn.call(arguments)),m}function ct(e){return Wn[e]}function ut(){var t=(t=Z.indexOf)===Ft?e:t;return t}function dt(e){var t,n;return e&&wn.call(e)==j&&(t=e.constructor,!vt(t)||t instanceof t)?(b(e,function(e,t){n=t}),"undefined"==typeof n||gn.call(e,n)):!1}function pt(e){return Hn[e]}function ft(e){return e&&"object"==typeof e&&"number"==typeof e.length&&wn.call(e)==A||!1}function ht(e,t,n){var r=Bn(e),i=r.length;for(t=nt(t,n,3);i--&&(n=r[i],!1!==t(e[n],n,e)););return e}function mt(e){var t=[];return b(e,function(e,n){vt(e)&&t.push(n)}),t.sort()}function gt(e){for(var t=-1,n=Bn(e),r=n.length,i={};++t<r;){var o=n[t];i[e[o]]=o}return i}function vt(e){return"function"==typeof e}function yt(e){return!(!e||!z[typeof e])}function _t(e){return"number"==typeof e||wn.call(e)==U}function bt(e){return"string"==typeof e||wn.call(e)==B}function Et(e){for(var t=-1,n=Bn(e),r=n.length,i=Yt(r);++t<r;)i[t]=e[n[t]];return i}function wt(e,t,n){var r=-1,i=ut(),o=e?e.length:0,a=!1;return n=(0>n?On(0,o+n):n)||0,Vn(e)?a=-1<i(e,t,n):"number"==typeof o?a=-1<(bt(e)?e.indexOf(t,n):i(e,t,n)):g(e,function(e){return++r<n?void 0:!(a=e===t)}),a}function St(e,t,n){var r=!0;t=Z.createCallback(t,n,3),n=-1;var i=e?e.length:0;if("number"==typeof i)for(;++n<i&&(r=!!t(e[n],n,e)););else g(e,function(e,n,i){return r=!!t(e,n,i)});return r}function Ct(e,t,n){var r=[];t=Z.createCallback(t,n,3),n=-1;var i=e?e.length:0;if("number"==typeof i)for(;++n<i;){var o=e[n];t(o,n,e)&&r.push(o)}else g(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function It(e,t,n){t=Z.createCallback(t,n,3),n=-1;var r=e?e.length:0;if("number"!=typeof r){var i;return g(e,function(e,n,r){return t(e,n,r)?(i=e,!1):void 0}),i}for(;++n<r;){var o=e[n];if(t(o,n,e))return o}}function kt(e,t,n){var r=-1,i=e?e.length:0;if(t=t&&"undefined"==typeof n?t:nt(t,n,3),"number"==typeof i)for(;++r<i&&!1!==t(e[r],r,e););else g(e,t);return e}function xt(e,t,n){var r=e?e.length:0;if(t=t&&"undefined"==typeof n?t:nt(t,n,3),"number"==typeof r)for(;r--&&!1!==t(e[r],r,e););else{var i=Bn(e),r=i.length;g(e,function(e,n,o){return n=i?i[--r]:--r,t(o[n],n,o)})}return e}function Tt(e,t,n){var r=-1,i=e?e.length:0;if(t=Z.createCallback(t,n,3),"number"==typeof i)for(var o=Yt(i);++r<i;)o[r]=t(e[r],r,e);else o=[],g(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function Dt(e,t,n){var i=-1/0,o=i;if(!t&&Vn(e)){n=-1;for(var a=e.length;++n<a;){var s=e[n];s>o&&(o=s)}}else t=!t&&bt(e)?r:Z.createCallback(t,n,3),kt(e,function(e,n,r){n=t(e,n,r),n>i&&(i=n,o=e)});return o}function Mt(e,t){var n=-1,r=e?e.length:0;if("number"==typeof r)for(var i=Yt(r);++n<r;)i[n]=e[n][t];return i||Tt(e,t)}function Ot(e,t,n,r){if(!e)return n;var i=3>arguments.length;t=nt(t,r,4);var o=-1,a=e.length;if("number"==typeof a)for(i&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);else g(e,function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)});return n}function Lt(e,t,n,r){var i=3>arguments.length;return t=nt(t,r,4),xt(e,function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)}),n}function Rt(e){var t=-1,n=e?e.length:0,r=Yt("number"==typeof n?n:0);return kt(e,function(e){var n=Kt(++t);r[t]=r[n],r[n]=e}),r}function At(e,t,n){var r;t=Z.createCallback(t,n,3),n=-1;var i=e?e.length:0;if("number"==typeof i)for(;++n<i&&!(r=t(e[n],n,e)););else g(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function Nt(n){var r=-1,i=ut(),a=n?n.length:0,s=rt(arguments,!0,!0,1),l=[],c=a>=_&&i===e;if(c){var u=o(s);u?(i=t,s=u):c=!1}for(;++r<a;)u=n[r],0>i(s,u)&&l.push(u);return c&&d(s),l}function Pt(e,t,n){var r=0,i=e?e.length:0;if("number"!=typeof t&&null!=t){var o=-1;for(t=Z.createCallback(t,n,3);++o<i&&t(e[o],o,e);)r++}else if(r=t,null==r||n)return e?e[0]:h;return p(e,0,Ln(On(0,r),i))}function Ft(t,n,r){if("number"==typeof r){var i=t?t.length:0;r=0>r?On(0,i+r):r||0}else if(r)return r=Ut(t,n),t[r]===n?r:-1;return e(t,n,r)}function $t(e,t,n){if("number"!=typeof t&&null!=t){var r=0,i=-1,o=e?e.length:0;for(t=Z.createCallback(t,n,3);++i<o&&t(e[i],i,e);)r++}else r=null==t||n?1:On(0,t);return p(e,r)}function Ut(e,t,n,r){var i=0,o=e?e.length:i;for(n=n?Z.createCallback(n,r,1):zt,t=n(t);o>i;)r=i+o>>>1,n(e[r])<t?i=r+1:o=r;return i}function jt(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(n=(r=n)&&r[t]===e?null:t,t=!1),null!=n&&(n=Z.createCallback(n,r,3)),at(e,t,n)}function Vt(){for(var e=1<arguments.length?arguments:arguments[0],t=-1,n=e?Dt(Mt(e,"length")):0,r=Yt(0>n?0:n);++t<n;)r[t]=Mt(e,t);return r}function Bt(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var o=e[n];t?i[o]=t[n]:o&&(i[o[0]]=o[1])}return i}function Wt(e,t){return 2<arguments.length?lt(e,17,Nn.call(arguments,2),null,t):lt(e,1,null,null,t)}function Ht(e,t,n){function r(){u&&pn(u),a=u=d=h,(m||f!==t)&&(p=vn(),s=e.apply(c,o))}function i(){var n=t-(vn()-l);n>0?u=bn(i,n):(a&&pn(a),n=d,a=u=d=h,n&&(p=vn(),s=e.apply(c,o)))}var o,a,s,l,c,u,d,p=0,f=!1,m=!0;if(!vt(e))throw new an;if(t=On(0,t)||0,!0===n)var g=!0,m=!1;else yt(n)&&(g=n.leading,f="maxWait"in n&&(On(t,n.maxWait)||0),m="trailing"in n?n.trailing:m);return function(){if(o=arguments,l=vn(),c=this,d=m&&(u||!g),!1===f)var n=g&&!u;else{a||g||(p=l);var h=f-(l-p);h>0?a||(a=bn(r,h)):(a&&(a=pn(a)),p=l,s=e.apply(c,o))}return u||t===f||(u=bn(i,t)),n&&(s=e.apply(c,o)),s}}function qt(e){if(!vt(e))throw new an;var t=Nn.call(arguments,1);return bn(function(){e.apply(h,t)},1)}function zt(e){return e}function Gt(e,t){var n=e,r=!t||vt(n);t||(n=et,t=e,e=Z),kt(mt(t),function(i){var o=e[i]=t[i];r&&(n.prototype[i]=function(){var t=this.__wrapped__,r=[t];return yn.apply(r,arguments),r=o.apply(e,r),t&&"object"==typeof t&&t===r?this:new n(r)})})}function Kt(e,t,n){var r=null==e,i=null==t;return null==n&&("boolean"==typeof e&&i?(n=e,e=1):i||"boolean"!=typeof t||(n=t,i=!0)),r&&i&&(t=1),e=+e||0,i?(t=e,e=0):t=+t||0,r=An(),n||e%1||t%1?Ln(e+r*(t-e+parseFloat("1e-"+((r+"").length-1))),t):e+fn(r*(t-e+1))}function Xt(){return this.__wrapped__}n=n?J.defaults(K.Object(),n,J.pick(K,R)):K;var Yt=n.Array,Qt=n.Boolean,Jt=n.Date,Zt=n.Function,en=n.Math,tn=n.Number,nn=n.Object,rn=n.RegExp,on=n.String,an=n.TypeError,sn=[],ln=nn.prototype,cn=n._,un=rn("^"+on(ln.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),dn=en.ceil,pn=n.clearTimeout,fn=en.floor,hn=Zt.prototype.toString,mn=un.test(mn=nn.getPrototypeOf)&&mn,gn=ln.hasOwnProperty,vn=un.test(vn=Jt.now)&&vn||function(){return+new Jt},yn=sn.push,_n=n.setImmediate,bn=n.setTimeout,En=sn.splice,wn=ln.toString,Sn=sn.unshift,Cn=function(){try{var e={},t=un.test(t=nn.defineProperty)&&t,n=t(e,e,e)&&t}catch(r){}return n}(),In=un.test(In=wn.bind)&&In,kn=un.test(kn=nn.create)&&kn,xn=un.test(xn=Yt.isArray)&&xn,Tn=n.isFinite,Dn=n.isNaN,Mn=un.test(Mn=nn.keys)&&Mn,On=en.max,Ln=en.min,Rn=n.parseInt,An=en.random,Nn=sn.slice,Pn=un.test(n.attachEvent),Fn=In&&!/\n|true/.test(In+Pn),$n={};$n[N]=Yt,$n[P]=Qt,$n[F]=Jt,$n[$]=Zt,$n[j]=nn,$n[U]=tn,$n[V]=rn,$n[B]=on,et.prototype=Z.prototype;var Un=Z.support={};Un.fastBind=In&&!Fn,Un.funcDecomp=!un.test(n.a)&&O.test(f),Un.funcNames="string"==typeof Zt.name,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:T,variable:"",imports:{_:Z}};var jn=Cn?function(e,t){q.value=t,Cn(e,"__bindData__",q)}:c,Vn=xn||function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&wn.call(e)==N||!1},Bn=Mn?function(e){return yt(e)?Mn(e):[]}:Y,Wn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hn=gt(Wn),qn=rn("("+Bn(Hn).join("|")+")","g"),zn=rn("["+Bn(Wn).join("")+"]","g"),Gn=st(function(e,t,n){gn.call(e,n)?e[n]++:e[n]=1}),Kn=st(function(e,t,n){(gn.call(e,n)?e[n]:e[n]=[]).push(t)}),Xn=st(function(e,t,n){e[n]=t});Fn&&Q&&"function"==typeof _n&&(qt=function(e){if(!vt(e))throw new an;return _n.apply(n,arguments)});var Yn=8==Rn(E+"08")?Rn:function(e,t){return Rn(bt(e)?e.replace(D,""):e,t||0)};return Z.after=function(e,t){if(!vt(t))throw new an;return function(){return 1>--e?t.apply(this,arguments):void 0}},Z.assign=X,Z.at=function(e){for(var t=arguments,n=-1,r=rt(t,!0,!1,1),t=t[2]&&t[2][t[1]]===e?1:r.length,i=Yt(t);++n<t;)i[n]=e[r[n]];return i},Z.bind=Wt,Z.bindAll=function(e){for(var t=1<arguments.length?rt(arguments,!0,!1,1):mt(e),n=-1,r=t.length;++n<r;){var i=t[n];e[i]=lt(e[i],1,null,null,e)}return e},Z.bindKey=function(e,t){return 2<arguments.length?lt(t,19,Nn.call(arguments,2),null,e):lt(t,3,null,null,e)},Z.chain=function(e){return e=new et(e),e.__chain__=!0,e},Z.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},Z.compose=function(){for(var e=arguments,t=e.length;t--;)if(!vt(e[t]))throw new an;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},Z.countBy=Gn,Z.createCallback=function(e,t,n){var r=typeof e;if(null==e||"function"==r)return nt(e,t,n);if("object"!=r)return function(t){return t[e]};var i=Bn(e),o=i[0],a=e[o];return 1!=i.length||a!==a||yt(a)?function(t){for(var n=i.length,r=!1;n--&&(r=it(t[i[n]],e[i[n]],null,!0)););return r}:function(e){return e=e[o],a===e&&(0!==a||1/a==1/e)}},Z.curry=function(e,t){return t="number"==typeof t?t:+t||e.length,lt(e,4,null,null,null,t)},Z.debounce=Ht,Z.defaults=G,Z.defer=qt,Z.delay=function(e,t){if(!vt(e))throw new an;var n=Nn.call(arguments,2);return bn(function(){e.apply(h,n)},t)},Z.difference=Nt,Z.filter=Ct,Z.flatten=function(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(n=(r=n)&&r[t]===e?null:t,t=!1),null!=n&&(e=Tt(e,n,r)),rt(e,t)},Z.forEach=kt,Z.forEachRight=xt,Z.forIn=b,Z.forInRight=function(e,t,n){var r=[];b(e,function(e,t){r.push(t,e)});var i=r.length;for(t=nt(t,n,3);i--&&!1!==t(r[i--],r[i],e););return e},Z.forOwn=g,Z.forOwnRight=ht,Z.functions=mt,Z.groupBy=Kn,Z.indexBy=Xn,Z.initial=function(e,t,n){var r=0,i=e?e.length:0;if("number"!=typeof t&&null!=t){var o=i;for(t=Z.createCallback(t,n,3);o--&&t(e[o],o,e);)r++}else r=null==t||n?1:t||r;return p(e,0,Ln(On(0,i-r),i))},Z.intersection=function(n){for(var r=arguments,i=r.length,a=-1,l=s(),c=-1,p=ut(),f=n?n.length:0,h=[],m=s();++a<i;){var g=r[a];l[a]=p===e&&(g?g.length:0)>=_&&o(a?r[a]:m)}e:for(;++c<f;){var v=l[0],g=n[c];if(0>(v?t(v,g):p(m,g))){for(a=i,(v||m).push(g);--a;)if(v=l[a],0>(v?t(v,g):p(r[a],g)))continue e;h.push(g)}}for(;i--;)(v=l[i])&&d(v);return u(l),u(m),h},Z.invert=gt,Z.invoke=function(e,t){var n=Nn.call(arguments,2),r=-1,i="function"==typeof t,o=e?e.length:0,a=Yt("number"==typeof o?o:0);return kt(e,function(e){a[++r]=(i?t:e[t]).apply(e,n)}),a},Z.keys=Bn,Z.map=Tt,Z.max=Dt,Z.memoize=function(e,t){function n(){var r=n.cache,i=t?t.apply(this,arguments):y+arguments[0];return gn.call(r,i)?r[i]:r[i]=e.apply(this,arguments)}if(!vt(e))throw new an;return n.cache={},n},Z.merge=function(e){var t=arguments,n=2;if(!yt(e))return e;if("number"!=typeof t[2]&&(n=t.length),n>3&&"function"==typeof t[n-2])var r=nt(t[--n-1],t[n--],2);else n>2&&"function"==typeof t[n-1]&&(r=t[--n]);for(var t=Nn.call(arguments,1,n),i=-1,o=s(),a=s();++i<n;)ot(e,t[i],r,o,a);return u(o),u(a),e},Z.min=function(e,t,n){var i=1/0,o=i;if(!t&&Vn(e)){n=-1;for(var a=e.length;++n<a;){var s=e[n];o>s&&(o=s)}}else t=!t&&bt(e)?r:Z.createCallback(t,n,3),kt(e,function(e,n,r){n=t(e,n,r),i>n&&(i=n,o=e)});return o},Z.omit=function(e,t,n){var r=ut(),i="function"==typeof t,o={};if(i)t=Z.createCallback(t,n,3);else var a=rt(arguments,!0,!1,1);return b(e,function(e,n,s){(i?!t(e,n,s):0>r(a,n))&&(o[n]=e)}),o},Z.once=function(e){var t,n;if(!vt(e))throw new an;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},Z.pairs=function(e){for(var t=-1,n=Bn(e),r=n.length,i=Yt(r);++t<r;){var o=n[t];i[t]=[o,e[o]]}return i},Z.partial=function(e){return lt(e,16,Nn.call(arguments,1))},Z.partialRight=function(e){return lt(e,32,null,Nn.call(arguments,1))},Z.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=-1,o=rt(arguments,!0,!1,1),a=yt(e)?o.length:0;++i<a;){var s=o[i];s in e&&(r[s]=e[s])}else t=Z.createCallback(t,n,3),b(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},Z.pluck=Mt,Z.pull=function(e){for(var t=arguments,n=0,r=t.length,i=e?e.length:0;++n<r;)for(var o=-1,a=t[n];++o<i;)e[o]===a&&(En.call(e,o--,1),i--);return e},Z.range=function(e,t,n){e=+e||0,n="number"==typeof n?n:+n||1,null==t&&(t=e,e=0);var r=-1;t=On(0,dn((t-e)/(n||1)));for(var i=Yt(t);++r<t;)i[r]=e,e+=n;return i},Z.reject=function(e,t,n){return t=Z.createCallback(t,n,3),Ct(e,function(e,n,r){return!t(e,n,r)})},Z.remove=function(e,t,n){var r=-1,i=e?e.length:0,o=[];for(t=Z.createCallback(t,n,3);++r<i;)n=e[r],t(n,r,e)&&(o.push(n),En.call(e,r--,1),i--);return o},Z.rest=$t,Z.shuffle=Rt,Z.sortBy=function(e,t,n){var r=-1,o=e?e.length:0,a=Yt("number"==typeof o?o:0);for(t=Z.createCallback(t,n,3),kt(e,function(e,n,i){var o=a[++r]=l();o.m=t(e,n,i),o.n=r,o.o=e}),o=a.length,a.sort(i);o--;)e=a[o],a[o]=e.o,d(e);return a},Z.tap=function(e,t){return t(e),e},Z.throttle=function(e,t,n){var r=!0,i=!0;if(!vt(e))throw new an;return!1===n?r=!1:yt(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),H.leading=r,H.maxWait=t,H.trailing=i,Ht(e,t,H)},Z.times=function(e,t,n){e=-1<(e=+e)?e:0;var r=-1,i=Yt(e);for(t=nt(t,n,1);++r<e;)i[r]=t(r);return i},Z.toArray=function(e){return e&&"number"==typeof e.length?p(e):Et(e)},Z.transform=function(e,t,n,r){var i=Vn(e);return t=nt(t,r,4),null==n&&(i?n=[]:(r=e&&e.constructor,n=yt(r&&r.prototype)?kn(r&&r.prototype):{})),(i?kt:g)(e,function(e,r,i){return t(n,e,r,i)}),n},Z.union=function(){return at(rt(arguments,!0,!0))},Z.uniq=jt,Z.values=Et,Z.where=Ct,Z.without=function(e){return Nt(e,Nn.call(arguments,1))},Z.wrap=function(e,t){if(!vt(t))throw new an;return function(){var n=[e];return yn.apply(n,arguments),t.apply(this,n)}},Z.zip=Vt,Z.zipObject=Bt,Z.collect=Tt,Z.drop=$t,Z.each=kt,Z.b=xt,Z.extend=X,Z.methods=mt,Z.object=Bt,Z.select=Ct,Z.tail=$t,Z.unique=jt,Z.unzip=Vt,Gt(Z),Z.clone=function(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(r=n,n=t,t=!1),tt(e,t,"function"==typeof n&&nt(n,r,1))},Z.cloneDeep=function(e,t,n){return tt(e,!0,"function"==typeof t&&nt(t,n,1))},Z.contains=wt,Z.escape=function(e){return null==e?"":on(e).replace(zn,ct)},Z.every=St,Z.find=It,Z.findIndex=function(e,t,n){var r=-1,i=e?e.length:0;for(t=Z.createCallback(t,n,3);++r<i;)if(t(e[r],r,e))return r;return-1},Z.findKey=function(e,t,n){var r;return t=Z.createCallback(t,n,3),g(e,function(e,n,i){return t(e,n,i)?(r=n,!1):void 0
9}),r},Z.findLast=function(e,t,n){var r;return t=Z.createCallback(t,n,3),xt(e,function(e,n,i){return t(e,n,i)?(r=e,!1):void 0}),r},Z.findLastIndex=function(e,t,n){var r=e?e.length:0;for(t=Z.createCallback(t,n,3);r--;)if(t(e[r],r,e))return r;return-1},Z.findLastKey=function(e,t,n){var r;return t=Z.createCallback(t,n,3),ht(e,function(e,n,i){return t(e,n,i)?(r=n,!1):void 0}),r},Z.has=function(e,t){return e?gn.call(e,t):!1},Z.identity=zt,Z.indexOf=Ft,Z.isArguments=ft,Z.isArray=Vn,Z.isBoolean=function(e){return!0===e||!1===e||wn.call(e)==P},Z.isDate=function(e){return e?"object"==typeof e&&wn.call(e)==F:!1},Z.isElement=function(e){return e?1===e.nodeType:!1},Z.isEmpty=function(e){var t=!0;if(!e)return t;var n=wn.call(e),r=e.length;return n==N||n==B||n==A||n==j&&"number"==typeof r&&vt(e.splice)?!r:(g(e,function(){return t=!1}),t)},Z.isEqual=function(e,t,n,r){return it(e,t,"function"==typeof n&&nt(n,r,2))},Z.isFinite=function(e){return Tn(e)&&!Dn(parseFloat(e))},Z.isFunction=vt,Z.isNaN=function(e){return _t(e)&&e!=+e},Z.isNull=function(e){return null===e},Z.isNumber=_t,Z.isObject=yt,Z.isPlainObject=m,Z.isRegExp=function(e){return e?"object"==typeof e&&wn.call(e)==V:!1},Z.isString=bt,Z.isUndefined=function(e){return"undefined"==typeof e},Z.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?On(0,r+n):Ln(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},Z.mixin=Gt,Z.noConflict=function(){return n._=cn,this},Z.parseInt=Yn,Z.random=Kt,Z.reduce=Ot,Z.reduceRight=Lt,Z.result=function(e,t){if(e){var n=e[t];return vt(n)?e[t]():n}},Z.runInContext=f,Z.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:Bn(e).length},Z.some=At,Z.sortedIndex=Ut,Z.template=function(e,t,n){var r=Z.templateSettings;e||(e=""),n=G({},n,r);var i,o=G({},n.imports,r.imports),r=Bn(o),o=Et(o),s=0,l=n.interpolate||M,c="__p+='",l=rn((n.escape||M).source+"|"+l.source+"|"+(l===T?I:M).source+"|"+(n.evaluate||M).source+"|$","g");e.replace(l,function(t,n,r,o,l,u){return r||(r=o),c+=e.slice(s,u).replace(L,a),n&&(c+="'+__e("+n+")+'"),l&&(i=!0,c+="';"+l+";__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),s=u+t.length,t}),c+="';\n",l=n=n.variable,l||(n="obj",c="with("+n+"){"+c+"}"),c=(i?c.replace(w,""):c).replace(S,"$1").replace(C,"$1;"),c="function("+n+"){"+(l?"":n+"||("+n+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var u=Zt(r,"return "+c).apply(h,o)}catch(d){throw d.source=c,d}return t?u(t):(u.source=c,u)},Z.unescape=function(e){return null==e?"":on(e).replace(qn,pt)},Z.uniqueId=function(e){var t=++v;return on(null==e?"":e)+t},Z.all=St,Z.any=At,Z.detect=It,Z.findWhere=It,Z.foldl=Ot,Z.foldr=Lt,Z.include=wt,Z.inject=Ot,g(Z,function(e,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__],n=this.__chain__;return yn.apply(t,arguments),t=e.apply(Z,t),n?new et(t,n):t})}),Z.first=Pt,Z.last=function(e,t,n){var r=0,i=e?e.length:0;if("number"!=typeof t&&null!=t){var o=i;for(t=Z.createCallback(t,n,3);o--&&t(e[o],o,e);)r++}else if(r=t,null==r||n)return e?e[i-1]:h;return p(e,On(0,i-r))},Z.sample=function(e,t,n){var r=e?e.length:0;return"number"!=typeof r&&(e=Et(e)),null==t||n?e?e[Kt(r-1)]:h:(e=Rt(e),e.length=Ln(On(0,t),e.length),e)},Z.take=Pt,Z.head=Pt,g(Z,function(e,t){var n="sample"!==t;Z.prototype[t]||(Z.prototype[t]=function(t,r){var i=this.__chain__,o=e(this.__wrapped__,t,r);return i||null!=t&&(!r||n&&"function"==typeof t)?new et(o,i):o})}),Z.VERSION="2.2.0",Z.prototype.chain=function(){return this.__chain__=!0,this},Z.prototype.toString=function(){return on(this.__wrapped__)},Z.prototype.value=Xt,Z.prototype.valueOf=Xt,kt(["join","pop","shift"],function(e){var t=sn[e];Z.prototype[e]=function(){var e=this.__chain__,n=t.apply(this.__wrapped__,arguments);return e?new et(n,e):n}}),kt(["push","reverse","sort","unshift"],function(e){var t=sn[e];Z.prototype[e]=function(){return t.apply(this.__wrapped__,arguments),this}}),kt(["concat","slice","splice"],function(e){var t=sn[e];Z.prototype[e]=function(){return new et(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Z}var h,m=[],g=[],v=0,y=+new Date+"",_=75,b=40,E=" \f \n\r\u2028\u2029 ᠎              ",w=/\b__p\+='';/g,S=/\b(__p\+=)''\+/g,C=/(__e\(.*?\)|\b__t\))\+'';/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,k=/\w*$/,x=/^function[ \n\r\t]+\w/,T=/<%=([\s\S]+?)%>/g,D=RegExp("^["+E+"]*0+(?=.$)"),M=/($^)/,O=/\bthis\b/,L=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),A="[object Arguments]",N="[object Array]",P="[object Boolean]",F="[object Date]",$="[object Function]",U="[object Number]",j="[object Object]",V="[object RegExp]",B="[object String]",W={};W[$]=!1,W[A]=W[N]=W[P]=W[F]=W[U]=W[j]=W[V]=W[B]=!0;var H={leading:!1,maxWait:0,trailing:!1},q={configurable:!1,enumerable:!1,value:null,writable:!1},z={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=z[typeof window]&&window||this,X=z[typeof exports]&&exports&&!exports.nodeType&&exports,Y=z[typeof module]&&module&&!module.nodeType&&module,Q=Y&&Y.exports===X&&X,J=f();"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define("thirdparty/lodash",[],function(){return J})}.call(this),define("utils/UrlParams",["require","exports","module","thirdparty/lodash"],function(e,t){function n(){this._store={}}var r=e("thirdparty/lodash");n.prototype.parse=function(e){var t,n,r="",i=this;i._store={},e?-1!==e.indexOf("?")&&(r=e.substring(e.indexOf("?")+1)):r=window.document.location.search.substring(1),r=r.trimRight(),r&&(t=r.split("&"),t.forEach(function(e){n=e.split("="),n[1]=n[1]||"",i._store[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}))},n.prototype.put=function(e,t){this._store[e]=t},n.prototype.get=function(e){return this._store[e]},n.prototype.remove=function(e){delete this._store[e]},n.prototype.isEmpty=function(){return r.isEmpty(this._store)},n.prototype.toString=function(){var e=[],t=this;return r.forEach(t._store,function(t,n){e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}),e.join("&")},t.UrlParams=n}),define("command/CommandManager",["require","exports","module"],function(e,t){function n(e,t,n){this._name=e,this._id=t,this._commandFn=n,this._checked=void 0,this._enabled=!0}function r(e,r,i){if(u[r])return console.log("Attempting to register an already-registered command: "+r),null;if(!e||!r||!i)return console.error("Attempting to register a command with a missing name, id, or command function:"+e+" "+r),null;var o=new n(e,r,i);return u[r]=o,$(t).triggerHandler("commandRegistered",[o]),o}function i(e,r){if(u[e])return console.log("Attempting to register an already-registered command: "+e),null;if(!e||!r)return console.error("Attempting to register an internal command with a missing id, or command function: "+e),null;var i=new n(null,e,r);return u[e]=i,$(t).triggerHandler("commandRegistered",[i]),i}function o(){d=u,u={}}function a(){u=d,d={}}function s(e){return u[e]}function l(){return Object.keys(u)}function c(e){var n=u[e];if(n){try{$(t).triggerHandler("beforeExecuteCommand",e)}catch(r){console.error(r)}return n.execute.apply(n,Array.prototype.slice.call(arguments,1))}return(new $.Deferred).reject().promise()}var u={},d={};n.prototype.getID=function(){return this._id},n.prototype.execute=function(){if(!this._enabled)return(new $.Deferred).reject().promise();var e=this._commandFn.apply(this,arguments);return e?e:(new $.Deferred).resolve().promise()},n.prototype.getEnabled=function(){return this._enabled},n.prototype.setEnabled=function(e){var t=this._enabled!==e;this._enabled=e,t&&$(this).triggerHandler("enabledStateChange")},n.prototype.setChecked=function(e){var t=this._checked!==e;this._checked=e,t&&$(this).triggerHandler("checkedStateChange")},n.prototype.getChecked=function(){return this._checked},n.prototype.setName=function(e){var t=this._name!==e;this._name=e,t&&$(this).triggerHandler("nameChange")},n.prototype.getName=function(){return this._name},t.register=r,t.registerInternal=i,t.execute=c,t.get=s,t.getAll=l,t._testReset=o,t._testRestore=a}),define("utils/DeprecationWarning",["require","exports","module"],function(e,t){function n(e){var t;return e=e.substr(e.indexOf(")\n")+2),t=e.indexOf("requirejs/require.js"),-1!==t&&(t=e.lastIndexOf(")",t)+1,e=e.substr(0,t)),e}function r(e,t){if(e&&(t||!s[e])){var r=(new Error).stack,i=r.split("\n")[3];t&&s[e]&&s[e][i]||(console.warn(e+"\n"+n(r)),s[e]||(s[e]={}),s[e][i]=!0)}}function i(e,t){var n=0,r=$._data(e,"events");if(r&&r.hasOwnProperty(t)){var i=r[t];n=i.length,i.hasOwnProperty("delegateCount")&&(n+=i.delegateCount-1)}return n}function o(e,t,n,r,o,a){$(t).on(r,function(){var t=i(e,n);if(t>0){var l="The Event "+(o||n)+" has been deprecated. Use "+(a||r)+" instead.";s[l]||(s[l]=!0,console.warn(l))}$(e).trigger(n,Array.prototype.slice.call(arguments,1))})}function a(e,t,n){var i="Use Menus."+n+" instead of Menus."+t,o=e[n];Object.defineProperty(e,t,{get:function(){return r(i,!0),o}})}var s={};t.deprecationWarning=r,t.deprecateEvent=o,t.getEventHandlerCount=i,t.deprecateConstant=a}),define("command/Commands",["require","exports","module","utils/DeprecationWarning"],function(e,t){var n=e("utils/DeprecationWarning");t.FILE_NEW_UNTITLED="file.newDoc",t.FILE_NEW="file.newFile",t.FILE_NEW_FOLDER="file.newFolder",t.FILE_OPEN="file.open",t.FILE_OPEN_FOLDER="file.openFolder",t.FILE_SAVE="file.save",t.FILE_SAVE_ALL="file.saveAll",t.FILE_SAVE_AS="file.saveAs",t.FILE_CLOSE="file.close",t.FILE_CLOSE_ALL="file.close_all",t.FILE_CLOSE_LIST="file.close_list",t.FILE_OPEN_DROPPED_FILES="file.openDroppedFiles",t.FILE_LIVE_FILE_PREVIEW="file.liveFilePreview",t.CMD_RELOAD_LIVE_PREVIEW="file.reloadLivePreview",t.FILE_LIVE_HIGHLIGHT="file.previewHighlight",t.FILE_PROJECT_SETTINGS="file.projectSettings",t.FILE_RENAME="file.rename",t.FILE_DELETE="file.delete",t.FILE_EXTENSION_MANAGER="file.extensionManager",t.FILE_REFRESH="file.refresh",t.FILE_OPEN_PREFERENCES="file.openPreferences",t.FILE_CLOSE_WINDOW="file.close_window",t.FILE_QUIT="file.quit",t.EDIT_UNDO="edit.undo",t.EDIT_REDO="edit.redo",t.EDIT_CUT="edit.cut",t.EDIT_COPY="edit.copy",t.EDIT_PASTE="edit.paste",t.EDIT_SELECT_ALL="edit.selectAll",t.EDIT_SELECT_LINE="edit.selectLine",t.EDIT_SPLIT_SEL_INTO_LINES="edit.splitSelIntoLines",t.EDIT_ADD_CUR_TO_NEXT_LINE="edit.addCursorToNextLine",t.EDIT_ADD_CUR_TO_PREV_LINE="edit.addCursorToPrevLine",t.EDIT_INDENT="edit.indent",t.EDIT_UNINDENT="edit.unindent",t.EDIT_DUPLICATE="edit.duplicate",t.EDIT_DELETE_LINES="edit.deletelines",t.EDIT_LINE_COMMENT="edit.lineComment",t.EDIT_BLOCK_COMMENT="edit.blockComment",t.EDIT_LINE_UP="edit.lineUp",t.EDIT_LINE_DOWN="edit.lineDown",t.EDIT_OPEN_LINE_ABOVE="edit.openLineAbove",t.EDIT_OPEN_LINE_BELOW="edit.openLineBelow",t.TOGGLE_CLOSE_BRACKETS="edit.autoCloseBrackets",t.SHOW_CODE_HINTS="edit.showCodeHints",t.CMD_FIND="cmd.find",t.CMD_FIND_IN_FILES="cmd.findInFiles",t.CMD_FIND_IN_SELECTED="cmd.findInSelected",t.CMD_FIND_IN_SUBTREE="cmd.findInSubtree",t.CMD_FIND_NEXT="cmd.findNext",t.CMD_FIND_PREVIOUS="cmd.findPrevious",t.CMD_FIND_ALL_AND_SELECT="cmd.findAllAndSelect",t.CMD_ADD_NEXT_MATCH="cmd.addNextMatch",t.CMD_SKIP_CURRENT_MATCH="cmd.skipCurrentMatch",t.CMD_REPLACE="cmd.replace",t.CMD_REPLACE_IN_FILES="cmd.replaceInFiles",t.CMD_REPLACE_IN_SELECTED="cmd.replaceInSelected",t.CMD_REPLACE_IN_SUBTREE="cmd.replaceInSubtree",t.CMD_THEMES_OPEN_SETTINGS="view.themesOpenSetting",t.VIEW_HIDE_SIDEBAR="view.hideSidebar",t.VIEW_INCREASE_FONT_SIZE="view.increaseFontSize",t.VIEW_DECREASE_FONT_SIZE="view.decreaseFontSize",t.VIEW_RESTORE_FONT_SIZE="view.restoreFontSize",t.VIEW_SCROLL_LINE_UP="view.scrollLineUp",t.VIEW_SCROLL_LINE_DOWN="view.scrollLineDown",t.VIEW_TOGGLE_INSPECTION="view.toggleCodeInspection",t.TOGGLE_LINE_NUMBERS="view.toggleLineNumbers",t.TOGGLE_ACTIVE_LINE="view.toggleActiveLine",t.TOGGLE_WORD_WRAP="view.toggleWordWrap",t.CMD_OPEN="cmd.open",t.CMD_ADD_TO_WORKINGSET_AND_OPEN="cmd.addToWorkingSetAndOpen",t.NAVIGATE_NEXT_DOC="navigate.nextDoc",t.NAVIGATE_PREV_DOC="navigate.prevDoc",t.NAVIGATE_SHOW_IN_FILE_TREE="navigate.showInFileTree",t.NAVIGATE_SHOW_IN_OS="navigate.showInOS",t.NAVIGATE_QUICK_OPEN="navigate.quickOpen",t.NAVIGATE_JUMPTO_DEFINITION="navigate.jumptoDefinition",t.NAVIGATE_GOTO_DEFINITION="navigate.gotoDefinition",t.NAVIGATE_GOTO_LINE="navigate.gotoLine",t.NAVIGATE_GOTO_FIRST_PROBLEM="navigate.gotoFirstProblem",t.TOGGLE_QUICK_EDIT="navigate.toggleQuickEdit",t.TOGGLE_QUICK_DOCS="navigate.toggleQuickDocs",t.QUICK_EDIT_NEXT_MATCH="navigate.nextMatch",t.QUICK_EDIT_PREV_MATCH="navigate.previousMatch",t.CSS_QUICK_EDIT_NEW_RULE="navigate.newRule",t.HELP_CHECK_FOR_UPDATE="help.checkForUpdate",t.HELP_HOW_TO_USE_BRACKETS="help.howToUseBrackets",t.HELP_SUPPORT="help.support",t.HELP_SUGGEST="help.suggest",t.HELP_RELEASE_NOTES="help.releaseNotes",t.HELP_GET_INVOLVED="help.getInvolved",t.HELP_SHOW_EXT_FOLDER="help.showExtensionsFolder",t.HELP_HOMEPAGE="help.homepage",t.HELP_TWITTER="help.twitter",t.CMD_WORKINGSET_SORT_BY_ADDED="cmd.sortWorkingSetByAdded",t.CMD_WORKINGSET_SORT_BY_NAME="cmd.sortWorkingSetByName",t.CMD_WORKINGSET_SORT_BY_TYPE="cmd.sortWorkingSetByType",t.CMD_WORKING_SORT_TOGGLE_AUTO="cmd.sortWorkingSetToggleAuto",t.CMD_SPLITVIEW_NONE="cmd.splitViewNone",t.CMD_SPLITVIEW_VERTICAL="cmd.splitViewVertical",t.CMD_SPLITVIEW_HORIZONTAL="cmd.splitViewHorizontal",t.HELP_ABOUT="help.about",t.APP_RELOAD="app.reload",t.APP_RELOAD_WITHOUT_EXTS="app.reload_without_exts",t.APP_ABORT_QUIT="app.abort_quit",t.APP_BEFORE_MENUPOPUP="app.before_menupopup",t.FILE_ADD_TO_WORKING_SET="file.addToWorkingSet",n.deprecateConstant(t,"SORT_WORKINGSET_BY_ADDED","CMD_WORKINGSET_SORT_BY_ADDED"),n.deprecateConstant(t,"SORT_WORKINGSET_BY_NAME","CMD_WORKINGSET_SORT_BY_NAME"),n.deprecateConstant(t,"SORT_WORKINGSET_BY_TYPE","CMD_WORKINGSET_SORT_BY_TYPE"),n.deprecateConstant(t,"SORT_WORKINGSET_AUTO","CMD_WORKING_SORT_TOGGLE_AUTO"),n.deprecateConstant(t,"EDIT_FIND","CMD_FIND"),n.deprecateConstant(t,"EDIT_FIND_IN_SELECTED","CMD_FIND_IN_SELECTED"),n.deprecateConstant(t,"EDIT_FIND_IN_SUBTREE","CMD_FIND_IN_SUBTREE"),n.deprecateConstant(t,"EDIT_FIND_NEXT","CMD_FIND_NEXT"),n.deprecateConstant(t,"EDIT_FIND_PREVIOUS","CMD_FIND_PREVIOUS"),n.deprecateConstant(t,"EDIT_FIND_ALL_AND_SELECT","CMD_FIND_ALL_AND_SELECT"),n.deprecateConstant(t,"EDIT_ADD_NEXT_MATCH","CMD_ADD_NEXT_MATCH"),n.deprecateConstant(t,"EDIT_SKIP_CURRENT_MATCH","CMD_SKIP_CURRENT_MATCH"),n.deprecateConstant(t,"EDIT_REPLACE","CMD_REPLACE")}),define("utils/ShellAPI",["require","exports","module","utils/AppInit","command/CommandManager","command/Commands"],function(e,t){function n(e){if($(".modal.instance").length||!a)return window.isBracketsTestWindow?!1:e===o.FILE_CLOSE_WINDOW;var t,n=Error,r=new n,s=r.stack.split("\n").length;return 3>s?t=i.execute(e):console.error("Skipping command "+e+" because it looks like you are at a breakpoint. If you are NOT at a breakpoint, please file a bug and mention this comment. Stack depth = "+s+"."),t&&"rejected"===t.state()?!1:!0}var r=e("utils/AppInit"),i=e("command/CommandManager"),o=e("command/Commands"),a=!1;r.appReady(function(){a=!0}),t.executeCommand=n}),define("hacks.app",["require","exports","module"],function(e,t){t.getApplicationSupportDirectory=function(){return"/support"},t.getUserDocumentsDirectory=function(){return"/projects"},t.getNodeState=function(e){e(null,window.location.port||"http"===window.location.protocol?80:443)},t.openURLInDefaultBrowser=function(e){var t=window.open(e,"_blank");t.focus()},t.quit=function(){},t.abortQuit=function(){},t.showExtensionsFolder=function(e,t){t("Not supported.")};var n=Function,r=new n("return this")();r.Mustache.compile||(r.Mustache.compile=function(e){return r.Mustache.parse(e),function(t,n){return r.Mustache.render(e,t,n)}})}),define("filesystem/FileSystemStats",["require","exports","module"],function(e,t,n){function r(e){var t=e.isFile;this._isFile=t,this._isDirectory=!t,this._mtime=e.mtime,this._size=e.size,this._hash=e.hash;var n=e.realPath;n&&(t||"/"===n[n.length-1]||(n+="/"),this._realPath=n)}Object.defineProperties(r.prototype,{isFile:{get:function(){return this._isFile},set:function(){throw new Error("Cannot set isFile")}},isDirectory:{get:function(){return this._isDirectory},set:function(){throw new Error("Cannot set isDirectory")}},mtime:{get:function(){return this._mtime},set:function(){throw new Error("Cannot set mtime")}},size:{get:function(){return this._size},set:function(){throw new Error("Cannot set size")}},realPath:{get:function(){return this._realPath},set:function(){throw new Error("Cannot set realPath")}}}),r.prototype._isFile=!1,r.prototype._isDirectory=!1,r.prototype._mtime=null,r.prototype._size=null,r.prototype._hash=null,r.prototype._realPath=null,n.exports=r}),define("filesystem/FileSystemError",["require","exports","module"],function(e,t,n){n.exports={UNKNOWN:"Unknown",INVALID_PARAMS:"InvalidParams",NOT_FOUND:"NotFound",NOT_READABLE:"NotReadable",UNSUPPORTED_ENCODING:"UnsupportedEncoding",NOT_SUPPORTED:"NotSupported",NOT_WRITABLE:"NotWritable",OUT_OF_SPACE:"OutOfSpace",TOO_MANY_ENTRIES:"TooManyEntries",ALREADY_EXISTS:"AlreadyExists",CONTENTS_MODIFIED:"ContentsModified",ROOT_NOT_WATCHED:"RootNotBeingWatched"}}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("socket.io",[],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.io=e()}}(function(){var e;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t){t.exports=e("./lib/")},{"./lib/":2}],2:[function(e,t,n){function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=i(e),o=r.source,c=r.id;return t.forceNew||t["force new connection"]||!1===t.multiplex?(s("ignoring socket cache for %s",o),n=a(o,t)):(l[c]||(s("new io instance for %s",o),l[c]=a(o,t)),n=l[c]),n.socket(r.path)}var i=e("./url"),o=e("socket.io-parser"),a=e("./manager"),s=e("debug")("socket.io-client");t.exports=n=r;var l=n.managers={};n.protocol=o.protocol,n.connect=r,n.Manager=e("./manager"),n.Socket=e("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:9,"socket.io-parser":40}],3:[function(e,t){function n(e,t){return this instanceof n?(e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connected=0,this.attempts=0,this.encoding=!1,this.packetBuffer=[],this.encoder=new a.Encoder,this.decoder=new a.Decoder,this.autoConnect=t.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(e,t)}var r=(e("./url"),e("engine.io-client")),i=e("./socket"),o=e("component-emitter"),a=e("socket.io-parser"),s=e("./on"),l=e("component-bind"),c=(e("object-component"),e("debug")("socket.io-client:manager"));t.exports=n,n.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)this.nsps[e].emit.apply(this.nsps[e],arguments)},o(n.prototype),n.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},n.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},n.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this):this._reconnectionDelay},n.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this):this._reconnectionDelayMax},n.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},n.prototype.maybeReconnectOnOpen=function(){this.openReconnect||this.reconnecting||!this._reconnection||0!==this.attempts||(this.openReconnect=!0,this.reconnect())},n.prototype.open=n.prototype.connect=function(e){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=r(this.uri,this.opts);var t=this.engine,n=this;this.readyState="opening";var i=s(t,"open",function(){n.onopen(),e&&e()}),o=s(t,"error",function(t){if(c("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}n.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;c("connect attempt will timeout after %d",a);var l=setTimeout(function(){c("connect attempt timed out after %d",a),i.destroy(),t.close(),t.emit("error","timeout"),n.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(i),this.subs.push(o),this},n.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(s(e,"data",l(this,"ondata"))),this.subs.push(s(this.decoder,"decoded",l(this,"ondecoded"))),this.subs.push(s(e,"error",l(this,"onerror"))),this.subs.push(s(e,"close",l(this,"onclose")))},n.prototype.ondata=function(e){this.decoder.add(e)},n.prototype.ondecoded=function(e){this.emit("packet",e)},n.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},n.prototype.socket=function(e){var t=this.nsps[e];if(!t){t=new i(this,e),this.nsps[e]=t;var n=this;t.on("connect",function(){n.connected++})}return t},n.prototype.destroy=function(){--this.connected||this.close()},n.prototype.packet=function(e){c("writing packet %j",e);var t=this;t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(e){for(var n=0;n<e.length;n++)t.engine.write(e[n]);t.encoding=!1,t.processPacketQueue()}))},n.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},n.prototype.cleanup=function(){for(var e;e=this.subs.shift();)e.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){this.skipReconnect=!0,this.engine.close()},n.prototype.onclose=function(e){c("close"),this.cleanup(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting)return this;var e=this;if(this.attempts++,this.attempts>this._reconnectionAttempts)c("reconnect failed"),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.attempts*this.reconnectionDelay();t=Math.min(t,this.reconnectionDelayMax()),c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){c("attempting reconnect"),e.emitAll("reconnect_attempt",e.attempts),e.emitAll("reconnecting",e.attempts),e.open(function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},n.prototype.onreconnect=function(){var e=this.attempts;this.attempts=0,this.reconnecting=!1,this.emitAll("reconnect",e)}},{"./on":4,"./socket":5,"./url":6,"component-bind":7,"component-emitter":8,debug:9,"engine.io-client":10,"object-component":37,"socket.io-parser":40}],4:[function(e,t){function n(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}t.exports=n},{}],5:[function(e,t,n){function r(e,t){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.subEvents()}{var i=e("socket.io-parser"),o=e("component-emitter"),a=e("to-array"),s=e("./on"),l=e("component-bind"),c=e("debug")("socket.io-client:socket"),u=e("has-binary");e("indexof")}t.exports=n=r;var d={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},p=o.prototype.emit;o(r.prototype),r.prototype.subEvents=function(){var e=this.io;this.subs=[s(e,"open",l(this,"onopen")),s(e,"packet",l(this,"onpacket")),s(e,"close",l(this,"onclose"))]},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},r.prototype.send=function(){var e=a(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(d.hasOwnProperty(e))return p.apply(this,arguments),this;var t=a(arguments),n=i.EVENT;u(t)&&(n=i.BINARY_EVENT);var r={type:n,data:t};return"function"==typeof t[t.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){c("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:i.CONNECT})},r.prototype.onclose=function(e){c("close (%s)",e),this.connected=!1,this.disconnected=!0,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp==this.nsp)switch(e.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(e);break;case i.BINARY_EVENT:this.onevent(e);break;case i.ACK:this.onack(e);break;case i.BINARY_ACK:this.onack(e);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",e.data)}},r.prototype.onevent=function(e){var t=e.data||[];c("emitting event %j",t),null!=e.id&&(c("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?p.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=a(arguments);c("sending ack %j",r);var o=u(r)?i.BINARY_ACK:i.ACK;t.packet({type:o,id:e,data:r})}}},r.prototype.onack=function(e){c("calling ack %s with %j",e.id,e.data);var t=this.acks[e.id];t.apply(this,e.data),delete this.acks[e.id]},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)p.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected?(c("performing disconnect (%s)",this.nsp),this.packet({type:i.DISCONNECT}),this.destroy(),this.onclose("io client disconnect"),this):this}},{"./on":4,"component-bind":7,"component-emitter":8,debug:9,"has-binary":32,indexof:36,"socket.io-parser":40,"to-array":44}],6:[function(e,t){(function(n){function r(e,t){var r=e,t=t||n.location;return null==e&&(e=t.protocol+"//"+t.hostname),"string"==typeof e&&("/"==e.charAt(0)&&"undefined"!=typeof t&&(e=t.hostname+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e="undefined"!=typeof t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),r=i(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/",r.id=r.protocol+"://"+r.host+":"+r.port,r.href=r.protocol+"://"+r.host+(t&&t.port==r.port?"":":"+r.port),r}var i=e("parseuri"),o=e("debug")("socket.io-client:url");t.exports=r}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{debug:9,parseuri:38}],7:[function(e,t){var n=[].slice;t.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},{}],8:[function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],9:[function(e,t){function n(e){return n.enabled(e)?function(t){t=r(t);var i=new Date,o=i-(n[e]||i);n[e]=i,t=e+" "+t+" +"+n.humanize(o),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function r(e){return e instanceof Error?e.stack||e.message:e}t.exports=n,n.names=[],n.skips=[],n.enable=function(e){try{localStorage.debug=e}catch(t){}for(var r=(e||"").split(/[\s,]+/),i=r.length,o=0;i>o;o++)e=r[o].replace("*",".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$"))},n.disable=function(){n.enable("")},n.humanize=function(e){var t=1e3,n=6e4,r=60*n;return e>=r?(e/r).toFixed(1)+"h":e>=n?(e/n).toFixed(1)+"m":e>=t?(e/t|0)+"s":e+"ms"},n.enabled=function(e){for(var t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(var t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch(i){}},{}],10:[function(e,t){t.exports=e("./lib/")},{"./lib/":11}],11:[function(e,t){t.exports=e("./socket"),t.exports.parser=e("engine.io-parser")},{"./socket":12,"engine.io-parser":21}],12:[function(e,t){(function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);if(t=t||{},e&&"object"==typeof e&&(t=e,e=null),e&&(e=u(e),t.host=e.host,t.secure="https"==e.protocol||"wss"==e.protocol,t.port=e.port,e.query&&(t.query=e.query)),this.secure=null!=t.secure?t.secure:n.location&&"https:"==location.protocol,t.host){var i=t.host.split(":");t.hostname=i.shift(),i.length&&(t.port=i.pop())}this.agent=t.agent||!1,this.hostname=t.hostname||(n.location?location.hostname:"localhost"),this.port=t.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=p.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.open(),this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades}function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);
10return t}var o=e("./transports"),a=e("component-emitter"),s=e("debug")("engine.io-client:socket"),l=e("indexof"),c=e("engine.io-parser"),u=e("parseuri"),d=e("parsejson"),p=e("parseqs");t.exports=r,r.priorWebsocketSuccess=!1,a(r.prototype),r.protocol=c.protocol,r.Socket=r,r.Transport=e("./transport"),r.transports=e("./transports"),r.parser=e("engine.io-parser"),r.prototype.createTransport=function(e){s('creating transport "%s"',e);var t=i(this.query);t.EIO=c.protocol,t.transport=e,this.id&&(t.sid=this.id);var n=new o[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this});return n},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))e="websocket";else{if(0==this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";var e;try{e=this.createTransport(e)}catch(n){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},r.prototype.probe=function(e){function t(){if(p.onlyBinaryUpgrades){var t=!this.supportsBinary&&p.transport.supportsBinary;d=d||t}d||(s('probe transport "%s" opened',e),u.send([{type:"ping",data:"probe"}]),u.once("packet",function(t){if(!d)if("pong"==t.type&&"probe"==t.data)s('probe transport "%s" pong',e),p.upgrading=!0,p.emit("upgrading",u),r.priorWebsocketSuccess="websocket"==u.name,s('pausing current transport "%s"',p.transport.name),p.transport.pause(function(){d||"closed"!=p.readyState&&"closing"!=p.readyState&&(s("changing transport and sending upgrade packet"),c(),p.setTransport(u),u.send([{type:"upgrade"}]),p.emit("upgrade",u),u=null,p.upgrading=!1,p.flush())});else{s('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=u.name,p.emit("upgradeError",n)}}))}function n(){d||(d=!0,c(),u.close(),u=null)}function i(t){var r=new Error("probe error: "+t);r.transport=u.name,n(),s('probe transport "%s" failed because of error: %s',e,t),p.emit("upgradeError",r)}function o(){i("transport closed")}function a(){i("socket closed")}function l(e){u&&e.name!=u.name&&(s('"%s" works - aborting "%s"',e.name,u.name),n())}function c(){u.removeListener("open",t),u.removeListener("error",i),u.removeListener("close",o),p.removeListener("close",a),p.removeListener("upgrading",l)}s('probing transport "%s"',e);var u=this.createTransport(e,{probe:1}),d=!1,p=this;r.priorWebsocketSuccess=!1,u.once("open",t),u.once("error",i),u.once("close",o),this.once("close",a),this.once("upgrading",l),u.open()},r.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;t>e;e++)this.probe(this.upgrades[e])}},r.prototype.onPacket=function(e){if("opening"==this.readyState||"open"==this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(d(e.data));break;case"pong":this.setPing();break;case"error":var t=new Error("server error");t.code=e.data,this.emit("error",t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!=t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},r.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},r.prototype.ping=function(){this.sendPacket("ping")},r.prototype.onDrain=function(){for(var e=0;e<this.prevBufferLen;e++)this.callbackBuffer[e]&&this.callbackBuffer[e]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0==this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(e,t){return this.sendPacket("message",e,t),this},r.prototype.sendPacket=function(e,t,n){var r={type:e,data:t};this.emit("packetCreate",r),this.writeBuffer.push(r),this.callbackBuffer.push(n),this.flush()},r.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.onClose("forced close"),s("socket closing - telling transport to close"),this.transport.close()),this},r.prototype.onError=function(e){s("socket error %j",e),r.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},r.prototype.onClose=function(e,t){if("opening"==this.readyState||"open"==this.readyState){s('socket close with reason: "%s"',e);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){n.writeBuffer=[],n.callbackBuffer=[],n.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t)}},r.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;r>n;n++)~l(this.transports,e[n])&&t.push(e[n]);return t}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./transport":13,"./transports":14,"component-emitter":8,debug:9,"engine.io-parser":21,indexof:36,parsejson:28,parseqs:29,parseuri:30}],13:[function(e,t){function n(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR}var r=e("engine.io-parser"),i=e("component-emitter");t.exports=n,i(n.prototype),n.timestamps=0,n.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},n.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},n.prototype.send=function(e){if("open"!=this.readyState)throw new Error("Transport not open");this.write(e)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},n.prototype.onPacket=function(e){this.emit("packet",e)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":8,"engine.io-parser":21}],14:[function(e,t,n){(function(t){function r(e){var n,r=!1,s=!1,l=!1!==e.jsonp;if(t.location){var c="https:"==location.protocol,u=location.port;u||(u=c?443:80),r=e.hostname!=location.hostname||u!=e.port,s=e.secure!=c}if(e.xdomain=r,e.xscheme=s,n=new i(e),"open"in n&&!e.forceJSONP)return new o(e);if(!l)throw new Error("JSONP disabled");return new a(e)}var i=e("xmlhttprequest"),o=e("./polling-xhr"),a=e("./polling-jsonp"),s=e("./websocket");n.polling=r,n.websocket=s}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling-jsonp":15,"./polling-xhr":16,"./websocket":18,xmlhttprequest:19}],15:[function(e,t){(function(n){function r(){}function i(e){o.call(this,e),this.query=this.query||{},s||(n.___eio||(n.___eio=[]),s=n.___eio),this.index=s.length;var t=this;s.push(function(e){t.onData(e)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){t.script&&(t.script.onerror=r)})}var o=e("./polling"),a=e("component-inherit");t.exports=i;var s,l=/\n/g,c=/\\n/g;a(i,o),i.prototype.supportsBinary=!1,i.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null),o.prototype.doClose.call(this)},i.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),this.script=t;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},i.prototype.doWrite=function(e,t){function n(){r(),t()}function r(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(e){i.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+i.iframeId+'">';o=document.createElement(t)}catch(e){o=document.createElement("iframe"),o.name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}var i=this;if(!this.form){var o,a=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=u,a.method="POST",a.setAttribute("accept-charset","utf-8"),s.name="d",a.appendChild(s),document.body.appendChild(a),this.form=a,this.area=s}this.form.action=this.uri(),r(),e=e.replace(c,"\\\n"),this.area.value=e.replace(l,"\\n");try{this.form.submit()}catch(d){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==i.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":17,"component-inherit":20}],16:[function(e,t){(function(n){function r(){}function i(e){if(l.call(this,e),n.location){var t="https:"==location.protocol,r=location.port;r||(r=t?443:80),this.xd=e.hostname!=n.location.hostname||r!=e.port,this.xs=e.secure!=t}}function o(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!=e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.create()}function a(){for(var e in o.requests)o.requests.hasOwnProperty(e)&&o.requests[e].abort()}var s=e("xmlhttprequest"),l=e("./polling"),c=e("component-emitter"),u=e("component-inherit"),d=e("debug")("engine.io-client:polling-xhr");t.exports=i,t.exports.Request=o,u(i,l),i.prototype.supportsBinary=!0,i.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,new o(e)},i.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),i=this;r.on("success",t),r.on("error",function(e){i.onError("xhr post error",e)}),this.sendXhr=r},i.prototype.doPoll=function(){d("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},c(o.prototype),o.prototype.create=function(){var e=this.xhr=new s({agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR}),t=this;try{if(d("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async),this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){t.onLoad()},e.onerror=function(){t.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?t.onLoad():setTimeout(function(){t.onError(e.status)},0))},d("xhr data %s",this.data),e.send(this.data)}catch(r){return void setTimeout(function(){t.onError(r)},0)}n.document&&(this.index=o.requestsCount++,o.requests[this.index]=this)},o.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},o.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},o.prototype.onError=function(e){this.emit("error",e),this.cleanup()},o.prototype.cleanup=function(){if("undefined"!=typeof this.xhr&&null!==this.xhr){this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r;try{this.xhr.abort()}catch(e){}n.document&&delete o.requests[this.index],this.xhr=null}},o.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(n){}e="application/octet-stream"===t?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(n){this.onError(n)}null!=e&&this.onData(e)},o.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},o.prototype.abort=function(){this.cleanup()},n.document&&(o.requestsCount=0,o.requests={},n.attachEvent?n.attachEvent("onunload",a):n.addEventListener&&n.addEventListener("beforeunload",a))}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":17,"component-emitter":8,"component-inherit":20,debug:9,xmlhttprequest:19}],17:[function(e,t){function n(e){var t=e&&e.forceBase64;(!l||t)&&(this.supportsBinary=!1),r.call(this,e)}var r=e("../transport"),i=e("parseqs"),o=e("engine.io-parser"),a=e("component-inherit"),s=e("debug")("engine.io-client:polling");t.exports=n;var l=function(){var t=e("xmlhttprequest"),n=new t({agent:this.agent,xdomain:!1});return null!=n.responseType}();a(n,r),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(e){function t(){s("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(s("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){s("pre-pause polling complete"),--r||t()})),this.writable||(s("we are currently writing - waiting to pause"),r++,this.once("drain",function(){s("pre-pause writing complete"),--r||t()}))}else t()},n.prototype.poll=function(){s("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(e){var t=this;s("polling got data %s",e);var n=function(e){return"opening"==t.readyState&&t.onOpen(),"close"==e.type?(t.onClose(),!1):void t.onPacket(e)};o.decodePayload(e,this.socket.binaryType,n),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():s('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function e(){s("writing close packet"),t.write([{type:"close"}])}var t=this;"open"==this.readyState?(s("transport open - closing"),e()):(s("transport not open - deferring close"),this.once("open",e))},n.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")},t=this;o.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},n.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=+new Date+"-"+r.timestamps++),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"==t&&443!=this.port||"http"==t&&80!=this.port)&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e}},{"../transport":13,"component-inherit":20,debug:9,"engine.io-parser":21,parseqs:29,xmlhttprequest:19}],18:[function(e,t){function n(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),r.call(this,e)}var r=e("../transport"),i=e("engine.io-parser"),o=e("parseqs"),a=e("component-inherit"),s=e("debug")("engine.io-client:websocket"),l=e("ws");t.exports=n,a(n,r),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=void 0,n={agent:this.agent};this.ws=new l(e,t,n),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(e){var t=this;setTimeout(function(){r.prototype.onData.call(t,e)},0)}),n.prototype.write=function(e){function t(){n.writable=!0,n.emit("drain")}var n=this;this.writable=!1;for(var r=0,o=e.length;o>r;r++)i.encodePacket(e[r],this.supportsBinary,function(e){try{n.ws.send(e)}catch(t){s("websocket closed before onclose event")}});setTimeout(t,0)},n.prototype.onClose=function(){r.prototype.onClose.call(this)},n.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},n.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"==t&&443!=this.port||"ws"==t&&80!=this.port)&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=+new Date),this.supportsBinary||(e.b64=1),e=o.encode(e),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e},n.prototype.check=function(){return!(!l||"__initialize"in l&&this.name===n.prototype.name)}},{"../transport":13,"component-inherit":20,debug:9,"engine.io-parser":21,parseqs:29,ws:31}],19:[function(e,t){var n=e("has-cors");t.exports=function(e){var t=e.xdomain,r=e.xscheme,i=e.enablesXDR;try{if("undefined"!=typeof XDomainRequest&&!r&&i)return new XDomainRequest}catch(o){}try{if("undefined"!=typeof XMLHttpRequest&&(!t||n))return new XMLHttpRequest}catch(o){}if(!t)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(o){}}},{"has-cors":34}],20:[function(e,t){t.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],21:[function(e,t,n){(function(t){function r(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var i=e.data,o=new Uint8Array(i),a=new Uint8Array(1+i.byteLength);a[0]=f[e.type];for(var s=0;s<o.length;s++)a[s+1]=o[s];return r(a.buffer)}function i(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var i=new FileReader;return i.onload=function(){e.data=i.result,n.encodePacket(e,t,!0,r)},i.readAsArrayBuffer(e.data)}function o(e,t,r){if(!t)return n.encodeBase64Packet(e,r);if(p)return i(e,t,r);var o=new Uint8Array(1);o[0]=f[e.type];var a=new g([o.buffer,e.data]);return r(a)}function a(e,t,n){for(var r=new Array(e.length),i=u(e.length,n),o=function(e,n,i){t(n,function(t,n){r[e]=n,i(t,r)})},a=0;a<e.length;a++)o(a,e[a],i)}var s=e("./keys"),l=e("arraybuffer.slice"),c=e("base64-arraybuffer"),u=e("after"),d=e("utf8"),p=navigator.userAgent.match(/Android/i);n.protocol=3;var f=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=s(f),m={type:"error",data:"parser error"},g=e("blob");n.encodePacket=function(e,n,i,a){"function"==typeof n&&(a=n,n=!1),"function"==typeof i&&(a=i,i=null);var s=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&s instanceof ArrayBuffer)return r(e,n,a);if(g&&s instanceof t.Blob)return o(e,n,a);var l=f[e.type];return void 0!==e.data&&(l+=i?d.encode(String(e.data)):String(e.data)),a(""+l)},n.encodeBase64Packet=function(e,r){var i="b"+n.packets[e.type];if(g&&e.data instanceof g){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];r(i+e)},o.readAsDataURL(e.data)}var a;try{a=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(s){for(var l=new Uint8Array(e.data),c=new Array(l.length),u=0;u<l.length;u++)c[u]=l[u];a=String.fromCharCode.apply(null,c)}return i+=t.btoa(a),r(i)},n.decodePacket=function(e,t,r){if("string"==typeof e||void 0===e){if("b"==e.charAt(0))return n.decodeBase64Packet(e.substr(1),t);if(r)try{e=d.decode(e)}catch(i){return m}var o=e.charAt(0);return Number(o)==o&&h[o]?e.length>1?{type:h[o],data:e.substring(1)}:{type:h[o]}:m}var a=new Uint8Array(e),o=a[0],s=l(e,1);return g&&"blob"===t&&(s=new g([s])),{type:h[o],data:s}},n.decodeBase64Packet=function(e,n){var r=h[e.charAt(0)];if(!t.ArrayBuffer)return{type:r,data:{base64:!0,data:e.substr(1)}};var i=c.decode(e.substr(1));return"blob"===n&&g&&(i=new g([i])),{type:r,data:i}},n.encodePayload=function(e,t,r){function i(e){return e.length+":"+e}function o(e,r){n.encodePacket(e,t,!0,function(e){r(null,i(e))})}return"function"==typeof t&&(r=t,t=null),t?g&&!p?n.encodePayloadAsBlob(e,r):n.encodePayloadAsArrayBuffer(e,r):e.length?void a(e,o,function(e,t){return r(t.join(""))}):r("0:")},n.decodePayload=function(e,t,r){if("string"!=typeof e)return n.decodePayloadAsBinary(e,t,r);"function"==typeof t&&(r=t,t=null);var i;if(""==e)return r(m,0,1);for(var o,a,s="",l=0,c=e.length;c>l;l++){var u=e.charAt(l);if(":"!=u)s+=u;else{if(""==s||s!=(o=Number(s)))return r(m,0,1);if(a=e.substr(l+1,o),s!=a.length)return r(m,0,1);if(a.length){if(i=n.decodePacket(a,t,!0),m.type==i.type&&m.data==i.data)return r(m,0,1);var d=r(i,l+o,c);if(!1===d)return}l+=o,s=""}}return""!=s?r(m,0,1):void 0},n.encodePayloadAsArrayBuffer=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){return t(null,e)})}return e.length?void a(e,r,function(e,n){var r=n.reduce(function(e,t){var n;return n="string"==typeof t?t.length:t.byteLength,e+n.toString().length+n+2},0),i=new Uint8Array(r),o=0;return n.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),a=0;a<e.length;a++)r[a]=e.charCodeAt(a);n=r.buffer}i[o++]=t?0:1;for(var s=n.byteLength.toString(),a=0;a<s.length;a++)i[o++]=parseInt(s[a]);i[o++]=255;for(var r=new Uint8Array(n),a=0;a<r.length;a++)i[o++]=r[a]}),t(i.buffer)}):t(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){var n=new Uint8Array(1);if(n[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);e=r.buffer,n[0]=0}for(var o=e instanceof ArrayBuffer?e.byteLength:e.size,a=o.toString(),s=new Uint8Array(a.length+1),i=0;i<a.length;i++)s[i]=parseInt(a[i]);if(s[a.length]=255,g){var l=new g([n.buffer,s.buffer,e]);t(null,l)}})}a(e,r,function(e,n){return t(new g(n))})},n.decodePayloadAsBinary=function(e,t,r){"function"==typeof t&&(r=t,t=null);for(var i=e,o=[],a=!1;i.byteLength>0;){for(var s=new Uint8Array(i),c=0===s[0],u="",d=1;255!=s[d];d++){if(u.length>310){a=!0;break}u+=s[d]}if(a)return r(m,0,1);i=l(i,2+u.length),u=parseInt(u);var p=l(i,0,u);if(c)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(f){var h=new Uint8Array(p);p="";for(var d=0;d<h.length;d++)p+=String.fromCharCode(h[d])}o.push(p),i=l(i,u)}var g=o.length;o.forEach(function(e,i){r(n.decodePacket(e,t,!0),i,g)})}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":22,after:23,"arraybuffer.slice":24,"base64-arraybuffer":25,blob:26,utf8:27}],22:[function(e,t){t.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},{}],23:[function(e,t){function n(e,t,n){function i(e,r){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(o=!0,t(e),t=n):0!==i.count||o||t(null,r)}var o=!1;return n=n||r,i.count=e,0===e?t():i}function r(){}t.exports=n},{}],24:[function(e,t){t.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(0>t&&(t+=r),0>n&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(n-t),a=t,s=0;n>a;a++,s++)o[s]=i[a];return o.buffer}},{}],25:[function(e,t,n){!function(e){n.encode=function(t){var n,r=new Uint8Array(t),i=r.length,o="";for(n=0;i>n;n+=3)o+=e[r[n]>>2],o+=e[(3&r[n])<<4|r[n+1]>>4],o+=e[(15&r[n+1])<<2|r[n+2]>>6],o+=e[63&r[n+2]];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(t){var n,r,i,o,a,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),d=new Uint8Array(u);for(n=0;l>n;n+=4)r=e.indexOf(t[n]),i=e.indexOf(t[n+1]),o=e.indexOf(t[n+2]),a=e.indexOf(t[n+3]),d[c++]=r<<2|i>>4,d[c++]=(15&i)<<4|o>>2,d[c++]=(3&o)<<6|63&a;return u}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],26:[function(e,t){(function(e){function n(e,t){t=t||{};for(var n=new r,i=0;i<e.length;i++)n.append(e[i]);return t.type?n.getBlob(t.type):n.getBlob()}var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,i=function(){try{var e=new Blob(["hi"]);return 2==e.size}catch(t){return!1}}(),o=r&&r.prototype.append&&r.prototype.getBlob;t.exports=function(){return i?e.Blob:o?n:void 0}()}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(t,n,r){(function(t){!function(i){function o(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function a(e){for(var t,n=e.length,r=-1,i="";++r<n;)t=e[r],t>65535&&(t-=65536,i+=_(t>>>10&1023|55296),t=56320|1023&t),i+=_(t);return i}function s(e,t){return _(e>>t&63|128)}function l(e){if(0==(4294967168&e))return _(e);var t="";return 0==(4294965248&e)?t=_(e>>6&31|192):0==(4294901760&e)?(t=_(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=_(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+=_(63&e|128)}function c(e){for(var t,n=o(e),r=n.length,i=-1,a="";++i<r;)t=n[i],a+=l(t);return a}function u(){if(y>=v)throw Error("Invalid byte index");var e=255&g[y];if(y++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function d(){var e,t,n,r,i;if(y>v)throw Error("Invalid byte index");if(y==v)return!1;if(e=255&g[y],y++,0==(128&e))return e;if(192==(224&e)){var t=u();if(i=(31&e)<<6|t,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=u(),n=u(),i=(15&e)<<12|t<<6|n,i>=2048)return i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=u(),n=u(),r=u(),i=(15&e)<<18|t<<12|n<<6|r,i>=65536&&1114111>=i))return i;throw Error("Invalid UTF-8 detected")}function p(e){g=o(e),v=g.length,y=0;for(var t,n=[];(t=d())!==!1;)n.push(t);return a(n)}var f="object"==typeof r&&r,h="object"==typeof n&&n&&n.exports==f&&n,m="object"==typeof t&&t;(m.global===m||m.window===m)&&(i=m);var g,v,y,_=String.fromCharCode,b={version:"2.0.0",encode:c,decode:p};if("function"==typeof e&&"object"==typeof e.amd&&e.amd)e(function(){return b});else if(f&&!f.nodeType)if(h)h.exports=b;else{var E={},w=E.hasOwnProperty;for(var S in b)w.call(b,S)&&(f[S]=b[S])}else i.utf8=b}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t){(function(e){var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,o=/(?:^|:|,)(?:\s*\[)+/g,a=/^\s+/,s=/\s+$/;t.exports=function(t){return"string"==typeof t&&t?(t=t.replace(a,"").replace(s,""),e.JSON&&JSON.parse?JSON.parse(t):n.test(t.replace(r,"@").replace(i,"]").replace(o,""))?new Function("return "+t)():void 0):null}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],29:[function(e,t,n){n.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},n.decode=function(e){for(var t={},n=e.split("&"),r=0,i=n.length;i>r;r++){var o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}},{}],30:[function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(e){var t=e,i=e.indexOf("["),o=e.indexOf("]");-1!=i&&-1!=o&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));for(var a=n.exec(e||""),s={},l=14;l--;)s[r[l]]=a[l]||"";return-1!=i&&-1!=o&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s}},{}],31:[function(e,t){function n(e,t){var n;return n=t?new i(e,t):new i(e)}var r=function(){return this}(),i=r.WebSocket||r.MozWebSocket;t.exports=i?n:null,i&&(n.prototype=i.prototype)},{}],32:[function(e,t){(function(n){function r(e){function t(e){if(!e)return!1;if(n.Buffer&&n.Buffer.isBuffer(e)||n.ArrayBuffer&&e instanceof ArrayBuffer||n.Blob&&e instanceof Blob||n.File&&e instanceof File)return!0;if(i(e)){for(var r=0;r<e.length;r++)if(t(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&(e=e.toJSON());for(var o in e)if(e.hasOwnProperty(o)&&t(e[o]))return!0}return!1}return t(e)}var i=e("isarray");t.exports=r}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{isarray:33}],33:[function(e,t){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],34:[function(e,t){var n=e("global");try{t.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch(r){t.exports=!1}},{global:35}],35:[function(e,t){t.exports=function(){return this}()},{}],36:[function(e,t){var n=[].indexOf;t.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},{}],37:[function(e,t,n){var r=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t},n.values=function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(e[n]);return t},n.merge=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);return e},n.length=function(e){return n.keys(e).length},n.isEmpty=function(e){return 0==n.length(e)}},{}],38:[function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(e){for(var t=n.exec(e||""),i={},o=14;o--;)i[r[o]]=t[o]||"";return i}},{}],39:[function(e,t,n){(function(t){var r=e("isarray"),i=e("./is-buffer");n.deconstructPacket=function(e){function t(e){if(!e)return e;if(i(e)){var o={_placeholder:!0,num:n.length};return n.push(e),o}if(r(e)){for(var a=new Array(e.length),s=0;s<e.length;s++)a[s]=t(e[s]);return a}if("object"==typeof e&&!(e instanceof Date)){var a={};for(var l in e)a[l]=t(e[l]);
11return a}return e}var n=[],o=e.data,a=e;return a.data=t(o),a.attachments=n.length,{packet:a,buffers:n}},n.reconstructPacket=function(e,t){function n(e){if(e&&e._placeholder){var i=t[e.num];return i}if(r(e)){for(var o=0;o<e.length;o++)e[o]=n(e[o]);return e}if(e&&"object"==typeof e){for(var a in e)e[a]=n(e[a]);return e}return e}return e.data=n(e.data),e.attachments=void 0,e},n.removeBlobs=function(e,n){function o(e,l,c){if(!e)return e;if(t.Blob&&e instanceof Blob||t.File&&e instanceof File){a++;var u=new FileReader;u.onload=function(){c?c[l]=this.result:s=this.result,--a||n(s)},u.readAsArrayBuffer(e)}else if(r(e))for(var d=0;d<e.length;d++)o(e[d],d,e);else if(e&&"object"==typeof e&&!i(e))for(var p in e)o(e[p],p,e)}var a=0,s=e;o(s),a||n(s)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./is-buffer":41,isarray:42}],40:[function(e,t,n){function r(){}function i(e){var t="",r=!1;return t+=e.type,(n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)&&(t+=e.attachments,t+="-"),e.nsp&&"/"!=e.nsp&&(r=!0,t+=e.nsp),null!=e.id&&(r&&(t+=",",r=!1),t+=e.id),null!=e.data&&(r&&(t+=","),t+=d.stringify(e.data)),u("encoded %j as %s",e,t),t}function o(e,t){function n(e){var n=f.deconstructPacket(e),r=i(n.packet),o=n.buffers;o.unshift(r),t(o)}f.removeBlobs(e,n)}function a(){this.reconstructor=null}function s(e){var t={},r=0;if(t.type=Number(e.charAt(0)),null==n.types[t.type])return c();if(n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type){for(t.attachments="";"-"!=e.charAt(++r);)t.attachments+=e.charAt(r);t.attachments=Number(t.attachments)}if("/"==e.charAt(r+1))for(t.nsp="";++r;){var i=e.charAt(r);if(","==i)break;if(t.nsp+=i,r+1==e.length)break}else t.nsp="/";var o=e.charAt(r+1);if(""!=o&&Number(o)==o){for(t.id="";++r;){var i=e.charAt(r);if(null==i||Number(i)!=i){--r;break}if(t.id+=e.charAt(r),r+1==e.length)break}t.id=Number(t.id)}if(e.charAt(++r))try{t.data=d.parse(e.substr(r))}catch(a){return c()}return u("decoded %s as %j",e,t),t}function l(e){this.reconPack=e,this.buffers=[]}function c(){return{type:n.ERROR,data:"parser error"}}var u=e("debug")("socket.io-parser"),d=e("json3"),p=(e("isarray"),e("component-emitter")),f=e("./binary"),h=e("./is-buffer");n.protocol=4,n.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],n.CONNECT=0,n.DISCONNECT=1,n.EVENT=2,n.ACK=3,n.ERROR=4,n.BINARY_EVENT=5,n.BINARY_ACK=6,n.Encoder=r,n.Decoder=a,r.prototype.encode=function(e,t){if(u("encoding packet %j",e),n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)o(e,t);else{var r=i(e);t([r])}},p(a.prototype),a.prototype.add=function(e){var t;if("string"==typeof e)t=s(e),n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type?(this.reconstructor=new l(t),0==this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!h(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,this.emit("decoded",t))}},a.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},l.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=f.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},l.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":39,"./is-buffer":41,"component-emitter":8,debug:9,isarray:42,json3:43}],41:[function(e,t){(function(e){function n(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=n}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(e,t){t.exports=e(33)},{}],43:[function(t,n,r){!function(t){function n(e){if(n[e]!==a)return n[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=n("json-stringify")&&n("json-parse");else{var r,i='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var o=u.stringify,l="function"==typeof o&&d;if(l){(r=function(){return 1}).toJSON=r;try{l="0"===o(0)&&"0"===o(new Number)&&'""'==o(new String)&&o(s)===a&&o(a)===a&&o()===a&&"1"===o(r)&&"[1]"==o([r])&&"[null]"==o([a])&&"null"==o(null)&&"[null,null,null]"==o([a,s,null])&&o({a:[r,!0,!1,null,"\x00\b\n\f\r "]})==i&&"1"===o(null,r)&&"[\n 1,\n 2\n]"==o([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==o(new Date(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==o(new Date(864e13))&&'"-000001-01-01T00:00:00.000Z"'==o(new Date(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==o(new Date(-1))}catch(c){l=!1}}t=l}if("json-parse"==e){var p=u.parse;if("function"==typeof p)try{if(0===p("0")&&!p(!1)){r=p(i);var f=5==r.a.length&&1===r.a[0];if(f){try{f=!p('" "')}catch(c){}if(f)try{f=1!==p("01")}catch(c){}if(f)try{f=1!==p("1.")}catch(c){}}}}catch(c){f=!1}t=f}}return n[e]=!!t}var i,o,a,s={}.toString,l="function"==typeof e&&e.amd,c="object"==typeof JSON&&JSON,u="object"==typeof r&&r&&!r.nodeType&&r;u&&c?(u.stringify=c.stringify,u.parse=c.parse):u=t.JSON=c||{};var d=new Date(-0xc782b5b800cec);try{d=-109252==d.getUTCFullYear()&&0===d.getUTCMonth()&&1===d.getUTCDate()&&10==d.getUTCHours()&&37==d.getUTCMinutes()&&6==d.getUTCSeconds()&&708==d.getUTCMilliseconds()}catch(p){}if(!n("json")){var f="[object Function]",h="[object Date]",m="[object Number]",g="[object String]",v="[object Array]",y="[object Boolean]",_=n("bug-string-char-index");if(!d)var b=Math.floor,E=[0,31,59,90,120,151,181,212,243,273,304,334],w=function(e,t){return E[t]+365*(e-1970)+b((e-1969+(t=+(t>1)))/4)-b((e-1901+t)/100)+b((e-1601+t)/400)};(i={}.hasOwnProperty)||(i=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=s?i=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,i=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,i.call(this,e)});var S={"boolean":1,number:1,string:1,undefined:1},C=function(e,t){var n=typeof e[t];return"object"==n?!!e[t]:!S[n]};if(o=function(e,t){var n,r,a,l=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(a in r)i.call(r,a)&&l++;return n=r=null,l?o=2==l?function(e,t){var n,r={},o=s.call(e)==f;for(n in e)o&&"prototype"==n||i.call(r,n)||!(r[n]=1)||!i.call(e,n)||t(n)}:function(e,t){var n,r,o=s.call(e)==f;for(n in e)o&&"prototype"==n||!i.call(e,n)||(r="constructor"===n)||t(n);(r||i.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],o=function(e,t){var n,o,a=s.call(e)==f,l=!a&&"function"!=typeof e.constructor&&C(e,"hasOwnProperty")?e.hasOwnProperty:i;for(n in e)a&&"prototype"==n||!l.call(e,n)||t(n);for(o=r.length;n=r[--o];l.call(e,n)&&t(n));}),o(e,t)},!n("json-stringify")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},k="000000",x=function(e,t){return(k+(t||0)).slice(-e)},T="\\u00",D=function(e){var t,n='"',r=0,i=e.length,o=i>10&&_;for(o&&(t=e.split(""));i>r;r++){var a=e.charCodeAt(r);switch(a){case 8:case 9:case 10:case 12:case 13:case 34:case 92:n+=I[a];break;default:if(32>a){n+=T+x(2,a.toString(16));break}n+=o?t[r]:_?e.charAt(r):e[r]}}return n+'"'},M=function(e,t,n,r,l,c,u){var d,p,f,_,E,S,C,I,k,T,O,L,R,A,N,P;try{d=t[e]}catch(F){}if("object"==typeof d&&d)if(p=s.call(d),p!=h||i.call(d,"toJSON"))"function"==typeof d.toJSON&&(p!=m&&p!=g&&p!=v||i.call(d,"toJSON"))&&(d=d.toJSON(e));else if(d>-1/0&&1/0>d){if(w){for(E=b(d/864e5),f=b(E/365.2425)+1970-1;w(f+1,0)<=E;f++);for(_=b((E-w(f,0))/30.42);w(f,_+1)<=E;_++);E=1+E-w(f,_),S=(d%864e5+864e5)%864e5,C=b(S/36e5)%24,I=b(S/6e4)%60,k=b(S/1e3)%60,T=S%1e3}else f=d.getUTCFullYear(),_=d.getUTCMonth(),E=d.getUTCDate(),C=d.getUTCHours(),I=d.getUTCMinutes(),k=d.getUTCSeconds(),T=d.getUTCMilliseconds();d=(0>=f||f>=1e4?(0>f?"-":"+")+x(6,0>f?-f:f):x(4,f))+"-"+x(2,_+1)+"-"+x(2,E)+"T"+x(2,C)+":"+x(2,I)+":"+x(2,k)+"."+x(3,T)+"Z"}else d=null;if(n&&(d=n.call(t,e,d)),null===d)return"null";if(p=s.call(d),p==y)return""+d;if(p==m)return d>-1/0&&1/0>d?""+d:"null";if(p==g)return D(""+d);if("object"==typeof d){for(A=u.length;A--;)if(u[A]===d)throw TypeError();if(u.push(d),O=[],N=c,c+=l,p==v){for(R=0,A=d.length;A>R;R++)L=M(R,d,n,r,l,c,u),O.push(L===a?"null":L);P=O.length?l?"[\n"+c+O.join(",\n"+c)+"\n"+N+"]":"["+O.join(",")+"]":"[]"}else o(r||d,function(e){var t=M(e,d,n,r,l,c,u);t!==a&&O.push(D(e)+":"+(l?" ":"")+t)}),P=O.length?l?"{\n"+c+O.join(",\n"+c)+"\n"+N+"}":"{"+O.join(",")+"}":"{}";return u.pop(),P}};u.stringify=function(e,t,n){var r,i,o,a;if("function"==typeof t||"object"==typeof t&&t)if((a=s.call(t))==f)i=t;else if(a==v){o={};for(var l,c=0,u=t.length;u>c;l=t[c++],a=s.call(l),(a==g||a==m)&&(o[l]=1));}if(n)if((a=s.call(n))==m){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else a==g&&(r=n.length<=10?n:n.slice(0,10));return M("",(l={},l[""]=e,l),i,o,r,"",[])}}if(!n("json-parse")){var O,L,R=String.fromCharCode,A={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:"\n",102:"\f",114:"\r"},N=function(){throw O=L=null,SyntaxError()},P=function(){for(var e,t,n,r,i,o=L,a=o.length;a>O;)switch(i=o.charCodeAt(O)){case 9:case 10:case 13:case 32:O++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=_?o.charAt(O):o[O],O++,e;case 34:for(e="@",O++;a>O;)if(i=o.charCodeAt(O),32>i)N();else if(92==i)switch(i=o.charCodeAt(++O)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=A[i],O++;break;case 117:for(t=++O,n=O+4;n>O;O++)i=o.charCodeAt(O),i>=48&&57>=i||i>=97&&102>=i||i>=65&&70>=i||N();e+=R("0x"+o.slice(t,O));break;default:N()}else{if(34==i)break;for(i=o.charCodeAt(O),t=O;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++O);e+=o.slice(t,O)}if(34==o.charCodeAt(O))return O++,e;N();default:if(t=O,45==i&&(r=!0,i=o.charCodeAt(++O)),i>=48&&57>=i){for(48==i&&(i=o.charCodeAt(O+1),i>=48&&57>=i)&&N(),r=!1;a>O&&(i=o.charCodeAt(O),i>=48&&57>=i);O++);if(46==o.charCodeAt(O)){for(n=++O;a>n&&(i=o.charCodeAt(n),i>=48&&57>=i);n++);n==O&&N(),O=n}if(i=o.charCodeAt(O),101==i||69==i){for(i=o.charCodeAt(++O),(43==i||45==i)&&O++,n=O;a>n&&(i=o.charCodeAt(n),i>=48&&57>=i);n++);n==O&&N(),O=n}return+o.slice(t,O)}if(r&&N(),"true"==o.slice(O,O+4))return O+=4,!0;if("false"==o.slice(O,O+5))return O+=5,!1;if("null"==o.slice(O,O+4))return O+=4,null;N()}return"$"},F=function(e){var t,n;if("$"==e&&N(),"string"==typeof e){if("@"==(_?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=P(),"]"!=e;n||(n=!0))n&&(","==e?(e=P(),"]"==e&&N()):N()),","==e&&N(),t.push(F(e));return t}if("{"==e){for(t={};e=P(),"}"!=e;n||(n=!0))n&&(","==e?(e=P(),"}"==e&&N()):N()),(","==e||"string"!=typeof e||"@"!=(_?e.charAt(0):e[0])||":"!=P())&&N(),t[e.slice(1)]=F(P());return t}N()}return e},$=function(e,t,n){var r=U(e,t,n);r===a?delete e[t]:e[t]=r},U=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if(s.call(i)==v)for(r=i.length;r--;)$(i,r,n);else o(i,function(e){$(i,e,n)});return n.call(e,t,i)};u.parse=function(e,t){var n,r;return O=0,L=""+e,n=F(P()),"$"!=P()&&N(),O=L=null,t&&s.call(t)==f?U((r={},r[""]=n,r),"",t):n}}}l&&e(function(){return u})}(this)},{}],44:[function(e,t){function n(e,t){var n=[];t=t||0;for(var r=t||0;r<e.length;r++)n[r-t]=e[r];return n}t.exports=n},{}]},{},[1])(1)}),define("fileSystemImpl",["require","exports","module","filesystem/FileSystemStats","filesystem/FileSystemError","socket.io"],function(e,t){function n(e){if(!e)return null;switch(e.code){case"ERR_INVALID_PARAMS":return S.INVALID_PARAMS;case"ENOENT":return S.NOT_FOUND;case"ERR_CANT_READ":return S.NOT_READABLE;case"ERR_CANT_WRITE":return S.NOT_WRITABLE;case"ERR_UNSUPPORTED_ENCODING":return S.UNSUPPORTED_ENCODING;case"ENOSPC":return S.OUT_OF_SPACE;case"EEXIST":return S.ALREADY_EXISTS}return S.UNKNOWN}function r(e,t,n,r,i,o){C.show(e,t,n,r,i,o)}function i(e,t,n,r){I.show(e,t,n,r)}function o(e,t){k.emit("stat",e,function(e){e.err?t(n(e.err)):(e.stats.mtime=new Date(e.stats.mtime),t(null,new w(e.stats)))})}function a(e,t){o(e,function(e){return e?void(e===S.NOT_FOUND?t(null,!1):t(e)):void t(null,!0)})}function s(e,t){k.emit("readdir",e,function(r){if(r.err)return t(n(r.err));var i=r.contents.length;if(!i)return t(null,[],[]);var a=[];r.contents.forEach(function(n,s){o(e+"/"+n,function(e,n){a[s]=e||n,i--,0>=i&&t(null,r.contents,a)})})})}function l(e,t,r){"function"==typeof t&&(r=t,t=parseInt("0755",8)),k.emit("mkdir",{path:e,mode:t},function(t){if(r){if(t)return r(n(t));o(e,r)}})}function c(e,t,r){k.emit("rename",{oldPath:e,newPath:t},function(e){r&&r(n(e))})}function u(e,t,r){var i,a,s,l=t.encoding||"utf8",c=!1;t.stat?(c=!0,a=t.stat):o(e,function(e,t){c?r(e,e?null:i,t):(c=!0,a=t,s=e)}),k.emit("readFile",{path:e,encoding:l},function(e){return e.err?void r(n(e.err)):void(c?r(s,s?null:e.data,a):(c=!0,i=e.data))})}function d(e,t,r,i){function a(r){k.emit("writeFile",{path:e,data:t,encoding:s},function(t){t?i(n(t)):o(e,function(e,t){i(e,t,r)})})}var s=r.encoding||"utf8";o(e,function(t,n){if(!t)return r.hasOwnProperty("expectedHash")&&r.expectedHash!==n._hash?(console.error("Blind write attempted: ",e,n._hash,r.expectedHash),r.hasOwnProperty("expectedContents")?void u(e,r,function(e,t){return e||t!==r.expectedContents?void i(S.CONTENTS_MODIFIED):void a(!1)}):void i(S.CONTENTS_MODIFIED)):void a(!1);switch(t){case S.NOT_FOUND:a(!0);break;default:i(t)}})}function p(e,t){k.emit("unlink",e,function(e){t&&t(n(e))})}function f(e,t){k.emit("moveToTrash",e,function(e){t&&t(n(e))})}function h(e,t){b=e,E=t}function m(e,t){k.emit("watchPath",e,function(e){t&&t(n(e))})}function g(e,t){k.emit("unwatchPath",e,function(e){t&&t(n(e))})}function v(e){k.emit("unwatchAll","",function(t){e&&e(n(t))})}function y(e,t,r){k.emit("copyFile",{src:e,dest:t},function(e){r&&r(n(e))})}function _(e,t){C=e,I=t}var b,E,w=e("filesystem/FileSystemStats"),S=e("filesystem/FileSystemError"),C={},I={},k=e("socket.io").connect("/brackets");k.on("greeting",function(e){"hi"===e&&console.log("Socket.io connected!")}),t.showOpenDialog=r,t.showSaveDialog=i,t.exists=a,t.readdir=s,t.mkdir=l,t.rename=c,t.stat=o,t.readFile=u,t.writeFile=d,t.unlink=p,t.moveToTrash=f,t.initWatchers=h,t.watchPath=m,t.unwatchPath=g,t.unwatchAll=v,t.copyFile=y,t._setDialogs=_,t.recursiveWatch=!1,t.normalizeUNCPaths=!1}),define("hacks.lowFs",["require","exports","module","fileSystemImpl","filesystem/FileSystemError"],function(e,t){function n(e){this._stats=e}function r(e,t){s.stat(e,function(e,r){return e?t(e):void t(null,new n(r))})}function i(e,t,n){s.mkdir(e,parseInt(t+"",8),n)}function o(e,t){s.readdir(e,t)}function a(e,t,n){s.copyFile(e,t,n)}var s=e("fileSystemImpl"),l=e("filesystem/FileSystemError");n.prototype.isDirectory=function(){return this._stats.isDirectory},n.prototype.isFile=function(){return this._stats.isFile},t.stat=r,t.makedir=i,t.readdir=o,t.copyFile=a,t.NO_ERROR=null,t.ERR_NOT_FOUND=l.NOT_FOUND}),define("utils/Global",["require","exports","module","text!config.json","utils/UrlParams","utils/ShellAPI","hacks.app","hacks.lowFs"],function(e,t){var n=e("text!config.json"),r=e("utils/UrlParams").UrlParams,i=Function,o=new i("return this")();o.brackets||(o.brackets={});var a=new r;a.parse();try{o.brackets.metadata=JSON.parse(n),o.brackets.config=o.brackets.metadata.config}catch(s){console.log(s)}o.brackets.shellAPI=e("utils/ShellAPI"),o.brackets.platform="MacIntel"===o.navigator.platform||"MacPPC"===o.navigator.platform?"mac":o.navigator.platform.indexOf("Linux")>=0?"linux":"win",o.brackets.inBrowser=!o.brackets.hasOwnProperty("fs");var l=a.get("hasNativeMenus");o.brackets.nativeMenus=l?"true"===l:!o.brackets.inBrowser&&"linux"!==o.brackets.platform,o.brackets.isLocaleDefault=function(){return!o.localStorage.getItem("locale")},o.brackets.getLocale=function(){return o.localStorage.getItem("locale")||o.require.s.contexts._.config.locale},o.brackets.setLocale=function(e){e?o.localStorage.setItem("locale",e):o.localStorage.removeItem("locale")},o.brackets.app||(o.brackets.app=e("hacks.app"),o.brackets.inBrowser=!1,o.brackets.nativeMenus=!1,o.brackets.config.extension_registry="/brackets/s3.amazonaws.com/extend.brackets/registry.json",o.brackets.fs=e("hacks.lowFs")),o.brackets.libRequire=o.require,o.brackets.getModule=e,t.global=o}),define("utils/PerfUtils",["require","exports","module","thirdparty/lodash","utils/Global"],function(e,t){function n(e,t){this.id=e,this.name=t}function r(e,r){b[e]&&console.error("Performance measurement "+e+" is already defined");var i=new n(e,r);return t[e]=i,i}function i(e){return e instanceof n?e.id:e}function o(e,t){y[e]&&console.error("Recursive tests with the same name are not supported. Timer name: "+e),y[e]={startTime:t}}function a(e){if(g){var t=brackets.app.getElapsedMilliseconds();if(e=i(e),Array.isArray(e)){var n;for(n=0;n<e.length;n++)o(e[n],t)}else o(e,t);return e}}function s(e){if(g){var t=brackets.app.getElapsedMilliseconds();e=i(e),y[e]&&(t-=y[e].startTime,delete y[e]),v[e]?Array.isArray(v[e])?v[e].push(t):v[e]=[v[e],t]:v[e]=t}}function l(e){var t=brackets.app.getElapsedMilliseconds();e=i(e),_[e]?(t-=_[e].startTime,v[e]&&Array.isArray(v[e])?v[e][v[e].length-1]=t:v[e]=t):(y[e]&&(_[e]={startTime:y[e].startTime}),s(e))}function c(e){e=i(e),y[e]&&delete y[e],_[e]&&delete _[e]}function u(e){return y[e]?!0:!1}function d(){var e=function(e){if(Array.isArray(e)){var t,n="";for(t=0;t<e.length;t++)n+=e[t],t<e.length-1&&(n+=", ");return n}return e},t="";return m.forEach(v,function(n,r){t+=e(n)+" "+r+"\n"}),t}function p(e){return e?v[i(e)]:v}function f(e){var t=Object.keys(v).filter(function(t){return e.test(t)}),n=[];return t.forEach(function(e){n.push(v[e])}),n}function h(){v={},y={},_={}}var m=e("thirdparty/lodash");e("utils/Global");var g=brackets&&!!brackets.app.getElapsedMilliseconds,v={},y={},_={},b={};r("INLINE_WIDGET_OPEN","Open inline editor or docs"),r("INLINE_WIDGET_CLOSE","Close inline editor or docs"),t.addMeasurement=s,t.finalizeMeasurement=c,t.isActive=u,t.markStart=a,t.getData=p,t.searchData=f,t.updateMeasurement=l,t.getDelimitedPerfData=d,t.createPerfMeasurement=r,t.clear=h}),define("utils/KeyEvent",{DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_SEMICOLON:186,DOM_VK_EQUALS:187,DOM_VK_COMMA:188,DOM_VK_DASH:189,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}),function(){function e(e,t,n,r,i,o){t[e]&&(n.push(e),(t[e]===!0||1===t[e])&&r.push(i+e+"/"+o))}function t(e,t,n,r,i){var o=r+t+"/"+i;require._fileExists(e.toUrl(o+".js"))&&n.push(o)}function n(e,t,r){var i;for(i in t)!t.hasOwnProperty(i)||e.hasOwnProperty(i)&&!r?"object"==typeof t[i]&&n(e[i],t[i],r):e[i]=t[i]}var r=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(i){var o=i.config?i.config():{};return{version:"2.0.1+",load:function(i,a,s,l){l=l||{},l.locale&&(o.locale=l.locale);var c,u,d,p=r.exec(i),f=p[1],h=p[4],m=p[5],g=h.split("-"),v=[],y={},_="";if(p[5]?(f=p[1],c=f+m):(c=i,m=p[4],h=o.locale,h||(h=o.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),g=h.split("-")),l.isBuild){for(v.push(c),t(a,"root",v,f,m),u=0;u<g.length;u++)d=g[u],_+=(_?"-":"")+d,t(a,_,v,f,m);a(v,function(){s()})}else a([c],function(t){var r,i=[];for(e("root",t,i,v,f,m),u=0;u<g.length;u++)r=g[u],_+=(_?"-":"")+r,e(_,t,i,v,f,m);a(v,function(){var e,r,o;for(e=i.length-1;e>-1&&i[e];e--)o=i[e],r=t[o],(r===!0||1===r)&&(r=a(f+o+"/"+m)),n(y,r);s(y)})})}}})}(),define("nls/strings",["require","exports","module"],function(e,t,n){n.exports={root:!0,cs:!0,da:!0,de:!0,el:!0,"en-gb":!0,es:!0,"fa-ir":!0,fi:!0,fr:!0,gl:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,nb:!0,nl:!0,pl:!0,"pt-br":!0,"pt-pt":!0,ro:!0,ru:!0,sk:!0,sr:!0,sv:!0,tr:!0,uk:!0,"zh-cn":!0,"zh-tw":!0}}),define("nls/root/strings",{GENERIC_ERROR:"(error {0})",NOT_FOUND_ERR:"The file could not be found.",NOT_READABLE_ERR:"The file could not be read.",NO_MODIFICATION_ALLOWED_ERR:"The target directory cannot be modified.",NO_MODIFICATION_ALLOWED_ERR_FILE:"The permissions do not allow you to make modifications.",CONTENTS_MODIFIED_ERR:"The file has been modified outside of {APP_NAME}.",UNSUPPORTED_ENCODING_ERR:"{APP_NAME} currently only supports UTF-8 encoded text files.",FILE_EXISTS_ERR:"The file or directory already exists.",FILE:"file",FILE_TITLE:"File",DIRECTORY:"directory",DIRECTORY_TITLE:"Directory",DIRECTORY_NAMES_LEDE:"Directory names",FILENAMES_LEDE:"Filenames",FILENAME:"Filename",DIRECTORY_NAME:"Directory Name",ERROR_LOADING_PROJECT:"Error Loading Project",OPEN_DIALOG_ERROR:"An error occurred when showing the open file dialog. (error {0})",REQUEST_NATIVE_FILE_SYSTEM_ERROR:"An error occurred when trying to load the directory <span class='dialog-filename'>{0}</span>. (error {1})",READ_DIRECTORY_ENTRIES_ERROR:"An error occurred when reading the contents of the directory <span class='dialog-filename'>{0}</span>. (error {1})",ERROR_OPENING_FILE_TITLE:"Error Opening File",ERROR_OPENING_FILE:"An error occurred when trying to open the file <span class='dialog-filename'>{0}</span>. {1}",ERROR_OPENING_FILES:"An error occurred when trying to open the following files:",ERROR_RELOADING_FILE_TITLE:"Error Reloading Changes From Disk",ERROR_RELOADING_FILE:"An error occurred when trying to reload the file <span class='dialog-filename'>{0}</span>. {1}",ERROR_SAVING_FILE_TITLE:"Error Saving File",ERROR_SAVING_FILE:"An error occurred when trying to save the file <span class='dialog-filename'>{0}</span>. {1}",ERROR_RENAMING_FILE_TITLE:"Error Renaming {0}",ERROR_RENAMING_FILE:"An error occurred when trying to rename the {2} <span class='dialog-filename'>{0}</span>. {1}",ERROR_DELETING_FILE_TITLE:"Error Deleting {0}",ERROR_DELETING_FILE:"An error occurred when trying to delete the {2} <span class='dialog-filename'>{0}</span>. {1}",INVALID_FILENAME_TITLE:"Invalid {0}",INVALID_FILENAME_MESSAGE:"{0} cannot use any system reserved words, end with dots (.) or use any of the following characters: <code class='emphasized'>{1}</code>",ENTRY_WITH_SAME_NAME_EXISTS:"A file or directory with the name <span class='dialog-filename'>{0}</span> already exists.",ERROR_CREATING_FILE_TITLE:"Error Creating {0}",ERROR_CREATING_FILE:"An error occurred when trying to create the {0} <span class='dialog-filename'>{1}</span>. {2}",ERROR_MIXED_DRAGDROP:"Cannot open a folder at the same time as opening other files.",ERROR_PREFS_CORRUPT_TITLE:"Error Reading Preferences",ERROR_PREFS_CORRUPT:"Your preferences file is not valid JSON. The file will be opened so that you can correct the format. You will need to restart {APP_NAME} for the changes to take effect.",ERROR_IN_BROWSER_TITLE:"Oops! {APP_NAME} Doesn't Run in Browsers Yet.",ERROR_IN_BROWSER:"{APP_NAME} is built in HTML, but right now it runs as a desktop app so you can use it to edit local files. Please use the application shell in the <b>github.com/adobe/brackets-shell</b> repo to run {APP_NAME}.",ERROR_MAX_FILES_TITLE:"Error Indexing Files",ERROR_MAX_FILES:"This project contains more than 30,000 files. Features that operate across multiple files may be disabled or behave as if the project is empty. <a href='https://github.com/adobe/brackets/wiki/Large-Projects'>Read more about working with large projects</a>.",ERROR_LAUNCHING_BROWSER_TITLE:"Error Launching Browser",ERROR_CANT_FIND_CHROME:"The Google Chrome browser could not be found. Please make sure it is installed.",ERROR_LAUNCHING_BROWSER:"An error occurred when launching the browser. (error {0})",LIVE_DEVELOPMENT_ERROR_TITLE:"Live Preview Error",LIVE_DEVELOPMENT_RELAUNCH_TITLE:"Connecting to Browser",LIVE_DEVELOPMENT_ERROR_MESSAGE:"In order for Live Preview to connect, Chrome needs to be relaunched with remote debugging enabled.<br /><br />Would you like to relaunch Chrome and enable remote debugging?<br /><br />",LIVE_DEV_LOADING_ERROR_MESSAGE:"Unable to load Live Preview page.",LIVE_DEV_NEED_HTML_MESSAGE:"Open an HTML file or make sure there is an index.html file in your project in order to launch live preview.",LIVE_DEV_NEED_BASEURL_MESSAGE:"To launch live preview with a server-side file, you need to specify a Base URL for this project.",LIVE_DEV_SERVER_NOT_READY_MESSAGE:"Error starting up the HTTP server for live preview files. Please try again.",LIVE_DEVELOPMENT_INFO_TITLE:"Welcome to Live Preview!",LIVE_DEVELOPMENT_INFO_MESSAGE:"Live Preview connects {APP_NAME} to your browser. It launches a preview of your HTML file in the browser, then updates the preview instantly as you edit your code.<br /><br />In this early version of {APP_NAME}, Live Preview only works with <strong>Google Chrome</strong> and updates live as you edit <strong>CSS or HTML files</strong>. Changes to JavaScript files are automatically reloaded when you save.<br /><br />(You'll only see this message once.)",LIVE_DEVELOPMENT_TROUBLESHOOTING:"For more information, see <a href='{0}' title='{0}'>Troubleshooting Live Preview connection errors</a>.",LIVE_DEV_STATUS_TIP_NOT_CONNECTED:"Live Preview",LIVE_DEV_STATUS_TIP_PROGRESS1:"Live Preview: Connecting…",LIVE_DEV_STATUS_TIP_PROGRESS2:"Live Preview: Initializing…",LIVE_DEV_STATUS_TIP_CONNECTED:"Disconnect Live Preview",LIVE_DEV_STATUS_TIP_OUT_OF_SYNC:"Live Preview (save file to refresh)",LIVE_DEV_STATUS_TIP_SYNC_ERROR:"Live Preview (not updating due to syntax error)",LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS:"Live Preview was cancelled because the browser's developer tools were opened",LIVE_DEV_DETACHED_TARGET_CLOSED:"Live Preview was cancelled because the page was closed in the browser",LIVE_DEV_NAVIGATED_AWAY:"Live Preview was cancelled because the browser navigated to a page that is not part of the current project",LIVE_DEV_CLOSED_UNKNOWN_REASON:"Live Preview was cancelled for an unknown reason ({0})",SAVE_CLOSE_TITLE:"Save Changes",SAVE_CLOSE_MESSAGE:"Do you want to save the changes you made in the document <span class='dialog-filename'>{0}</span>?",SAVE_CLOSE_MULTI_MESSAGE:"Do you want to save your changes to the following files?",EXT_MODIFIED_TITLE:"External Changes",CONFIRM_FOLDER_DELETE_TITLE:"Confirm Delete",CONFIRM_FOLDER_DELETE:"Are you sure you want to delete the folder <span class='dialog-filename'>{0}</span>?",FILE_DELETED_TITLE:"File Deleted",EXT_MODIFIED_WARNING:"<span class='dialog-filename'>{0}</span> has been modified on disk.<br /><br />Do you want to save the file and overwrite those changes?",EXT_MODIFIED_MESSAGE:"<span class='dialog-filename'>{0}</span> has been modified on disk, but also has unsaved changes in {APP_NAME}.<br /><br />Which version do you want to keep?",EXT_DELETED_MESSAGE:"<span class='dialog-filename'>{0}</span> has been deleted on disk, but has unsaved changes in {APP_NAME}.<br /><br />Do you want to keep your changes?",DONE:"Done",OK:"OK",CANCEL:"Cancel",DONT_SAVE:"Don't Save",SAVE:"Save",SAVE_AS:"Save As…",SAVE_AND_OVERWRITE:"Overwrite",DELETE:"Delete",BUTTON_YES:"Yes",BUTTON_NO:"No",FIND_MATCH_INDEX:"{0} of {1}",FIND_NO_RESULTS:"No results",FIND_QUERY_PLACEHOLDER:"Find…",REPLACE_PLACEHOLDER:"Replace with…",BUTTON_REPLACE_ALL:"Batch…",BUTTON_REPLACE_ALL_IN_FILES:"Replace…",BUTTON_REPLACE:"Replace",BUTTON_NEXT:"▶",BUTTON_PREV:"◀",BUTTON_NEXT_HINT:"Next Match",BUTTON_PREV_HINT:"Previous Match",BUTTON_CASESENSITIVE_HINT:"Match Case",BUTTON_REGEXP_HINT:"Regular Expression",REPLACE_WITHOUT_UNDO_WARNING_TITLE:"Replace Without Undo",REPLACE_WITHOUT_UNDO_WARNING:"Because more than {0} files need to be changed, {APP_NAME} will modify unopened files on disk.<br />You won't be able to undo replacements in those files.",BUTTON_REPLACE_WITHOUT_UNDO:"Replace Without Undo",OPEN_FILE:"Open File",SAVE_FILE_AS:"Save File",CHOOSE_FOLDER:"Choose a folder",RELEASE_NOTES:"Release Notes",NO_UPDATE_TITLE:"You're Up to Date!",NO_UPDATE_MESSAGE:"You are running the latest version of {APP_NAME}.",FIND_REPLACE_TITLE_LABEL:"Replace",FIND_REPLACE_TITLE_WITH:"with",FIND_TITLE_LABEL:"Found",FIND_TITLE_SUMMARY:"&mdash; {0} {1} {2} in {3}",FIND_NUM_FILES:"{0} {1}",FIND_IN_FILES_SCOPED:"in <span class='dialog-filename'>{0}</span>",FIND_IN_FILES_NO_SCOPE:"in project",FIND_IN_FILES_ZERO_FILES:"Filter excludes all files {0}",FIND_IN_FILES_FILE:"file",FIND_IN_FILES_FILES:"files",FIND_IN_FILES_MATCH:"match",FIND_IN_FILES_MATCHES:"matches",FIND_IN_FILES_MORE_THAN:"Over ",FIND_IN_FILES_PAGING:"{0}&mdash;{1}",FIND_IN_FILES_FILE_PATH:"<span class='dialog-filename'>{0}</span> {2} <span class='dialog-path'>{1}</span>",FIND_IN_FILES_EXPAND_COLLAPSE:"Ctrl/Cmd click to expand/collapse all",REPLACE_IN_FILES_ERRORS_TITLE:"Replace Errors",REPLACE_IN_FILES_ERRORS:"The following files weren't modified because they changed after the search or couldn't be written.",ERROR_FETCHING_UPDATE_INFO_TITLE:"Error Getting Update Info",ERROR_FETCHING_UPDATE_INFO_MSG:"There was a problem getting the latest update information from the server. Please make sure you are connected to the internet and try again.",NEW_FILE_FILTER:"New Exclusion Set…",CLEAR_FILE_FILTER:"Don't Exclude Files",NO_FILE_FILTER:"No Files Excluded",EXCLUDE_FILE_FILTER:"Exclude {0}",EDIT_FILE_FILTER:"Edit…",FILE_FILTER_DIALOG:"Edit Exclusion Set",FILE_FILTER_INSTRUCTIONS:"Exclude files and folders matching any of the following strings / substrings or <a href='{0}' title='{0}'>wildcards</a>. Enter each string on a new line.",FILTER_NAME_PLACEHOLDER:"Name this exclusion set (optional)",FILE_FILTER_CLIPPED_SUFFIX:"and {0} more",FILTER_COUNTING_FILES:"Counting files…",FILTER_FILE_COUNT:"Allows {0} of {1} files {2}",FILTER_FILE_COUNT_ALL:"Allows all {0} files {1}",ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND:"No Quick Edit available for current cursor position",ERROR_CSSQUICKEDIT_BETWEENCLASSES:"CSS Quick Edit: place cursor on a single class name",ERROR_CSSQUICKEDIT_CLASSNOTFOUND:"CSS Quick Edit: incomplete class attribute",ERROR_CSSQUICKEDIT_IDNOTFOUND:"CSS Quick Edit: incomplete id attribute",ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR:"CSS Quick Edit: place cursor in tag, class, or id",ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX:"CSS Timing Function Quick Edit: invalid syntax",ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND:"JS Quick Edit: place cursor in function name",ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND:"No Quick Docs available for current cursor position",PROJECT_LOADING:"Loading…",UNTITLED:"Untitled",WORKING_FILES:"Working Files",TOP:"Top",BOTTOM:"Bottom",LEFT:"Left",RIGHT:"Right",CMD_SPLITVIEW_NONE:"No Split",CMD_SPLITVIEW_VERTICAL:"Vertical Split",CMD_SPLITVIEW_HORIZONTAL:"Horizontal Split",SPLITVIEW_MENU_TOOLTIP:"Split the editor vertically or horizontally",GEAR_MENU_TOOLTIP:"Configure Working Set",SPLITVIEW_INFO_TITLE:"Already Open",SPLITVIEW_MULTIPANE_WARNING:"The file is already open in another pane. {APP_NAME} will soon support opening the same file in more than one pane. Until then, the file will be shown in the pane it's already open in.<br /><br />(You'll only see this message once.)",KEYBOARD_CTRL:"Ctrl",KEYBOARD_SHIFT:"Shift",KEYBOARD_SPACE:"Space",STATUSBAR_CURSOR_POSITION:"Line {0}, Column {1}",STATUSBAR_SELECTION_CH_SINGULAR:" — Selected {0} column",STATUSBAR_SELECTION_CH_PLURAL:" — Selected {0} columns",STATUSBAR_SELECTION_LINE_SINGULAR:" — Selected {0} line",STATUSBAR_SELECTION_LINE_PLURAL:" — Selected {0} lines",STATUSBAR_SELECTION_MULTIPLE:" — {0} selections",STATUSBAR_INDENT_TOOLTIP_SPACES:"Click to switch indentation to spaces",STATUSBAR_INDENT_TOOLTIP_TABS:"Click to switch indentation to tabs",STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES:"Click to change number of spaces used when indenting",STATUSBAR_INDENT_SIZE_TOOLTIP_TABS:"Click to change tab character width",STATUSBAR_SPACES:"Spaces:",STATUSBAR_TAB_SIZE:"Tab Size:",STATUSBAR_LINE_COUNT_SINGULAR:"— {0} Line",STATUSBAR_LINE_COUNT_PLURAL:"— {0} Lines",STATUSBAR_USER_EXTENSIONS_DISABLED:"Extensions Disabled",STATUSBAR_INSERT:"INS",STATUSBAR_OVERWRITE:"OVR",STATUSBAR_INSOVR_TOOLTIP:"Click to toggle cursor between Insert (INS) and Overwrite (OVR) modes",STATUSBAR_LANG_TOOLTIP:"Click to change file type",STATUSBAR_CODE_INSPECTION_TOOLTIP:"{0}. Click to toggle report panel.",STATUSBAR_DEFAULT_LANG:"(default)",STATUSBAR_SET_DEFAULT_LANG:"Set as Default for .{0} Files",ERRORS_PANEL_TITLE_MULTIPLE:"{0} Problems",SINGLE_ERROR:"1 {0} Problem",MULTIPLE_ERRORS:"{1} {0} Problems",NO_ERRORS:"No {0} problems found - good job!",NO_ERRORS_MULTIPLE_PROVIDER:"No problems found - good job!",LINT_DISABLED:"Linting is disabled",NO_LINT_AVAILABLE:"No linter available for {0}",NOTHING_TO_LINT:"Nothing to lint",LINTER_TIMED_OUT:"{0} has timed out after waiting for {1} ms",LINTER_FAILED:"{0} terminated with error: {1}",FILE_MENU:"File",CMD_FILE_NEW_UNTITLED:"New",CMD_FILE_NEW:"New File",CMD_FILE_NEW_FOLDER:"New Folder",CMD_FILE_OPEN:"Open…",CMD_ADD_TO_WORKING_SET:"Open To Working Set",CMD_OPEN_DROPPED_FILES:"Open Dropped Files",CMD_OPEN_FOLDER:"Open Folder…",CMD_FILE_CLOSE:"Close",CMD_FILE_CLOSE_ALL:"Close All",CMD_FILE_CLOSE_LIST:"Close List",CMD_FILE_CLOSE_OTHERS:"Close Others",CMD_FILE_CLOSE_ABOVE:"Close Others Above",CMD_FILE_CLOSE_BELOW:"Close Others Below",CMD_FILE_SAVE:"Save",CMD_FILE_SAVE_ALL:"Save All",CMD_FILE_SAVE_AS:"Save As…",CMD_LIVE_FILE_PREVIEW:"Live Preview",CMD_RELOAD_LIVE_PREVIEW:"Force Reload Live Preview",CMD_PROJECT_SETTINGS:"Project Settings…",CMD_FILE_RENAME:"Rename",CMD_FILE_DELETE:"Delete",CMD_INSTALL_EXTENSION:"Install Extension…",CMD_EXTENSION_MANAGER:"Extension Manager…",CMD_FILE_REFRESH:"Refresh File Tree",CMD_QUIT:"Quit",CMD_EXIT:"Exit",EDIT_MENU:"Edit",CMD_UNDO:"Undo",CMD_REDO:"Redo",CMD_CUT:"Cut",CMD_COPY:"Copy",CMD_PASTE:"Paste",CMD_SELECT_ALL:"Select All",CMD_SELECT_LINE:"Select Line",CMD_SPLIT_SEL_INTO_LINES:"Split Selection into Lines",CMD_ADD_CUR_TO_NEXT_LINE:"Add Cursor to Next Line",CMD_ADD_CUR_TO_PREV_LINE:"Add Cursor to Previous Line",CMD_INDENT:"Indent",CMD_UNINDENT:"Unindent",CMD_DUPLICATE:"Duplicate",CMD_DELETE_LINES:"Delete Line",CMD_COMMENT:"Toggle Line Comment",CMD_BLOCK_COMMENT:"Toggle Block Comment",CMD_LINE_UP:"Move Line Up",CMD_LINE_DOWN:"Move Line Down",CMD_OPEN_LINE_ABOVE:"Open Line Above",CMD_OPEN_LINE_BELOW:"Open Line Below",CMD_TOGGLE_CLOSE_BRACKETS:"Auto Close Braces",CMD_SHOW_CODE_HINTS:"Show Code Hints",FIND_MENU:"Find",CMD_FIND:"Find",CMD_FIND_NEXT:"Find Next",CMD_FIND_PREVIOUS:"Find Previous",CMD_FIND_ALL_AND_SELECT:"Find All and Select",CMD_ADD_NEXT_MATCH:"Add Next Match to Selection",CMD_SKIP_CURRENT_MATCH:"Skip and Add Next Match",CMD_FIND_IN_FILES:"Find in Files",CMD_FIND_IN_SELECTED:"Find in Selected File/Folder",CMD_FIND_IN_SUBTREE:"Find in…",CMD_REPLACE:"Replace",CMD_REPLACE_IN_FILES:"Replace in Files",CMD_REPLACE_IN_SELECTED:"Replace in Selected File/Folder",CMD_REPLACE_IN_SUBTREE:"Replace in…",VIEW_MENU:"View",CMD_HIDE_SIDEBAR:"Hide Sidebar",CMD_SHOW_SIDEBAR:"Show Sidebar",CMD_INCREASE_FONT_SIZE:"Increase Font Size",CMD_DECREASE_FONT_SIZE:"Decrease Font Size",CMD_RESTORE_FONT_SIZE:"Restore Font Size",CMD_SCROLL_LINE_UP:"Scroll Line Up",CMD_SCROLL_LINE_DOWN:"Scroll Line Down",CMD_TOGGLE_LINE_NUMBERS:"Line Numbers",CMD_TOGGLE_ACTIVE_LINE:"Highlight Active Line",CMD_TOGGLE_WORD_WRAP:"Word Wrap",CMD_LIVE_HIGHLIGHT:"Live Preview Highlight",CMD_VIEW_TOGGLE_INSPECTION:"Lint Files on Save",CMD_WORKINGSET_SORT_BY_ADDED:"Sort by Added",CMD_WORKINGSET_SORT_BY_NAME:"Sort by Name",CMD_WORKINGSET_SORT_BY_TYPE:"Sort by Type",CMD_WORKING_SORT_TOGGLE_AUTO:"Automatic Sort",CMD_THEMES:"Themes…",NAVIGATE_MENU:"Navigate",CMD_QUICK_OPEN:"Quick Open",CMD_GOTO_LINE:"Go to Line",CMD_GOTO_DEFINITION:"Quick Find Definition",CMD_GOTO_FIRST_PROBLEM:"Go to First Error/Warning",CMD_TOGGLE_QUICK_EDIT:"Quick Edit",CMD_TOGGLE_QUICK_DOCS:"Quick Docs",CMD_QUICK_EDIT_PREV_MATCH:"Previous Match",CMD_QUICK_EDIT_NEXT_MATCH:"Next Match",CMD_CSS_QUICK_EDIT_NEW_RULE:"New Rule",CMD_NEXT_DOC:"Next Document",CMD_PREV_DOC:"Previous Document",CMD_SHOW_IN_TREE:"Show in File Tree",CMD_SHOW_IN_EXPLORER:"Show in Explorer",CMD_SHOW_IN_FINDER:"Show in Finder",CMD_SHOW_IN_OS:"Show in OS",HELP_MENU:"Help",CMD_CHECK_FOR_UPDATE:"Check for Updates",CMD_HOW_TO_USE_BRACKETS:"How to Use {APP_NAME}",CMD_SUPPORT:"{APP_NAME} Support",CMD_SUGGEST:"Suggest a Feature",CMD_RELEASE_NOTES:"Release Notes",CMD_GET_INVOLVED:"Get Involved",CMD_SHOW_EXTENSIONS_FOLDER:"Show Extensions Folder",CMD_HOMEPAGE:"{APP_TITLE} Homepage",CMD_TWITTER:"{TWITTER_NAME} on Twitter",CMD_ABOUT:"About {APP_TITLE}",CMD_OPEN_PREFERENCES:"Open Preferences File",EXPERIMENTAL_BUILD:"experimental build",DEVELOPMENT_BUILD:"development build",RELOAD_FROM_DISK:"Reload from Disk",KEEP_CHANGES_IN_EDITOR:"Keep Changes in Editor",CLOSE_DONT_SAVE:"Close (Don't Save)",RELAUNCH_CHROME:"Relaunch Chrome",ABOUT:"About",CLOSE:"Close",ABOUT_TEXT_LINE1:"Release {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}",ABOUT_TEXT_BUILD_TIMESTAMP:"build timestamp: ",ABOUT_TEXT_LINE3:"Notices, terms and conditions pertaining to third party software are located at <a href='{ADOBE_THIRD_PARTY}'>{ADOBE_THIRD_PARTY}</a> and incorporated by reference herein.",ABOUT_TEXT_LINE4:"Documentation and source at <a href='https://github.com/adobe/brackets/'>https://github.com/adobe/brackets/</a>",ABOUT_TEXT_LINE5:"Made with ❤ and JavaScript by:",ABOUT_TEXT_LINE6:"Lots of people (but we're having trouble loading that data right now).",ABOUT_TEXT_WEB_PLATFORM_DOCS:"Web Platform Docs and the Web Platform graphical logo are licensed under a Creative Commons Attribution license, <a href='{WEB_PLATFORM_DOCS_LICENSE}'>CC-BY 3.0 Unported</a>.",UPDATE_NOTIFICATION_TOOLTIP:"There's a new build of {APP_NAME} available! Click here for details.",UPDATE_AVAILABLE_TITLE:"Update Available",UPDATE_MESSAGE:"Hey, there's a new build of {APP_NAME} available. Here are some of the new features:",GET_IT_NOW:"Get it now!",PROJECT_SETTINGS_TITLE:"Project Settings for: {0}",PROJECT_SETTING_BASE_URL:"Live Preview Base URL",PROJECT_SETTING_BASE_URL_HINT:"To use a local server, enter a url like http://localhost:8000/",BASEURL_ERROR_INVALID_PROTOCOL:"The {0} protocol isn't supported by Live Preview&mdash;please use http: or https: .",BASEURL_ERROR_SEARCH_DISALLOWED:'The base URL can\'t contain search parameters like "{0}".',BASEURL_ERROR_HASH_DISALLOWED:'The base URL can\'t contain hashes like "{0}".',BASEURL_ERROR_INVALID_CHAR:"Special characters like '{0}' must be %-encoded.",BASEURL_ERROR_UNKNOWN_ERROR:"Unknown error parsing Base URL",EMPTY_VIEW_HEADER:"<em>Open a file while this pane has focus</em>",CURRENT_THEME:"Current Theme",USE_THEME_SCROLLBARS:"Use Theme Scrollbars",FONT_SIZE:"Font Size",FONT_FAMILY:"Font Family",THEMES_SETTINGS:"Themes Settings",BUTTON_NEW_RULE:"New Rule",INSTALL:"Install",UPDATE:"Update",REMOVE:"Remove",OVERWRITE:"Overwrite",CANT_REMOVE_DEV:'Extensions in the "dev" folder must be manually deleted.',CANT_UPDATE:"The update isn't compatible with this version of {APP_NAME}.",CANT_UPDATE_DEV:'Extensions in the "dev" folder can\'t be updated automatically.',INSTALL_EXTENSION_TITLE:"Install Extension",UPDATE_EXTENSION_TITLE:"Update Extension",INSTALL_EXTENSION_LABEL:"Extension URL",INSTALL_EXTENSION_HINT:"URL of the extension's zip file or GitHub repo",INSTALLING_FROM:"Installing extension from {0}…",INSTALL_SUCCEEDED:"Installation successful!",INSTALL_FAILED:"Installation failed.",CANCELING_INSTALL:"Canceling…",CANCELING_HUNG:"Canceling the install is taking a long time. An internal error may have occurred.",INSTALL_CANCELED:"Installation canceled.",VIEW_COMPLETE_DESCRIPTION:"View complete description",VIEW_TRUNCATED_DESCRIPTION:"View truncated description",INVALID_ZIP_FILE:"The downloaded content is not a valid zip file.",INVALID_PACKAGE_JSON:"The package.json file is not valid (error was: {0}).",MISSING_PACKAGE_NAME:"The package.json file doesn't specify a package name.",BAD_PACKAGE_NAME:"{0} is an invalid package name.",MISSING_PACKAGE_VERSION:"The package.json file doesn't specify a package version.",INVALID_VERSION_NUMBER:"The package version number ({0}) is invalid.",INVALID_BRACKETS_VERSION:"The {APP_NAME} compatibility string ({0}) is invalid.",DISALLOWED_WORDS:"The words ({1}) are not allowed in the {0} field.",API_NOT_COMPATIBLE:"The extension isn't compatible with this version of {APP_NAME}. It's installed in your disabled extensions folder.",MISSING_MAIN:"The package has no main.js file.",EXTENSION_ALREADY_INSTALLED:"Installing this package will overwrite a previously installed extension. Overwrite the old extension?",EXTENSION_SAME_VERSION:"This package is the same version as the one that is currently installed. Overwrite the existing installation?",EXTENSION_OLDER_VERSION:"This package is version {0} which is older than the currently installed ({1}). Overwrite the existing installation?",DOWNLOAD_ID_IN_USE:"Internal error: download ID already in use.",NO_SERVER_RESPONSE:"Cannot connect to server.",BAD_HTTP_STATUS:"File not found on server (HTTP {0}).",CANNOT_WRITE_TEMP:"Unable to save download to temp file.",ERROR_LOADING:"The extension encountered an error while starting up.",MALFORMED_URL:"The URL is invalid. Please check that you entered it correctly.",UNSUPPORTED_PROTOCOL:"The URL must be an http or https URL.",UNKNOWN_ERROR:"Unknown internal error.",EXTENSION_MANAGER_TITLE:"Extension Manager",EXTENSION_MANAGER_ERROR_LOAD:"Unable to access the extension registry. Please try again later.",INSTALL_EXTENSION_DRAG:"Drag .zip here or",INSTALL_EXTENSION_DROP:"Drop .zip to install",INSTALL_EXTENSION_DROP_ERROR:"Install/Update aborted due to the following errors:",INSTALL_FROM_URL:"Install from URL…",INSTALL_EXTENSION_VALIDATING:"Validating…",EXTENSION_AUTHOR:"Author",EXTENSION_DATE:"Date",EXTENSION_INCOMPATIBLE_NEWER:"This extension requires a newer version of {APP_NAME}.",EXTENSION_INCOMPATIBLE_OLDER:"This extension currently only works with older versions of {APP_NAME}.",EXTENSION_LATEST_INCOMPATIBLE_NEWER:"Version {0} of this extension requires a newer version of {APP_NAME}. But you can install the earlier version {1}.",EXTENSION_LATEST_INCOMPATIBLE_OLDER:"Version {0} of this extension only works with older versions of {APP_NAME}. But you can install the earlier version {1}.",EXTENSION_NO_DESCRIPTION:"No description",EXTENSION_MORE_INFO:"More info...",EXTENSION_ERROR:"Extension error",EXTENSION_KEYWORDS:"Keywords",EXTENSION_TRANSLATED_USER_LANG:"Translated into {0} languages, including yours",EXTENSION_TRANSLATED_GENERAL:"Translated into {0} languages",EXTENSION_TRANSLATED_LANGS:"This extension has been translated into these languages: {0}",EXTENSION_INSTALLED:"Installed",EXTENSION_UPDATE_INSTALLED:"This extension update has been downloaded and will be installed after {APP_NAME} reloads.",EXTENSION_SEARCH_PLACEHOLDER:"Search",EXTENSION_MORE_INFO_LINK:"More",BROWSE_EXTENSIONS:"Browse Extensions",EXTENSION_MANAGER_REMOVE:"Remove Extension",EXTENSION_MANAGER_REMOVE_ERROR:"Unable to remove one or more extensions: {0}. {APP_NAME} will still reload.",EXTENSION_MANAGER_UPDATE:"Update Extension",EXTENSION_MANAGER_UPDATE_ERROR:"Unable to update one or more extensions: {0}. {APP_NAME} will still reload.",MARKED_FOR_REMOVAL:"Marked for removal",UNDO_REMOVE:"Undo",MARKED_FOR_UPDATE:"Marked for update",UNDO_UPDATE:"Undo",CHANGE_AND_RELOAD_TITLE:"Change Extensions",CHANGE_AND_RELOAD_MESSAGE:"To update or remove the marked extensions, {APP_NAME} will need to reload. You'll be prompted to save unsaved changes.",REMOVE_AND_RELOAD:"Remove Extensions and Reload",CHANGE_AND_RELOAD:"Change Extensions and Reload",UPDATE_AND_RELOAD:"Update Extensions and Reload",PROCESSING_EXTENSIONS:"Processing extension changes…",EXTENSION_NOT_INSTALLED:"Couldn't remove extension {0} because it wasn't installed.",NO_EXTENSIONS:"No extensions installed yet.<br>Click on the Available tab above to get started.",NO_EXTENSION_MATCHES:"No extensions match your search.",REGISTRY_SANITY_CHECK_WARNING:"NOTE: These extensions may come from different authors than {APP_NAME} itself. Extensions are not reviewed and have full local privileges. Be cautious when installing extensions from an unknown source.",EXTENSIONS_INSTALLED_TITLE:"Installed",EXTENSIONS_AVAILABLE_TITLE:"Available",EXTENSIONS_THEMES_TITLE:"Themes",EXTENSIONS_UPDATES_TITLE:"Updates",INLINE_EDITOR_NO_MATCHES:"No matches available.",CSS_QUICK_EDIT_NO_MATCHES:'There are no existing CSS rules that match your selection.<br> Click "New Rule" to create one.',CSS_QUICK_EDIT_NO_STYLESHEETS:"There are no stylesheets in your project.<br>Create one to add CSS rules.",IMAGE_VIEWER_LARGEST_ICON:"largest",UNIT_PIXELS:"pixels",DEBUG_MENU:"Debug",ERRORS:"Errors",CMD_SHOW_DEV_TOOLS:"Show Developer Tools",CMD_REFRESH_WINDOW:"Reload With Extensions",CMD_RELOAD_WITHOUT_USER_EXTS:"Reload Without Extensions",CMD_NEW_BRACKETS_WINDOW:"New {APP_NAME} Window",CMD_SWITCH_LANGUAGE:"Switch Language",CMD_RUN_UNIT_TESTS:"Run Tests",CMD_SHOW_PERF_DATA:"Show Performance Data",CMD_ENABLE_NODE_DEBUGGER:"Enable Node Debugger",CMD_LOG_NODE_STATE:"Log Node State to Console",CMD_RESTART_NODE:"Restart Node",CMD_SHOW_ERRORS_IN_STATUS_BAR:"Show Errors in Status Bar",CMD_OPEN_BRACKETS_SOURCE:"Open Brackets Source",LANGUAGE_TITLE:"Switch Language",LANGUAGE_MESSAGE:"Language:",LANGUAGE_SUBMIT:"Reload {APP_NAME}",LANGUAGE_CANCEL:"Cancel",LANGUAGE_SYSTEM_DEFAULT:"System Default",INLINE_TIMING_EDITOR_TIME:"Time",INLINE_TIMING_EDITOR_PROGRESSION:"Progression",BEZIER_EDITOR_INFO:"<kbd>↑</kbd><kbd>↓</kbd><kbd>←</kbd><kbd>→</kbd> Move selected point<br><kbd class='text'>Shift</kbd> Move by ten units<br><kbd class='text'>Tab</kbd> Switch points",STEPS_EDITOR_INFO:"<kbd>↑</kbd><kbd>↓</kbd> Increase or decrease steps<br><kbd>←</kbd><kbd>→</kbd> 'Start' or 'End'",INLINE_TIMING_EDITOR_INVALID:"The old value <code>{0}</code> is not valid, so the displayed function was changed to <code>{1}</code>. The document will be updated with the first edit.",COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP:"Current Color",COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP:"Original Color",COLOR_EDITOR_RGBA_BUTTON_TIP:"RGBa Format",COLOR_EDITOR_HEX_BUTTON_TIP:"Hex Format",COLOR_EDITOR_HSLA_BUTTON_TIP:"HSLa Format",COLOR_EDITOR_USED_COLOR_TIP_SINGULAR:"{0} (Used {1} time)",COLOR_EDITOR_USED_COLOR_TIP_PLURAL:"{0} (Used {1} times)",CMD_JUMPTO_DEFINITION:"Jump to Definition",CMD_SHOW_PARAMETER_HINT:"Show Parameter Hint",NO_ARGUMENTS:"<no parameters>",DETECTED_EXCLUSION_TITLE:"JavaScript File Inference Problem",DETECTED_EXCLUSION_INFO:"Brackets ran into trouble processing <span class='dialog-filename'>{0}</span>.<br><br>This file will no longer be processed for code hints, Jump to Definition or Quick Edit. To reenable this file, open <code>.brackets.json</code> in your project and edit <code>jscodehints.detectedExclusions</code>.<br><br>This is likely a Brackets bug. If you can provide a copy of this file, please <a href='https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue'>file a bug</a> with a link to the file named here.",JSLINT_NAME:"JSLint",CMD_ENABLE_QUICK_VIEW:"Quick View on Hover",CMD_TOGGLE_RECENT_PROJECTS:"Recent Projects",DOCS_MORE_LINK:"Read more"}),define("nls/urls",["require","exports","module"],function(e,t,n){n.exports={root:!0,cs:!0,da:!0,de:!0,es:!0,"fa-ir":!0,fi:!0,fr:!0,hr:!0,id:!0,it:!0,ja:!0,ko:!0,nb:!0,pl:!0,"pt-br":!0,"pt-pt":!0,ru:!0,sv:!0,"zh-cn":!0,tr:!0}
12}),define("nls/root/urls",{GETTING_STARTED:"root/Getting Started",ADOBE_THIRD_PARTY:"http://www.adobe.com/go/thirdparty/",WEB_PLATFORM_DOCS_LICENSE:"http://creativecommons.org/licenses/by/3.0/"}),define("nls/strings-app",["require","exports","module"],function(e,t,n){n.exports={root:!0}}),define("nls/root/strings-app",{APP_NAME:"Brackets",LOCALE_CS:"čeština",LOCALE_DA:"Dansk",LOCALE_DE:"Deutsch",LOCALE_EL:"Ελληνικά",LOCALE_EN:"English (US)",LOCALE_EN_GB:"English (UK)",LOCALE_ES:"español",LOCALE_FA_IR:"فارسی",LOCALE_FI:"suomi",LOCALE_FR:"français",LOCALE_GL:"galego",LOCALE_HR:"hrvatski",LOCALE_HU:"magyar",LOCALE_ID:"Bahasa Indonesia",LOCALE_IT:"italiano",LOCALE_JA:"日本語",LOCALE_KO:"한국어",LOCALE_NB:"norsk",LOCALE_NL:"Nederlands",LOCALE_PL:"polski",LOCALE_PT_BR:"português (BR)",LOCALE_PT_PT:"português (PT)",LOCALE_RO:"română",LOCALE_RU:"русский",LOCALE_SK:"slovenčina",LOCALE_SR:"Српски",LOCALE_SV:"svenska",LOCALE_TR:"Türkçe",LOCALE_UK:"Українська",LOCALE_ZH_CN:"简体中文",LOCALE_ZH_TW:"繁體中文"}),define("utils/StringUtils",["require","exports","module","thirdparty/lodash"],function(e,t){function n(e){var t=[].slice.call(arguments,1);return e.replace(/\{(\d+)\}/g,function(e,n){return"undefined"!=typeof t[n]?t[n]:e})}function r(e){return console.warn("StringUtils.htmlEscape is deprecated. Use _.escape instead."),f.escape(e)}function i(e){return e.replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")}function o(e){return e.replace(/\./g,"\\.")}function a(e){return e.split("\n")}function s(e,t){if(Array.isArray(e)){var n,r=e,i=0;for(n=0;n<r.length;n++){if(!(t>i))return i===t?n:n-1;i+=r[n].length+1}return i>=t?n-1:void 0}return e.substr(0,t).split("\n").length-1}function l(e,t){return-1!==e.indexOf(t,e.length-t.length)}function c(e,t){function n(e){return e.lastIndexOf("/")+1<e.length}var r,i;return"win"===brackets.platform?(r=(n(e)?"1":"0")+e.toLowerCase(),i=(n(t)?"1":"0")+t.toLowerCase()):(r=e.toLowerCase(),i=t.toLowerCase()),r===i?0:r>i?1:-1}function u(e){var t=f.escape(e);return t.replace(new RegExp(i("/"),"g"),"/&#8203;")}function d(e,t){var n=1024,r=1024*n,i=1024*r,o=1024*i,a=e;if(e>=0&&n>e)a=e+" B";else if(r>e)a=(e/n).toFixed(t)+" KB";else if(i>e)a=(e/r).toFixed(t)+" MB";else if(o>e)a=(e/i).toFixed(t)+" GB";else if(e>=o)return(e/o).toFixed(t)+" TB";return a}function p(e,t){if(e.length>t){e=e.substr(0,t);var n=e.lastIndexOf(" ");return t>n&&n>-1&&(e=e.substr(0,n)),e}}var f=e("thirdparty/lodash");t.format=n,t.htmlEscape=r,t.regexEscape=i,t.jQueryIdEscape=o,t.getLines=a,t.offsetToLineNum=s,t.urlSort=c,t.breakableUrl=u,t.endsWith=l,t.prettyPrintBytes=d,t.truncate=p}),define("strings",["require","exports","module","thirdparty/lodash","i18n!nls/strings","i18n!nls/urls","i18n!nls/strings-app","utils/StringUtils","utils/Global"],function(e,t,n){var r=e("thirdparty/lodash"),i=e("i18n!nls/strings"),o=e("i18n!nls/urls"),a=e("i18n!nls/strings-app"),s=e("utils/StringUtils");e("utils/Global");var l=$.extend({},o),c=/([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(brackets.metadata.version);l.APP_NAME=brackets.metadata.name||i.APP_NAME,l.APP_TITLE=brackets.config.app_title||i.APP_NAME,l.TWITTER_NAME=brackets.config.twitter_name,l.VERSION=brackets.metadata.version,l.VERSION_MAJOR=c[1],l.VERSION_MINOR=c[2],l.VERSION_PATCH=c[3];var u=!s.endsWith(decodeURI(window.location.pathname),"/www/index.html");l.BUILD_TYPE=u?i.DEVELOPMENT_BUILD:i.EXPERIMENTAL_BUILD,r.forEach(i,function(e,t){r.forEach(l,function(e,n){i[t]=i[t].replace(new RegExp("{"+n+"}","g"),l[n])})}),r.forEach(a,function(e,t){r.forEach(l,function(e,n){a[t]=a[t].replace(new RegExp("{"+n+"}","g"),l[n])}),i[t]=a[t]}),n.exports=i}),define("text!base-config/keyboard.json",[],function(){return'{\n "file.newDoc": [\n "Ctrl-N"\n ],\n "file.open": [\n "Ctrl-O"\n ],\n "file.close": [\n "Ctrl-W"\n ],\n "file.openFolder": [\n "Ctrl-Alt-O"\n ],\n "file.close_all": [\n "Ctrl-Shift-W"\n ],\n "file.save": [\n "Ctrl-S"\n ],\n "file.saveAll": [\n "Ctrl-Alt-S"\n ],\n "file.saveAs": [\n "Ctrl-Shift-S"\n ], \n "file.liveFilePreview": [\n "Ctrl-Alt-P"\n ],\n "file.reloadLivePreview": [\n {\n "key": "Ctrl-Shift-R"\n }\n ],\n "file.previewHighlight": [\n "Ctrl-Shift-C"\n ],\n "file.quit": [\n "Ctrl-Q"\n ],\n "edit.undo": [\n "Ctrl-Z"\n ],\n "edit.redo": [\n {\n "key": "Ctrl-Y"\n },\n {\n "key": "Cmd-Shift-Z",\n "platform": "mac"\n }\n ],\n "edit.cut": [\n "Ctrl-X"\n ],\n "edit.copy": [\n "Ctrl-C"\n ],\n "edit.paste": [\n "Ctrl-V"\n ],\n "edit.selectAll": [\n "Ctrl-A"\n ],\n "edit.selectLine": [\n {\n "key": "Ctrl-L"\n },\n {\n "key": "Ctrl-L",\n "platform": "mac"\n }\n ],\n "edit.splitSelIntoLines": [\n "Ctrl-Alt-L"\n ],\n "edit.addCursorToPrevLine": [\n {\n "key": "Shift-Alt-Up",\n "displayKey": "Shift-Alt-↑"\n }\n ],\n "edit.addCursorToNextLine": [\n {\n "key": "Shift-Alt-Down",\n "displayKey": "Shift-Alt-↓"\n }\n ],\n "edit.indent": [\n {\n "key": "Ctrl-]"\n }\n ],\n "edit.unindent": [\n {\n "key": "Ctrl-["\n }\n ],\n "edit.duplicate": [\n "Ctrl-D"\n ],\n "edit.deletelines": [\n "Ctrl-Shift-D"\n ],\n "edit.lineUp": [\n {\n "key": "Ctrl-Shift-Up",\n "displayKey": "Ctrl-Shift-↑"\n },\n {\n "key": "Cmd-Ctrl-Up",\n "displayKey": "Cmd-Ctrl-↑",\n "platform": "mac"\n }\n ],\n "edit.lineDown": [\n {\n "key": "Ctrl-Shift-Down",\n "displayKey": "Ctrl-Shift-↓"\n },\n {\n "key": "Cmd-Ctrl-Down",\n "displayKey": "Cmd-Ctrl-↓",\n "platform": "mac"\n }\n ],\n "edit.openLineAbove": [\n "Ctrl-Shift-Enter"\n ],\n "edit.openLineBelow": [\n "Ctrl-Enter"\n ],\n "edit.lineComment": [\n "Ctrl-/"\n ],\n "edit.blockComment": [\n {\n "key": "Ctrl-Shift-/"\n },\n {\n "key": "Cmd-Opt-/",\n "platform": "mac"\n }\n ],\n "edit.showCodeHints": [\n {\n "key": "Ctrl-Space"\n },\n {\n "key": "Ctrl-Space",\n "platform": "mac"\n }\n ],\n "cmd.find": [\n "Ctrl-F"\n ],\n "cmd.findInFiles": [\n "Ctrl-Shift-F"\n ],\n "cmd.replaceInFiles": [\n {\n "key": "Ctrl-Shift-H"\n },\n {\n "key": "Cmd-Alt-Shift-F",\n "platform": "mac"\n }\n ],\n "cmd.findNext": [\n {\n "key": "F3"\n },\n {\n "key": "Cmd-G",\n "platform": "mac"\n }\n ],\n "cmd.findPrevious": [\n {\n "key": "Shift-F3"\n },\n {\n "key": "Cmd-Shift-G",\n "platform": "mac"\n }\n ],\n "cmd.findAllAndSelect": [\n {\n "key": "Alt-F3"\n },\n {\n "key": "Cmd-Ctrl-G",\n "platform": "mac"\n }\n ],\n "cmd.addNextMatch": [\n {\n "key": "Ctrl-B"\n }\n ],\n "cmd.skipCurrentMatch": [\n {\n "key": "Ctrl-Shift-B"\n }\n ],\n "cmd.replace": [\n {\n "key": "Ctrl-H"\n },\n {\n "key": "Cmd-Alt-F",\n "platform": "mac"\n }\n ],\n "view.hideSidebar": [\n { \n "key" : "Ctrl-Alt-H"\n },\n {\n "key": "Cmd-Shift-H",\n "platform": "mac"\n }\n ],\n "view.increaseFontSize": [\n {\n "key": "Ctrl-=",\n "displayKey": "Cmd-+"\n },\n {\n "key": "Ctrl-+",\n "displayKey": "Cmd-+"\n }\n ],\n "view.decreaseFontSize": [\n {\n "key": "Ctrl--",\n "displayKey": "Cmd-−"\n }\n ],\n "view.restoreFontSize": [\n "Ctrl-0"\n ],\n "view.scrollLineUp": [\n {\n "key": "Ctrl-Up",\n "displayKey": "Ctrl-\\u2191"\n },\n {\n "key": "Ctrl-Alt-Up",\n "displayKey": "Ctrl-Alt-\\u2191",\n "platform": "mac"\n }\n ],\n "view.scrollLineDown": [\n {\n "key": "Ctrl-Down",\n "displayKey": "Ctrl-\\u2193"\n },\n {\n "key": "Ctrl-Alt-Down",\n "displayKey": "Ctrl-Alt-\\u2193",\n "platform": "mac"\n }\n ],\n "navigate.quickOpen": [\n "Ctrl-Shift-O"\n ],\n "navigate.gotoLine": [\n {\n "key": "Ctrl-G"\n },\n {\n "key": "Cmd-L",\n "platform": "mac"\n }\n ],\n "navigate.gotoDefinition": [\n "Ctrl-T"\n ],\n "navigate.jumptoDefinition": [\n "Ctrl-J"\n ],\n "navigate.gotoFirstProblem": [\n {\n "key": "F8"\n },\n {\n "key": "Cmd-\'",\n "platform": "mac"\n }\n ],\n "navigate.nextDoc": [\n {\n "key": "Ctrl-Tab"\n },\n {\n "key": "Ctrl-Tab",\n "platform": "mac"\n },\n {\n "key": "Cmd-Shift-]",\n "platform": "mac"\n }\n ],\n "navigate.prevDoc": [\n {\n "key": "Ctrl-Shift-Tab"\n },\n {\n "key": "Ctrl-Shift-Tab",\n "platform": "mac"\n },\n {\n "key": "Cmd-Shift-[",\n "platform": "mac"\n }\n ],\n "navigate.toggleQuickEdit": [\n "Ctrl-E"\n ],\n "navigate.toggleQuickDocs": [\n "Ctrl-K"\n ],\n "navigate.previousMatch": [\n {\n "key": "Alt-Up",\n "displayKey": "Alt-↑"\n }\n ],\n "navigate.nextMatch": [\n {\n "key": "Alt-Down",\n "displayKey": "Alt-↓"\n }\n ],\n "navigate.newRule": [\n "Cmd-Alt-N"\n ],\n "file.rename": [\n "F2"\n ],\n "help.support": [\n "F1"\n ]\n}\n'}),define("command/KeyBindingManager",["require","exports","module","utils/Global","utils/AppInit","command/CommandManager","utils/KeyEvent","strings","text!base-config/keyboard.json"],function(e,t){function n(){k={},x={},D=[]}function r(e,t,n,r,i){if(!i)return console.log("KeyBindingManager _buildKeyDescriptor() - No key provided!"),"";var o=[];return e&&o.push("Ctrl"),n&&o.push("Alt"),r&&o.push("Shift"),t&&("mac"===brackets.platform?o.push("Cmd"):o.unshift("Ctrl")),o.push(i),o.join("-")}function i(e){function t(e,t){return e&&t?(e=e.trim().toLowerCase(),t=t.trim().toLowerCase(),e.length>0&&e===t):!1}var n=!1,i=!1,o=!1,a=!1,s="",l=!1;return e.split("-").forEach(function(r){t("ctrl",r)?"mac"===brackets.platform?n=!0:i=!0:t("cmd",r)?i=!0:t("alt",r)?o=!0:t("opt",r)?o=!0:t("shift",r)?a=!0:s.length>0?(console.log("KeyBindingManager normalizeKeyDescriptorString() - Multiple keys defined. Using key: "+s+" from: "+e),l=!0):s=r}),l?null:(""===s&&-1!==e.search(/^.+--$/)&&(s="-"),s.indexOf("+")>=0&&s.length>1?null:r(n,i,o,a,s))}function o(e,t){if(e>=S.DOM_VK_0&&e<=S.DOM_VK_9)return String(e-S.DOM_VK_0);if(e>=S.DOM_VK_NUMPAD0&&e<=S.DOM_VK_NUMPAD9)return String(e-S.DOM_VK_NUMPAD0);switch(e){case S.DOM_VK_SEMICOLON:return";";case S.DOM_VK_EQUALS:return"=";case S.DOM_VK_COMMA:return",";case S.DOM_VK_SUBTRACT:case S.DOM_VK_DASH:return"-";case S.DOM_VK_ADD:return"+";case S.DOM_VK_DECIMAL:case S.DOM_VK_PERIOD:return".";case S.DOM_VK_DIVIDE:case S.DOM_VK_SLASH:return"/";case S.DOM_VK_BACK_QUOTE:return"`";case S.DOM_VK_OPEN_BRACKET:return"[";case S.DOM_VK_BACK_SLASH:return"\\";case S.DOM_VK_CLOSE_BRACKET:return"]";case S.DOM_VK_QUOTE:return"'";default:return t}}function a(e){var t="mac"===brackets.platform?e.ctrlKey:!1,n="mac"!==brackets.platform?e.ctrlKey:e.metaKey,i=e.altKey,a=e.shiftKey,s=String.fromCharCode(e.keyCode),l=e.keyIdentifier;return l&&(s="U"===l.charAt(0)&&"+"===l.charAt(1)?String.fromCharCode(parseInt(l.substring(2),16)):l),s=" "===s?"Tab":" "===s?"Space":o(e.keyCode,s),r(t,n,i,a,s)}function s(e){var t;return"mac"===brackets.platform?(t=e.replace(/-(?!$)/g,""),t=t.replace("Ctrl","⌃"),t=t.replace("Cmd","⌘"),t=t.replace("Shift","⇧"),t=t.replace("Alt","⌥")):(t=e.replace("Ctrl",C.KEYBOARD_CTRL),t=t.replace("Shift",C.KEYBOARD_SHIFT),t=t.replace("Space",C.KEYBOARD_SPACE),t=t.replace(/-(?!$)/g,"+")),t}function l(e){return void 0!==k[e]}function c(e,t){if(e&&(null===t||void 0===t||t===brackets.platform)){var n=i(e);if(n){if(l(n)){var r=k[n],o=w.get(r.commandID),a=x[r.commandID];delete k[n],a&&(x[r.commandID]=a.filter(function(e){return e.key!==n}),o&&$(o).triggerHandler("keyBindingRemoved",[{key:n,displayKey:r.displayKey}]))}}else console.log("Fail to nomalize "+e)}}function u(e,n,r){var o,a,s,l,u,d,p=null,f=n.platform||r,h=[];if(l=f&&"all"!==f?f:brackets.platform,o=n.key||n,"mac"!==brackets.platform||void 0!==f&&"all"!==f||(o=o.replace("Ctrl","Cmd"),void 0!==n.displayKey&&(n.displayKey=n.displayKey.replace("Ctrl","Cmd"))),a=i(o),!a)return console.error("Unable to parse key binding "+o+". Permitted modifiers: Ctrl, Cmd, Alt, Opt, Shift; separated by '-' (not '+')."),null;if(d=k[a],t.useWindowsCompatibleBindings&&"win"===f){if(d&&(!d.explicitPlatform||d.explicitPlatform===brackets.platform||"all"===d.explicitPlatform))return null;l=brackets.platform}if(l!==brackets.platform)return null;d&&!d.explicitPlatform&&f&&(c(a),d=!1);var m,g,v,y=x[e]||[];return y.forEach(function(e){m=t.useWindowsCompatibleBindings&&"win"===e.explicitPlatform,g=!e.explicitPlatform&&f,m||g?h.push(e):v=e.explicitPlatform&&!f}),v?null:d?(console.error("Cannot assign "+a+" to "+e+". It is already assigned to "+k[a].commandID),null):(h.forEach(function(e){c(e.key)}),s=n.displayKey?i(n.displayKey):a,x[e]||(x[e]=[]),p={key:a,displayKey:s,explicitPlatform:f},x[e].push(p),k[a]={commandID:e,key:a,displayKey:s,explicitPlatform:f},u=w.get(e),u&&$(u).triggerHandler("keyBindingAdded",[p]),p)}function d(){return $.extend({},k)}function p(e){if(T&&k[e]){var t=w.execute(k[e].commandID);return"rejected"!==t.state()}return!1}function f(e){T=e}function h(e,t){var n=e.platform?1:0,r=t.platform?1:0;return r-n}function m(e,t,n){var r,i="";if(!e)return void console.error("addBinding(): missing required parameter: command");if(t){if(i="string"==typeof e?e:e.getID(),Array.isArray(t)){var o;r=[],t.sort(h),t.forEach(function(e){o=u(i,e,e.platform),o&&r.push(o)})}else r=u(i,t,n);return r}}function g(e){var t=[],n="";return e?(n="string"==typeof e?e:e.getID(),t=x[n],t||[]):(console.error("getKeyBindings(): missing required parameter: command"),[])}function v(e,t){var n=t.getID(),r=I[n];r&&m(n,r)}function y(e){D.push(e)}function _(e){var t=D.indexOf(e);-1!==t&&D.splice(t,1)}function b(e){var t,n=!1;for(t=D.length-1;t>=0;t--)if(D[t](e)){n=!0;break}!n&&p(a(e))&&(e.stopPropagation(),e.preventDefault())}e("utils/Global");var E=e("utils/AppInit"),w=e("command/CommandManager"),S=e("utils/KeyEvent"),C=e("strings"),I=JSON.parse(e("text!base-config/keyboard.json")),k={},x={},T=!0,D=[];E.htmlReady(function(){window.document.body.addEventListener("keydown",b,!0),t.useWindowsCompatibleBindings="mac"!==brackets.platform&&"win"!==brackets.platform}),$(w).on("commandRegistered",v),t._reset=n,t.getKeymap=d,t.setEnabled=f,t.addBinding=m,t.removeBinding=c,t.formatKeyDescriptor=s,t.getKeyBindings=g,t.addGlobalKeydownHook=y,t.removeGlobalKeydownHook=_,t.useWindowsCompatibleBindings=!1,t._handleKey=p,t._handleKeyEvent=b}),define("text!htmlContent/dialog-template.html",[],function(){return'<div class="{{dlgClass}} template modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{{title}}}</h1>\n </div>\n <div class="modal-body">\n <div class="dialog-message">{{{message}}}</div>\n </div>\n <div class="modal-footer">\n {{#buttons}}\n <button class="dialog-button btn {{className}}" data-button-id="{{id}}">{{{text}}}</button>\n {{/buttons}}\n </div>\n</div>\n'}),define("widgets/Dialogs",["require","exports","module","utils/Global","command/KeyBindingManager","utils/KeyEvent","strings","text!htmlContent/dialog-template.html"],function(e,t){function n(e,t){e.data("buttonId",t),e.modal("hide")}function r(e,t,r){r?n(e,t):e.triggerHandler("buttonClick",t)}function i(e,t){return e.find("[data-button-id='"+t+"']").length>0}function o(e,t){function n(){e.stopPropagation(),e.preventDefault()}var r=$(":input:enabled, a",t).filter(":visible");$(e.target).closest(t).length?!e.shiftKey&&e.target===r[r.length-1]||e.shiftKey&&e.target===r[0]?(r.filter(e.shiftKey?":last":":first").focus(),n()):r.length||n():(r.first().focus(),n())}function a(e,t){this._$dlg=e,this._promise=t}function s(){var e,t,n=$(".modal-inner-wrapper > .instance");n.length>0&&(e=$("body").width(),t=$("body").height(),n.css({"max-width":e,"max-height":t,overflow:"auto"}))}function l(e,t){void 0===t&&(t=!0),$("body").append("<div class='modal-wrapper'><div class='modal-inner-wrapper'></div></div>");var n=new $.Deferred,i=n.promise(),o=$(e).addClass("instance").appendTo(".modal-inner-wrapper:last");s(),o.data("promise",i);var l=function(e){return I.call(o,e,t)};return o.one("hidden",function(){var e=o.data("buttonId");e||(e=m),window.setTimeout(function(){n.resolve(e)},0),o.remove(),d.removeGlobalKeydownHook(l),$(".modal-wrapper:last").remove()}).one("shown",function(){var e=o.find(".primary:enabled"),t=o.find(".modal-footer .dialog-button:enabled:eq(0)");e.length?e.focus():t.length?t.focus():document.activeElement.blur(),d.addGlobalKeydownHook(l)}),o.one("click",".dialog-button",function(){r(o,$(this).attr("data-button-id"),t)}),o.modal({backdrop:"static",show:!0,selector:".modal-inner-wrapper:last",keyboard:!1}).css("z-index",C+1).next().css("z-index",C),C+=2,new a(o,i)}function c(e,t,n,r,i){var o={dlgClass:e,title:t||"",message:n||"",buttons:r||[{className:E,id:g,text:f.OK}]},a=Mustache.render(h,o);return l(a,i)}function u(e,t){$("."+e+".instance").each(function(){$(this).is(":visible")&&n($(this),t||_)})}e("utils/Global");var d=e("command/KeyBindingManager"),p=e("utils/KeyEvent"),f=e("strings"),h=e("text!htmlContent/dialog-template.html"),m="cancel",g="ok",v="dontsave",y="save_as",_="_canceled",b="download",E="primary",w="",S="left",C=1050,I=function(e,t){function n(){e.preventDefault(),e.stopPropagation()}var a=this.find(".primary"),s=null,l=String.fromCharCode(e.which),c=this.find(".dialog-button:focus, a:focus"),u="TEXTAREA"===e.target.tagName,d=u||$(e.target).filter(":text, :password").length>0;return e.which===p.DOM_VK_TAB?o(e,this):e.which===p.DOM_VK_ESCAPE?s=m:e.which!==p.DOM_VK_RETURN||u&&!e.ctrlKey?e.which===p.DOM_VK_SPACE?c.length&&(n(),c.click()):"mac"===brackets.platform?e.metaKey&&"D"===l?i(this,v)&&(s=v):e.metaKey&&e.which===p.DOM_VK_PERIOD&&(s=m):"N"!==l||d||i(this,v)&&(s=v):(n(),"BUTTON"===e.target.tagName?this.find(e.target).click():a.click()),s&&(n(),r(this,s,t)),!0};a.prototype.getElement=function(){return this._$dlg},a.prototype.getPromise=function(){return this._promise},a.prototype.close=function(){this._$dlg.is(":visible")&&n(this._$dlg,_)},a.prototype.done=function(e){this._promise.done(e)},window.addEventListener("resize",s),t.DIALOG_BTN_CANCEL=m,t.DIALOG_BTN_OK=g,t.DIALOG_BTN_DONTSAVE=v,t.DIALOG_BTN_SAVE_AS=y,t.DIALOG_CANCELED=_,t.DIALOG_BTN_DOWNLOAD=b,t.DIALOG_BTN_CLASS_PRIMARY=E,t.DIALOG_BTN_CLASS_NORMAL=w,t.DIALOG_BTN_CLASS_LEFT=S,t.showModalDialog=c,t.showModalDialogUsingTemplate=l,t.cancelModalDialogIfOpen=u}),define("widgets/DefaultDialogs",["require","exports","module"],function(e,t){t.DIALOG_ID_ERROR="error-dialog",t.DIALOG_ID_INFO="error-dialog",t.DIALOG_ID_SAVE_CLOSE="save-close-dialog",t.DIALOG_ID_EXT_CHANGED="ext-changed-dialog",t.DIALOG_ID_EXT_DELETED="ext-deleted-dialog",t.DIALOG_ID_LIVE_DEVELOPMENT="live-development-error-dialog",t.DIALOG_ID_CHANGE_EXTENSIONS="change-marked-extensions"}),define("file/FileUtils",["require","exports","module","utils/Global","filesystem/FileSystemError","language/LanguageManager","utils/PerfUtils","widgets/Dialogs","widgets/DefaultDialogs","strings","utils/StringUtils"],function(e,t){function n(e){var t=new $.Deferred,n=D.markStart("readAsText: "+e.fullPath);return t.always(function(){D.addMeasurement(n)}),e.read(function(e,n,r){e?t.reject(e):t.resolve(n,r.mtime)}),t.promise()}function r(e,t,n){var r=new $.Deferred,i={};return n&&(i.blind=!0),e.write(t,i,function(e){e?r.reject(e):r.resolve()}),r.promise()}function i(){return"win"===brackets.platform?A:N}function o(e){var t=e.substr(0,1e3),n=/\r\n/.test(t),r=/[^\r]\n/.test(t);return n&&r||!n&&!r?null:n?A:N}function a(e,t){t!==A&&t!==N&&(t=i());var n=t===A?"\r\n":"\n",r=/\r\n|\r|\n/g;return e.replace(r,n)}function s(e){var t;return t=e===x.NOT_FOUND?L.NOT_FOUND_ERR:e===x.NOT_READABLE?L.NOT_READABLE_ERR:e===x.NOT_WRITABLE?L.NO_MODIFICATION_ALLOWED_ERR_FILE:e===x.CONTENTS_MODIFIED?L.CONTENTS_MODIFIED_ERR:e===x.UNSUPPORTED_ENCODING?L.UNSUPPORTED_ENCODING_ERR:R.format(L.GENERIC_ERROR,e)}function l(e,t){return M.showModalDialog(O.DIALOG_ID_ERROR,L.ERROR_OPENING_FILE_TITLE,R.format(L.ERROR_OPENING_FILE,R.breakableUrl(t),s(e)))}function c(e){var t="<ul class='dialog-list'>";return e.forEach(function(e){t+="<li><span class='dialog-filename'>",t+=R.breakableUrl(e),t+="</span></li>"}),t+="</ul>"}function u(e){return e=unescape(e),-1!==e.indexOf(":")&&"/"===e[0]?e.substr(1):e}function d(e){return"win"===brackets.platform&&(e=e.replace(/\\/g,"/")),e}function p(e){return e&&"/"===e[e.length-1]?e.slice(0,-1):e}function f(e){return console.error("Warning: FileUtils.canonicalizeFolderPath() is deprecated. Use paths ending in '/' if possible, like Directory.fullPath"),p(e)}function h(e){var t=e.lastIndexOf("/");return t===e.length-1?e.slice(e.lastIndexOf("/",e.length-2)+1,-1):e.slice(t+1)}function m(){var e=decodeURI(window.location.pathname),t=e.substr(0,e.lastIndexOf("/"));return u(t)}function g(e){var t;return e&&e.uri&&(t=decodeURI(e.uri),t=t.substr(0,t.lastIndexOf("/"))),t}function v(e){var t=h(e),n=t.lastIndexOf(".");return-1===n?"":t.substr(n+1)}function y(e){var t=h(e),n=t.split(".");n.shift(),"."===t[0]&&n.shift();for(var r=[n.pop()],i=n.length;i--&&T.getLanguageForExtension(n[i]);)r.unshift(n[i]);return r.join(".")}function _(e,t){return t&&t.substr(0,e.length)===e?t.substr(e.length):void 0}function b(e){return e?-1!==P.indexOf(v(e).toLowerCase()):!1}function E(e){return e?-1!==F.indexOf(v(e).toLowerCase()):!1}function w(e){var t=T.getLanguageForPath(e).getId();return"less"===t||"scss"===t}function S(e){return e.substr(0,e.lastIndexOf("/")+1)}function C(e){var t=e.lastIndexOf(".");return-1===t?e:e.slice(0,t)}function I(e,t,n){var r,i=v(e),o=v(t),a=brackets.getLocale(),s=i.toLocaleLowerCase().localeCompare(o.toLocaleLowerCase(),a,{numeric:!0});return"win"===brackets.platform&&(e=C(e),t=C(t)),r=e.toLocaleLowerCase().localeCompare(t.toLocaleLowerCase(),a,{numeric:!0}),n?s||r:r||s}function k(e,t){for(var n,r,i=e.split("/"),o=t.split("/"),a=Math.min(i.length,o.length),s=i.length-1,l=o.length-1,c=0;a>c;){if(n=i[c],r=o[c],n!==r)return s>c&&l>c?n.toLocaleLowerCase().localeCompare(r.toLocaleLowerCase()):c>=s&&c>=l?I(n,r):c>=s&&l>c?1:-1;c++}return 0}e("utils/Global");var x=e("filesystem/FileSystemError"),T=e("language/LanguageManager"),D=e("utils/PerfUtils"),M=e("widgets/Dialogs"),O=e("widgets/DefaultDialogs"),L=e("strings"),R=e("utils/StringUtils"),A="CRLF",N="LF",P=["htm","html","xhtml"],F=["php","php3","php4","php5","phtm","phtml","cfm","cfml","asp","aspx","jsp","jspx","shtm","shtml"];t.LINE_ENDINGS_CRLF=A,t.LINE_ENDINGS_LF=N,t.getPlatformLineEndings=i,t.sniffLineEndings=o,t.translateLineEndings=a,t.showFileOpenError=l,t.getFileErrorString=s,t.makeDialogFileList=c,t.readAsText=n,t.writeText=r,t.convertToNativePath=u,t.convertWindowsPathToUnixPath=d,t.getNativeBracketsDirectoryPath=m,t.getNativeModuleDirectoryPath=g,t.canonicalizeFolderPath=f,t.stripTrailingSlash=p,t.isCSSPreprocessorFile=w,t.isStaticHtmlFileExt=b,t.isServerHtmlFileExt=E,t.getDirectoryPath=S,t.getBaseName=h,t.getRelativeFilename=_,t.getFilenameWithoutExtension=C,t.getFileExtension=v,t.getSmartFileExtension=y,t.compareFilenames=I,t.comparePaths=k}),define("text!language/languages.json",[],function(){return'{\n "unknown": {\n "name": "Text",\n "mode": ["null", "text/plain"]\n },\n \n "groovy": {\n "name": "Groovy",\n "mode": "groovy",\n "fileExtensions": ["groovy"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n \n "properties": {\n "name": "Properties",\n "mode": ["properties", "text/x-properties"],\n "fileExtensions": ["ini", "properties"]\n },\n\n "css": {\n "name": "CSS",\n "mode": "css",\n "fileExtensions": ["css", "css.erb"],\n "blockComment": ["/*", "*/"]\n },\n\n "scss": {\n "name": "SCSS",\n "mode": ["css", "text/x-scss"],\n "fileExtensions": ["scss", "scss.erb"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "html": {\n "name": "HTML",\n "mode": ["htmlmixed", "text/x-brackets-html"],\n "fileExtensions": ["html", "htm", "shtm", "shtml", "xhtml", "cfm", "cfml", "cfc", "dhtml", "xht", "tpl", "twig", "hbs", "handlebars", "kit", "jsp", "aspx", "ascx", "asp", "master", "cshtml", "vbhtml"],\n "blockComment": ["<!--", "-->"]\n },\n \n "ejs": {\n "name": "EJS",\n "mode": ["htmlembedded", "application/x-ejs"],\n "fileExtensions": ["ejs", "dust"],\n "blockComment": ["<!--", "-->"]\n },\n \n "erb_html": {\n "name": "Embedded Ruby",\n "mode": ["htmlembedded", "application/x-erb"],\n "fileExtensions": ["erb", "html.erb", "htm.erb"],\n "blockComment": ["<!--", "-->"]\n },\n\n "javascript": {\n "name": "JavaScript",\n "mode": "javascript",\n "fileExtensions": ["js", "jsx", "js.erb", "jsm", "_js"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "vbscript": {\n "name": "VBScript",\n "mode": "vbscript",\n "fileExtensions": ["vbs"],\n "lineComment": ["\'", "REM"]\n },\n\n "vb": {\n "name": "VB",\n "mode": ["vb", "text/x-vb"],\n "fileExtensions": ["vb"],\n "lineComment": ["\'"]\n },\n\n "json": {\n "name": "JSON",\n "mode": ["javascript", "application/json"],\n "fileExtensions": ["json"],\n "fileNames": [".jshintrc", ".bowerrc"]\n },\n\n "xml": {\n "name": "XML",\n "mode": "xml",\n "fileExtensions": ["xml", "svg", "wxs", "wxl", "wsdl", "rss", "atom", "rdf", "xslt", "xsl", "xul", "xbl", "mathml", "config", "plist", "xaml"],\n "blockComment": ["<!--", "-->"]\n },\n\n "php": {\n "name": "PHP",\n "mode": "php",\n "fileExtensions": ["php", "php3", "php4", "php5", "phtm", "phtml", "ctp"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//", "#"]\n },\n\n "c": {\n "name": "C",\n "mode": ["clike", "text/x-csrc"],\n "fileExtensions": ["c", "h", "i"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "cpp": {\n "name": "C++",\n "mode": ["clike", "text/x-c++src"],\n "fileExtensions": ["cc", "cp", "cpp", "c++", "cxx", "hh", "hpp", "hxx", "h++", "ii", "ino"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "csharp": {\n "name": "C#",\n "mode": ["clike", "text/x-csharp"],\n "fileExtensions": ["cs", "asax", "ashx"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "java": {\n "name": "Java",\n "mode": ["clike", "text/x-java"],\n "fileExtensions": ["java"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "scala": {\n "name": "Scala",\n "mode": ["clike", "text/x-scala"],\n "fileExtensions": ["scala", "sbt"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "coffeescript": {\n "name": "CoffeeScript",\n "mode": "coffeescript",\n "fileExtensions": ["coffee", "cf", "cson", "_coffee"],\n "fileNames": ["Cakefile"],\n "blockComment": ["###", "###"],\n "lineComment": ["#"]\n },\n\n "clojure": {\n "name": "Clojure",\n "mode": "clojure",\n "fileExtensions": ["clj", "cljs", "cljx"],\n "lineComment": [";", ";;"]\n },\n\n "perl": {\n "name": "Perl",\n "mode": "perl",\n "fileExtensions": ["pl", "pm"],\n "lineComment": ["#"]\n },\n\n "ruby": {\n "name": "Ruby",\n "mode": "ruby",\n "fileExtensions": ["rb", "ru", "gemspec", "rake"],\n "fileNames": ["Gemfile", "Rakefile", "Guardfile"],\n "lineComment": ["#"]\n },\n\n "python": {\n "name": "Python",\n "mode": "python",\n "fileExtensions": ["py", "pyw", "wsgi"],\n "lineComment": ["#"]\n },\n\n "sass": {\n "name": "SASS",\n "mode": "sass",\n "fileExtensions": ["sass"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "lua": {\n "name": "Lua",\n "mode": "lua",\n "fileExtensions": ["lua"],\n "blockComment": ["--[[", "]]"],\n "lineComment": ["--"]\n },\n\n "sql": {\n "name": "SQL",\n "mode": ["sql", "text/x-mysql"],\n "fileExtensions": ["sql"]\n },\n\n "diff": {\n "name": "Diff",\n "mode": "diff",\n "fileExtensions": ["diff", "patch"]\n },\n\n "markdown": {\n "name": "Markdown",\n "mode": "markdown",\n "fileExtensions": ["md", "markdown"],\n "blockComment": ["<!--", "-->"]\n },\n\n "yaml": {\n "name": "YAML",\n "mode": "yaml",\n "fileExtensions": ["yaml", "yml"],\n "lineComment": ["#"]\n },\n\n "hx": {\n "name": "Haxe",\n "mode": "haxe",\n "fileExtensions": ["hx"],\n "blockComment": ["/*", "*/"],\n "lineComment": ["//"]\n },\n\n "bash": {\n "name": "Bash",\n "mode": ["shell", "text/x-sh"],\n "fileExtensions": ["sh", "command", "bash"],\n "lineComment": ["#"]\n },\n \n "image": {\n "name": "Image",\n "fileExtensions": ["gif", "png", "jpe", "jpeg", "jpg", "ico", "bmp"],\n "isBinary": true\n },\n \n "audio": {\n "name": "Audio",\n "fileExtensions": ["mp3", "wav", "aif", "aiff", "ogg"],\n "isBinary": true\n },\n \n "binary": {\n "name": "Other Binary",\n "fileExtensions": [\n "a", "ai", "avi", "bin", "cab", "com", "db", "dll", "dmg",\n "doc", "docx", "dot", "dotx", "dsym", "dylib", "egg", "epub", "eot",\n "exe", "flv", "gz", "gzip", "htmz", "htmlz", "ipch", "iso", "jar",\n "jsz", "lib", "mpeg", "mpg", "mp4", "msi", "node", "o", "obj", "odc",\n "odb", "odf", "odg", "odp", "ods", "odt", "otf", "pak", "pdb", "pdf",\n "pdi", "ppt", "pptx", "psd", "rar", "sdf", "so", "sqlite", "suo", "svgz",\n "swf", "tar", "tif", "tiff", "ttf", "woff", "xls", "xlsx", "zip"\n ],\n "isBinary": true\n }\n}\n'}),define("language/LanguageManager",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror","utils/Async","file/FileUtils","text!language/languages.json","thirdparty/lodash"],function(e,t){function n(e,t,n){var r=n?n.reject:console.error;
13return"[object String]"!==Object.prototype.toString.call(e)?(r(t+" must be a string"),!1):""===e?(r(t+" must not be empty"),!1):!0}function r(){function e(e){return b.modes[e]?void console.error('There already is a CodeMirror mode with the name "'+e+'"'):void t.apply(b,arguments)}var t=b.defineMode;b.defineMode=e}function i(e,t){return L[e]?void console.warn('CodeMirror mode "'+e+'" is already used by language '+L[e]._name+" - cannot fully register language "+t._name+" using the same mode. Some features will treat all content with this mode as language "+L[e]._name):void(L[e]=t)}function o(e){return x[e]}function a(e){return D[e.toLowerCase()]}function s(e,t){var n,r,i,o=O[e];if(!t&&o)return o;if(n=w.getBaseName(e).toLowerCase(),o=M[n],!o)for(i=n.split("."),""===i[0]&&i.shift(),i.shift();!o&&i.length;)r=i.join("."),o=D[r],i.shift();return o||I}function l(){return $.extend({},x)}function c(e){var t=L[e];return t?t:(console.log("Called LanguageManager._getLanguageForMode with a mode for which no language has been registered:",e),I)}function u(e){x[e.getId()]=e,$(t).triggerHandler("languageAdded",[e])}function d(e){$(t).triggerHandler("languageModified",[e])}function p(e,t){var n=s(e);t?O[e]=t:delete O[e];var r=s(e);d(n),d(r)}function f(){O={}}function h(){this._fileExtensions=[],this._fileNames=[],this._modeToLanguageMap={},this._lineCommentSyntax=[]}function m(e,t){function n(){if(c)for(o=0,a=c.length;a>o;o++)s.addFileExtension(c[o]);if(d)for(o=0,a=d.length;a>o;o++)s.addFileName(d[o]);s._setBinary(!!t.isBinary),x[s.getId()]=s}var r=new $.Deferred;if(k[e])return r.reject('Language "'+e+'" is waiting to be resolved.'),r.promise();if(x[e])return r.reject('Language "'+e+'" is already defined'),r.promise();var o,a,s=new h,l=t.name,c=t.fileExtensions,d=t.fileNames,p=t.blockComment,f=t.lineComment;return!s._setId(e)||!s._setName(l)||p&&!s.setBlockCommentSyntax(p[0],p[1])||f&&!s.setLineCommentSyntax(f)?(r.reject(),r.promise()):(t.isBinary?(n(),r.resolve(s)):(k[e]=s,s._loadAndSetMode(t.mode).done(function(){i(s.getMode(),s),n(),u(s),r.resolve(s)}).fail(function(e){console.error(e),r.reject(e)}).always(function(){delete k[e]})),r.promise())}function g(e,t){if(t.overridden[e]){var n=o(t.overridden[e]);n[t.add](e),delete t.overridden[e]}}function v(e){var n=y.get(e),r=Object.keys(n),i=N[e],a=i.last,s=i.overridden;r.forEach(function(e){var r;n[e]!==a[e]&&(a[e]&&(r=o(a[e]),r&&(r[i.remove](e),g(e,i))),r=t[i.get](e),r&&(r[i.remove](e),s[e]||(s[e]=r.getId())),r=o(n[e]),r&&r[i.add](e))}),C.difference(Object.keys(a),r).forEach(function(e){var t=o(a[e]);t&&(t[i.remove](e),g(e,i))}),i.last=n}var y,_,b=e("thirdparty/CodeMirror2/lib/codemirror"),E=e("utils/Async"),w=e("file/FileUtils"),S=e("text!language/languages.json"),C=e("thirdparty/lodash"),I=null,k={},x={},T={},D=Object.create(T),M={},O={},L={},R="language.fileExtensions",A="language.fileNames",N={};N[R]={last:{},overridden:{},add:"addFileExtension",remove:"removeFileExtension",get:"getLanguageForExtension"},N[A]={last:{},overridden:{},add:"addFileName",remove:"removeFileName",get:"getLanguageForPath"},h.prototype._id=null,h.prototype._name=null,h.prototype._mode=null,h.prototype._fileExtensions=null,h.prototype._fileNames=null,h.prototype._lineCommentSyntax=null,h.prototype._modeToLanguageMap=null,h.prototype._blockCommentSyntax=null,h.prototype._isBinary=!1,h.prototype.getId=function(){return this._id},h.prototype._setId=function(e){return n(e,"Language ID")?e.match(/^[a-z0-9]+(_[a-z0-9]+)*$/)?(this._id=e,!0):(console.error('Invalid language ID "'+e+'": Only groups of lower case letters and numbers are allowed, separated by underscores.'),!1):!1},h.prototype.getName=function(){return this._name},h.prototype._setName=function(e){return n(e,"name")?(this._name=e,!0):!1},h.prototype.getMode=function(){return this._mode},h.prototype._loadAndSetMode=function(t){var r,i=new $.Deferred,o=this;if(Array.isArray(t)){if(2!==t.length)return i.reject("Mode must either be a string or an array containing two strings"),i.promise();r=t[1],t=t[0]}if(!n(t,"mode",i))return i.reject(),i.promise();var a=function(){if(!b.modes[t])return void i.reject('CodeMirror mode "'+t+'" is not loaded');if(r){var e=b.mimeModes[r];if(!e)return void i.reject('CodeMirror MIME mode "'+r+'" not found')}o._mode=r||t,o._wasModified(),i.resolve(o)};return b.modes[t]?a():e(["thirdparty/CodeMirror2/mode/"+t+"/"+t],a),i.promise()},h.prototype.getFileExtensions=function(){return this._fileExtensions.concat()},h.prototype.getFileNames=function(){return this._fileNames.concat()},h.prototype.addFileExtension=function(e){Array.isArray(e)?e.forEach(this._addFileExtension.bind(this)):this._addFileExtension(e)},h.prototype._addFileExtension=function(e){if("."===e.charAt(0)&&(e=e.substr(1)),e=e.toLowerCase(),-1===this._fileExtensions.indexOf(e)){this._fileExtensions.push(e);var t=D[e];t?console.warn('Cannot register file extension "'+e+'" for '+this._name+", it already belongs to "+t._name):D[e]=this,this._wasModified()}},h.prototype.removeFileExtension=function(e){Array.isArray(e)?e.forEach(this._removeFileExtension.bind(this)):this._removeFileExtension(e)},h.prototype._removeFileExtension=function(e){"."===e.charAt(0)&&(e=e.substr(1)),e=e.toLowerCase();var t=this._fileExtensions.indexOf(e);-1!==t&&(this._fileExtensions.splice(t,1),delete D[e],this._wasModified())},h.prototype.addFileName=function(e){Array.isArray(e)?e.forEach(this._addFileName.bind(this)):this._addFileName(e)},h.prototype._addFileName=function(e){if(e=e.toLowerCase(),-1===this._fileNames.indexOf(e)){this._fileNames.push(e);var t=M[e];t?console.warn('Cannot register file name "'+e+'" for '+this._name+", it already belongs to "+t._name):M[e]=this,this._wasModified()}},h.prototype.removeFileName=function(e){Array.isArray(e)?e.forEach(this._removeFileName.bind(this)):this._removeFileName(e)},h.prototype._removeFileName=function(e){e=e.toLowerCase();var t=this._fileNames.indexOf(e);-1!==t&&(this._fileNames.splice(t,1),delete M[e],this._wasModified())},h.prototype.hasLineCommentSyntax=function(){return this._lineCommentSyntax.length>0},h.prototype.getLineCommentPrefixes=function(){return this._lineCommentSyntax},h.prototype.setLineCommentSyntax=function(e){var t,r=Array.isArray(e)?e:[e];if(r.length){for(this._lineCommentSyntax=[],t=0;t<r.length;t++)n(String(r[t]),Array.isArray(e)?"prefix["+t+"]":"prefix"),this._lineCommentSyntax.push(r[t]);this._wasModified()}else console.error("The prefix array should not be empty");return!0},h.prototype.hasBlockCommentSyntax=function(){return Boolean(this._blockCommentSyntax)},h.prototype.getBlockCommentPrefix=function(){return this._blockCommentSyntax&&this._blockCommentSyntax.prefix},h.prototype.getBlockCommentSuffix=function(){return this._blockCommentSyntax&&this._blockCommentSyntax.suffix},h.prototype.setBlockCommentSyntax=function(e,t){return n(e,"prefix")&&n(t,"suffix")?(this._blockCommentSyntax={prefix:e,suffix:t},this._wasModified(),!0):!1},h.prototype.getLanguageForMode=function(e){return e===this._mode?this:this._modeToLanguageMap[e]||c(e)},h.prototype._setLanguageForMode=function(e,t){return e===this._mode&&t!==this?(console.error("A language must always map its mode to itself"),!1):(this._modeToLanguageMap[e]=t,this._wasModified(),!0)},h.prototype.isFallbackLanguage=function(){return this===I},h.prototype._wasModified=function(){x[this._id]&&d(this)},h.prototype.isBinary=function(){return this._isBinary},h.prototype._setBinary=function(e){this._isBinary=e},r(),b.defineMIME("text/x-brackets-html",{name:"htmlmixed",scriptTypes:[{matches:/\/x-handlebars|\/x-mustache|^text\/html$/i,mode:null}]}),S=JSON.parse(S),_=E.doInParallel(Object.keys(S),function(e){return m(e,S[e])},!1),_.always(function(){var t=o("html");t._setLanguageForMode("xml",t),i("html",t);var n=o("php");n._setLanguageForMode("clike",n);var r=o("scss");r._setLanguageForMode("css",r),I=o("unknown"),e(["preferences/PreferencesManager"],function(e){y=e,e.definePreference(R,"object",{}).on("change",function(){v(R)}),e.definePreference(A,"object",{}).on("change",function(){v(A)}),v(R),v(A)})}),t._EXTENSION_MAP_PREF=R,t._NAME_MAP_PREF=A,t._resetPathLanguageOverrides=f,t.ready=_,t.defineLanguage=m,t.getLanguage=o,t.getLanguageForExtension=a,t.getLanguageForPath=s,t.getLanguages=l,t.setLanguageOverrideForPath=p}),define("text!htmlContent/project-settings-dialog.html",[],function(){return'<div class="project-settings-dialog modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{title}}</h1>\n </div>\n <div class="modal-body">\n <div class="field-container">\n <label>\n {{Strings.PROJECT_SETTING_BASE_URL}}: <input type="text" placeholder="{{Strings.PROJECT_SETTING_BASE_URL_HINT}}" value="{{baseUrl}}" class="url" />\n </label>\n {{#errorMessage}}<div class="alert" style="margin-bottom: 0">{{{errorMessage}}}</div>{{/errorMessage}}\n </div>\n </div>\n <div class="modal-footer">\n <button class="dialog-button btn" data-button-id="cancel">{{Strings.CANCEL}}</button>\n <button class="dialog-button btn primary" data-button-id="ok">{{Strings.DONE}}</button>\n </div>\n</div>\n'}),define("preferences/PreferencesDialogs",["require","exports","module","thirdparty/path-utils/path-utils.min","widgets/Dialogs","project/ProjectManager","utils/StringUtils","strings","text!htmlContent/project-settings-dialog.html"],function(e,t){function n(e){var t="";if(""===e)return t;var n=PathUtils.parseUrl(e);if(n)if(0!==n.href.search(/^(http|https):\/\//i))t=a.format(s.BASEURL_ERROR_INVALID_PROTOCOL,n.href.substring(0,n.href.indexOf("//")));else if(""!==n.search)t=a.format(s.BASEURL_ERROR_SEARCH_DISALLOWED,n.search);else if(""!==n.hash)t=a.format(s.BASEURL_ERROR_HASH_DISALLOWED,n.hash);else{var r=e.search(/[ \^\[\]\{\}<>\\"\?]+/);-1!==r&&(t=a.format(s.BASEURL_ERROR_INVALID_CHAR,e[r]))}else t=s.BASEURL_ERROR_UNKNOWN_ERROR;return t}function r(e,t){var c,u,d,p="",f=o.getProjectRoot();f&&(p=f.name),d=a.format(s.PROJECT_SETTINGS_TITLE,p);var h={title:d,baseUrl:e,errorMessage:t,Strings:s};return u=i.showModalDialogUsingTemplate(Mustache.render(l,h)),u.done(function(e){if(e===i.DIALOG_BTN_OK){var t=c.val(),a=n(t);""===a?o.setBaseUrl(t):r(t,a)}}),c=u.getElement().find(".url"),c.focus(),u}e("thirdparty/path-utils/path-utils.min");var i=e("widgets/Dialogs"),o=e("project/ProjectManager"),a=e("utils/StringUtils"),s=e("strings"),l=e("text!htmlContent/project-settings-dialog.html");t._validateBaseUrl=n,t.showProjectPreferencesDialog=r}),define("preferences/PreferenceStorage",["require","exports","module","thirdparty/lodash","preferences/PreferencesManager","utils/DeprecationWarning"],function(e,t){function n(e,t){if("string"==typeof e){var n={},r=null;n[e]=t;try{n=JSON.parse(JSON.stringify(n))}catch(i){r=i}return r||void 0===n[e]?(console.error("Value '"+t+"' for key '"+e+"' must be a valid JSON value"),!1):!0}return console.error("Preference key '"+e+"' must be a string"),!1}function r(){a.savePreferences()}function i(e,t){this._clientID=e,this._json=t}var o=e("thirdparty/lodash"),a=e("preferences/PreferencesManager"),s=e("utils/DeprecationWarning");i.prototype.getClientID=function(){return this._clientID},i.prototype.remove=function(e){s.deprecationWarning("remove is called to remove a preference '"+e+",' use PreferencesManager.set (with value of undefined) instead."),delete this._json[e],r()},i.prototype.setValue=function(e,t){s.deprecationWarning("setValue is called to set preference '"+e+",' use PreferencesManager.set instead."),n(e,t)&&(this._json[e]=t,r())},i.prototype.getValue=function(e){return s.deprecationWarning("getValue is called to get preference '"+e+",' use PreferencesManager.get instead."),this._json[e]},i.prototype.getAllValues=function(){return JSON.parse(JSON.stringify(this._json))},i.prototype.setAllValues=function(e,t){s.deprecationWarning("setAllValues is called to set preferences '"+Object.keys(e)+",' use PreferencesManager.set (probably with doNotSave flag) instead.");var i=this,a=null;return o.some(e,function(e,t){try{n(t,e)}catch(r){return a=r,!0}}),a?void console.error(a):(t||o.forEach(this._json,function(e,t){delete i._json[t]}),o.forEach(e,function(e,t){i._json[t]=e}),void r())},i.prototype.convert=function(e,t,n,i){var s=this._json,l=this,c=!0,u=n?a.stateManager:a,d=new $.Deferred;return t||(t=[]),Object.keys(s).forEach(function(n){if(!(t.indexOf(n)>-1)){var r=e[n];if(!r&&i)r=i(n);else if(i){var a=i(n,s[n]);a&&(r=o.cloneDeep(a))}if(r)if(o.isString(r)){var d=r.split(" ");if("user"===d[0]){var p=d.length>1?d[1]:n,f=null;if(d.length>2&&-1!==d[2].indexOf("/")){var h=r.substr(r.indexOf(d[2]));f={location:{scope:"user",layer:"project",layerID:h}}}u.set(p,s[n],f),t.push(n)}}else o.isObject(r)?(Object.keys(r).forEach(function(e){u.set(e,r[e])}),t.push(n)):c=!1;else console.warn("Preferences conversion for ",l._clientID," has no rule for",n),c=!1}}),t.length>0?u.save().done(function(){r(),d.resolve(c,t)}).fail(function(e){d.reject(e)}):d.resolve(c,t),d.promise()},t.PreferenceStorage=i}),define("filesystem/WatchedRoot",["require","exports","module"],function(e,t,n){function r(e,t){this.entry=e,this.filter=t}r.INACTIVE=0,r.STARTING=1,r.ACTIVE=2,r.prototype.entry=null,r.prototype.filter=null,r.prototype.status=r.INACTIVE,n.exports=r}),define("filesystem/FileSystemEntry",["require","exports","module","filesystem/FileSystemError","filesystem/WatchedRoot"],function(e,t,n){function r(e,t){this._setPath(e),this._fileSystem=t,this._id=l++}var i=e("filesystem/FileSystemError"),o=e("filesystem/WatchedRoot"),a=100,s=3e4,l=0;Object.defineProperties(r.prototype,{fullPath:{get:function(){return this._path},set:function(){throw new Error("Cannot set fullPath")}},name:{get:function(){return this._name},set:function(){throw new Error("Cannot set name")}},parentPath:{get:function(){return this._parentPath},set:function(){throw new Error("Cannot set parentPath")}},id:{get:function(){return this._id},set:function(){throw new Error("Cannot set id")}},isFile:{get:function(){return this._isFile},set:function(){throw new Error("Cannot set isFile")}},isDirectory:{get:function(){return this._isDirectory},set:function(){throw new Error("Cannot set isDirectory")}},_impl:{get:function(){return this._fileSystem._impl},set:function(){throw new Error("Cannot set _impl")}}}),r.prototype._stat=null,r.prototype._fileSystem=null,r.prototype._path=null,r.prototype._name=null,r.prototype._parentPath=null,r.prototype._isFile=!1,r.prototype._isDirectory=!1,r.prototype._watchedRoot=null,r.prototype._watchedRootFilterResult=!1,r.prototype._isWatched=function(e){var t=this._watchedRoot,n=this._watchedRootFilterResult;if(t||(t=this._fileSystem._findWatchedRootForPath(this._path),t&&(this._watchedRoot=t,n=t.filter(this._name,this._parentPath),this._watchedRootFilterResult=n)),t){if(t.status===o.ACTIVE||e&&t.status===o.STARTING)return n;this._watchedRoot=void 0,this._watchedRootFilterResult=!1,this._clearCachedData()}return!1},r.prototype._setPath=function(e){var t=e.split("/");this.isDirectory&&t.pop(),this._name=t[t.length-1],t.pop(),this._parentPath=t.length>0?t.join("/")+"/":null,this._path=e;var n=this._watchedRoot;n&&(0===e.indexOf(n.entry.fullPath)?this._watchedRootFilterResult=n.filter(this._name,this._parentPath):(this._watchedRoot=null,this._watchedRootFilterResult=!1))},r.prototype._clearCachedData=function(){this._stat=void 0},r.prototype.toString=function(){return"["+(this.isDirectory?"Directory ":"File ")+this._path+"]"},r.prototype.exists=function(e){return this._stat?void e(null,!0):void this._impl.exists(this._path,function(t,n){return t?(this._clearCachedData(),void e(t)):(n||this._clearCachedData(),void e(null,n))}.bind(this))},r.prototype.stat=function(e){return this._stat?void e(null,this._stat):void this._impl.stat(this._path,function(t,n){return t?(this._clearCachedData(),void e(t)):(this._isWatched()&&(this._stat=n),void e(null,n))}.bind(this))},r.prototype.rename=function(e,t){t=t||function(){},this._fileSystem._beginChange(),this._impl.rename(this._path,e,function(n){var r=this._path;try{if(n)return this._clearCachedData(),void t(n);this._fileSystem._handleRename(this._path,e,this.isDirectory);try{t(null)}finally{this._fileSystem._fireRenameEvent(r,e)}}finally{this._fileSystem._endChange()}}.bind(this))},r.prototype.unlink=function(e){e=e||function(){},this._fileSystem._beginChange(),this._clearCachedData(),this._impl.unlink(this._path,function(t){var n=this._fileSystem.getDirectoryForPath(this.parentPath);this._fileSystem._handleDirectoryChange(n,function(r,i){try{e(t)}finally{this._fileSystem._fireChangeEvent(n,r,i),this._fileSystem._endChange()}}.bind(this))}.bind(this))},r.prototype.moveToTrash=function(e){return this._impl.moveToTrash?(e=e||function(){},this._fileSystem._beginChange(),this._clearCachedData(),void this._impl.moveToTrash(this._path,function(t){var n=this._fileSystem.getDirectoryForPath(this.parentPath);this._fileSystem._handleDirectoryChange(n,function(r,i){try{e(t)}finally{this._fileSystem._fireChangeEvent(n,r,i),this._fileSystem._endChange()}}.bind(this))}.bind(this))):void this.unlink(e)},r.prototype._visitHelper=function(e,t,n,r,i){var o=r.maxDepth,a=r.maxEntriesCounter;if(a.value--<=0||o--<0)return void i(null);if(this.isDirectory){var s=e.realPath||this.fullPath;if(t.hasOwnProperty(s))return void i(null);t[s]=!0}return!n(this)||this.isFile?void i(null):void this.getContents(function(e,r,s){function l(){0===--c&&i(null)}if(e)return void i(e);var c=r.length;if(0===c)return void i(null);var u={maxDepth:o,maxEntriesCounter:a};r.forEach(function(e,r){var i=s[r];e._visitHelper(i,t,n,u,l)})}.bind(this))},r.prototype.visit=function(e,t,n){"function"==typeof t?(n=t,t={}):(void 0===t&&(t={}),n=n||function(){}),void 0===t.maxDepth&&(t.maxDepth=a),void 0===t.maxEntries&&(t.maxEntries=s),t.maxEntriesCounter={value:t.maxEntries},this.stat(function(r,o){return r?void n(r):void this._visitHelper(o,{},e,t,function(e){if(n){if(e)return void n(e);if(t.maxEntriesCounter.value<0)return void n(i.TOO_MANY_ENTRIES);n(null)}}.bind(this))}.bind(this))},n.exports=r}),define("filesystem/Directory",["require","exports","module","filesystem/FileSystemEntry"],function(e,t,n){function r(e,t){this._isDirectory=!0,o.call(this,e,t)}function i(e,t){if(e.length>0){var n=e.pop();try{n.apply(void 0,t)}finally{i(e,t)}}}var o=e("filesystem/FileSystemEntry");r.prototype=Object.create(o.prototype),r.prototype.constructor=r,r.prototype.parentClass=o.prototype,r.prototype._contents=null,r.prototype._contentsStats=null,r.prototype._contentsStatsErrors=null,r.prototype._clearCachedData=function(e){if(o.prototype._clearCachedData.apply(this),!e)if(this._contents)this._contents.forEach(function(e){e._clearCachedData(!0)});else{var t=this.fullPath;this._fileSystem._index.visitAll(function(e){e.parentPath===t&&e._clearCachedData(!0)})}this._contents=void 0,this._contentsStats=void 0,this._contentsStatsErrors=void 0},r.prototype.getContents=function(e){return this._contentsCallbacks?void this._contentsCallbacks.push(e):this._contents?void e(null,this._contents,this._contentsStats,this._contentsStatsErrors):(this._contentsCallbacks=[e],void this._impl.readdir(this.fullPath,function(e,t,n){var r,o=[],a=[];if(e)this._clearCachedData();else{var s=this._isWatched(!0);t.forEach(function(e,t){var i=this.fullPath+e;if(this._fileSystem._indexFilter(i,e)){var l,c=n[t];"string"==typeof c?(void 0===r&&(r={}),r[i]=c):(l=c.isFile?this._fileSystem.getFileForPath(i):this._fileSystem.getDirectoryForPath(i),s&&(l._stat=c),o.push(l),a.push(c))}},this),s&&(this._contents=o,this._contentsStats=a,this._contentsStatsErrors=r)}var l=this._contentsCallbacks;this._contentsCallbacks=null;var c=[e,o,a,r];i(l,c)}.bind(this)))},r.prototype.create=function(e){e=e||function(){},this._fileSystem._beginChange(),this._impl.mkdir(this._path,function(t,n){if(t){this._clearCachedData();try{return void e(t)}finally{this._fileSystem._endChange()}}var r=this._fileSystem.getDirectoryForPath(this.parentPath);this._isWatched()&&(this._stat=n),this._fileSystem._handleDirectoryChange(r,function(t,i){try{e(null,n)}finally{this._fileSystem._fireChangeEvent(r,t,i),this._fileSystem._endChange()}}.bind(this))}.bind(this))},n.exports=r}),define("filesystem/File",["require","exports","module","filesystem/FileSystemEntry"],function(e,t,n){function r(e,t){this._isFile=!0,i.call(this,e,t)}var i=e("filesystem/FileSystemEntry");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype.parentClass=i.prototype,r.prototype._contents=null,r.prototype._hash=null,r.prototype._clearCachedData=function(){i.prototype._clearCachedData.apply(this),this._contents=null},r.prototype.read=function(e,t){if("function"==typeof e&&(t=e,e={}),null!==this._contents&&this._stat)return void t(null,this._contents,this._stat);var n=this._isWatched();n&&(e.stat=this._stat),this._impl.readFile(this._path,e,function(e,r,i){return e?(this._clearCachedData(),void t(e)):(this._hash=i._hash,n&&(this._stat=i,this._contents=r),void t(e,r,i))}.bind(this))},r.prototype.write=function(e,t,n){"function"==typeof t?(n=t,t={}):(void 0===t&&(t={}),n=n||function(){}),t.blind||(t.expectedHash=this._hash,t.expectedContents=this._contents),this._fileSystem._beginChange(),this._impl.writeFile(this._path,e,t,function(t,r,i){if(t){this._clearCachedData();try{return void n(t)}finally{this._fileSystem._endChange()}}if(this._hash=r._hash,this._isWatched()&&(this._stat=r,this._contents=e),i){var o=this._fileSystem.getDirectoryForPath(this.parentPath);this._fileSystem._handleDirectoryChange(o,function(e,t){try{n(null,r)}finally{this._fileSystem._fireChangeEvent(o,e,t),this._fileSystem._endChange()}}.bind(this))}else try{n(null,r)}finally{this._fileSystem._fireChangeEvent(this),this._fileSystem._endChange()}}.bind(this))},n.exports=r}),define("filesystem/FileIndex",["require","exports","module"],function(e,t,n){function r(){this._index={}}r.prototype._index=null,r.prototype.clear=function(){this._index={}},r.prototype.visitAll=function(e){var t;for(t in this._index)this._index.hasOwnProperty(t)&&e(this._index[t],t)},r.prototype.addEntry=function(e){this._index[e.fullPath]=e},r.prototype.removeEntry=function(e){function t(t){var n=e[t];"function"==typeof n&&(e[t]=function(){return console.warn("FileSystemEntry used after being removed from index: ",r),n.apply(e,arguments)})}var n,r=e.fullPath;delete this._index[r];for(n in e)e.hasOwnProperty(n)&&t(n)},r.prototype.entryRenamed=function(e,t,n){var r,i={};for(r in this._index)this._index.hasOwnProperty(r)&&(n?0===r.indexOf(e):r===e)&&(i[r]=t+r.substr(e.length));for(r in i)if(i.hasOwnProperty(r)){var o=this._index[r];console.assert(o.fullPath===r),delete this._index[r],this._index[i[r]]=o,o._setPath(i[r])}},r.prototype.getEntry=function(e){return this._index[e]},n.exports=r}),define("filesystem/FileSystem",["require","exports","module","filesystem/Directory","filesystem/File","filesystem/FileIndex","filesystem/FileSystemError","filesystem/WatchedRoot","fileSystemImpl"],function(e,t){function n(){this._index=new s,this._watchedRoots={},this._watchRequests=[],this._externalChanges=[]}function r(e){return"/"!==e[e.length-1]&&(e+="/"),e}function i(e){return function(){return e.apply(d,arguments)}}var o=e("filesystem/Directory"),a=e("filesystem/File"),s=e("filesystem/FileIndex"),l=e("filesystem/FileSystemError"),c=e("filesystem/WatchedRoot");n.prototype._impl=null,n.prototype._index=null,n.prototype._activeChangeCount=0,n.prototype._getActiveChangeCount=function(){return this._activeChangeCount},n.prototype._externalChanges=null,n.prototype._triggerExternalChangesNow=function(){this._externalChanges.forEach(function(e){this._handleExternalChange(e.path,e.stat)},this),this._externalChanges.length=0},n.prototype._enqueueExternalChange=function(e,t){this._externalChanges.push({path:e,stat:t}),this._activeChangeCount||this._triggerExternalChangesNow()},n.prototype._watchRequests=null,n.prototype._dequeueWatchRequest=function(){if(this._watchRequests.length>0){var e=this._watchRequests[0];e.fn.call(null,function(){var t=arguments;try{e.cb.apply(null,t)}finally{this._watchRequests.shift(),this._dequeueWatchRequest()}}.bind(this))}},n.prototype._enqueueWatchRequest=function(e,t){this._watchRequests.push({fn:e,cb:t}),1===this._watchRequests.length&&this._dequeueWatchRequest()},n.prototype._watchedRoots=null,n.prototype._findWatchedRootForPath=function(e){var t=null;return Object.keys(this._watchedRoots).some(function(n){return 0===e.indexOf(n)?(t=this._watchedRoots[n],!0):void 0},this),t},n.prototype._watchOrUnwatchEntry=function(e,t,n,r){var i=this._impl,o=i.recursiveWatch,a=r?"watchPath":"unwatchPath";o?e!==t.entry?n(null):this._enqueueWatchRequest(function(t){i[a].call(i,e.fullPath,t)}.bind(this),n):r?this._enqueueWatchRequest(function(n){var r=[],o=function(e){return t.filter(e.name,e.parentPath)?((e.isDirectory||e===t.entry)&&r.push(e),!0):!1};e.visit(o,function(e){if(e)return void n(e);var t=r.length;if(0===t)return void n(null);var o=function(){0===--t&&n(null)};r.forEach(function(e){i.watchPath(e.fullPath,o)})})},n):this._enqueueWatchRequest(function(t){i.unwatchPath(e.fullPath,t)},n)},n.prototype._watchEntry=function(e,t,n){this._watchOrUnwatchEntry(e,t,n,!0)},n.prototype._unwatchEntry=function(e,t,n){this._watchOrUnwatchEntry(e,t,function(t){this._index.visitAll(function(t){0===t.fullPath.indexOf(e.fullPath)&&t._clearCachedData(!0)}.bind(this)),n(t)}.bind(this),!1)},n.prototype.init=function(e){console.assert(!this._impl,"This FileSystem has already been initialized!");var t=this._enqueueExternalChange.bind(this),n=this._unwatchAll.bind(this);this._impl=e,this._impl.initWatchers(t,n)},n.prototype.close=function(){this._impl.unwatchAll(),this._index.clear()},n.prototype._indexFilter=function(e,t){var n=this._findWatchedRootForPath(e);return n?n.filter(t,e):!0},n.prototype._beginChange=function(){this._activeChangeCount++},n.prototype._endChange=function(){this._activeChangeCount--,this._activeChangeCount<0&&console.error("FileSystem _activeChangeCount has fallen below zero!"),this._activeChangeCount||this._triggerExternalChangesNow()},n.isAbsolutePath=function(e){return"/"===e[0]||":"===e[1]&&"/"===e[2]};var u=/\/{2,}/g;n.prototype._normalizePath=function(e,t){if(!n.isAbsolutePath(e))throw new Error("Paths must be absolute: '"+e+"'");var i=this._impl.normalizeUNCPaths&&0===e.search(u);if(e=e.replace(u,"/"),-1!==e.indexOf("..")){var o,a=e.split("/");for(o=1;o<a.length;o++)if(".."===a[o]){if(2>o)throw new Error("Invalid absolute path: '"+e+"'");a.splice(o-1,2),o-=2}e=a.join("/")}return t&&(e=r(e)),i&&(e="/"+e),e},n.prototype._getEntryForPath=function(e,t){var n=e===o;t=this._normalizePath(t,n);var r=this._index.getEntry(t);return r||(r=new e(t,this),this._index.addEntry(r)),r},n.prototype.getFileForPath=function(e){return this._getEntryForPath(a,e)},n.prototype.getDirectoryForPath=function(e){return this._getEntryForPath(o,e)},n.prototype.resolve=function(e,t){var n=this._normalizePath(e,!1),i=this._index.getEntry(n);i||(n=r(n),i=this._index.getEntry(n)),i?i.stat(function(e,n){return e?void t(e):void t(null,i,n)}):this._impl.stat(e,function(n,r){return n?void t(n):(i=r.isFile?this.getFileForPath(e):this.getDirectoryForPath(e),i._isWatched()&&(i._stat=r),void t(null,i,r))}.bind(this))},n.prototype.showOpenDialog=function(e,t,n,r,i,o){this._impl.showOpenDialog(e,t,n,r,i,o)},n.prototype.showSaveDialog=function(e,t,n,r){this._impl.showSaveDialog(e,t,n,r)},n.prototype._fireRenameEvent=function(e,t){$(this).trigger("rename",[e,t])},n.prototype._fireChangeEvent=function(e,t,n){$(this).trigger("change",[e,t,n])},n.prototype._handleRename=function(e,t,n){this._index.entryRenamed(e,t,n)},n.prototype._handleDirectoryChange=function(e,t){var n=e._contents;e._clearCachedData(),e.getContents(function(r,i){var o=n&&i.filter(function(e){return-1===n.indexOf(e)}),a=n&&n.filter(function(e){return-1===i.indexOf(e)}),s=this._findWatchedRootForPath(e.fullPath);if(!s||!s.filter(e.name,e.parentPath))return this._index.visitAll(function(t){0===t.fullPath.indexOf(e.fullPath)&&t._clearCachedData(!0)}.bind(this)),void t(o,a);var l=o?o.length:0,c=a?a.length:0,u=l+c;if(0===u)return void t(o,a);var d=function(e){e&&console.error("FileSystem error in _handleDirectoryChange after watch/unwatch entries: "+e),0===--u&&t(o,a)};o&&o.forEach(function(e){this._watchEntry(e,s,d)},this),a&&a.forEach(function(e){this._unwatchEntry(e,s,d)},this)}.bind(this))},n.prototype._handleExternalChange=function(e,t){if(!e)return this._index.visitAll(function(e){e._clearCachedData(!0)}),void this._fireChangeEvent(null);e=this._normalizePath(e,!1);var n=this._index.getEntry(e);if(n){var r=n._stat;n.isFile?t&&r&&t.mtime.getTime()===r.mtime.getTime()||(n._clearCachedData(),n._stat=t,this._fireChangeEvent(n)):this._handleDirectoryChange(n,function(e,r){n._stat=t,this._fireChangeEvent(n,e,r)}.bind(this))}},n.prototype.watch=function(e,t,n){var r=e.fullPath;n=n||function(){};var i=this._findWatchedRootForPath(r);if(i&&(i.status===c.STARTING||i.status===c.ACTIVE))return void n("A parent of this root is already watched");var o=Object.keys(this._watchedRoots).some(function(e){var t=this._watchedRoots[e],n=t.entry.fullPath;return 0===n.indexOf(r)},this);if(o&&(o.status===c.STARTING||o.status===c.ACTIVE))return void n("A child of this root is already watched");var a=new c(e,t);this._watchedRoots[r]=a,a.status=c.STARTING,this._watchEntry(e,a,function(t){return t?(console.warn("Failed to watch root: ",e.fullPath,t),delete this._watchedRoots[r],void n(t)):(a.status=c.ACTIVE,void n(null))}.bind(this))},n.prototype.unwatch=function(e,t){var n=e.fullPath,r=this._watchedRoots[n];return t=t||function(){},r?(r.status=c.INACTIVE,void this._unwatchEntry(e,r,function(r){return delete this._watchedRoots[n],this._index.visitAll(function(t){0===t.fullPath.indexOf(e.fullPath)&&this._index.removeEntry(t)}.bind(this)),r?(console.warn("Failed to unwatch root: ",e.fullPath,r),void t(r)):void t(null)}.bind(this))):void t(l.ROOT_NOT_WATCHED)},n.prototype._unwatchAll=function(){console.warn("File watchers went offline!"),Object.keys(this._watchedRoots).forEach(function(e){var t=this._watchedRoots[e];t.status=c.INACTIVE,delete this._watchedRoots[e],this._unwatchEntry(t.entry,t,function(){console.warn("Watching disabled for",t.entry.fullPath)})},this),this._handleExternalChange(null)};var d;t.init=i(n.prototype.init),t.close=i(n.prototype.close),t.shouldShow=i(n.prototype.shouldShow),t.getFileForPath=i(n.prototype.getFileForPath),t.getDirectoryForPath=i(n.prototype.getDirectoryForPath),t.resolve=i(n.prototype.resolve),t.showOpenDialog=i(n.prototype.showOpenDialog),t.showSaveDialog=i(n.prototype.showSaveDialog),t.watch=i(n.prototype.watch),t.unwatch=i(n.prototype.unwatch),t.isAbsolutePath=n.isAbsolutePath,t._getActiveChangeCount=i(n.prototype._getActiveChangeCount),t.on=function(e,t){$(d).on(e,t)},t.off=function(e,t){$(d).off(e,t)},t._FileSystem=n,d=new n,d.init(e("fileSystemImpl"))}),define("utils/ExtensionUtils",["require","exports","module","filesystem/FileSystem","file/FileUtils"],function(e,t){function n(e){return $("<style>").text(e).appendTo("head")[0]}function r(e,t){var n={type:"text/css",rel:"stylesheet",href:e},r=$("<link/>").attr(n);return t&&r.on("load",t.resolve).on("error",t.reject),r.appendTo("head"),r[0]}function i(e){return"win"===brackets.platform?PathUtils.isAbsoluteUrl(e):d.isAbsolutePath(e)}function o(e,t){var n,r=new $.Deferred;if(t){var o=t.slice(0,t.lastIndexOf("/")+1),a=t.slice(o.length);n={filename:a,paths:[o],rootpath:o},i(t)&&(n.currentFileInfo={currentDirectory:o,entryPath:o,filename:t,rootFilename:t,rootpath:o})}var s=new less.Parser(n);return s.parse(e,function(e,t){e?r.reject(e):r.resolve(t.toCSS())}),r.promise()}function a(e,t){var n=e.uri.substr(0,e.uri.lastIndexOf("/")+1);return t&&(n+=t),n}function s(e,t){var n=encodeURI(a(e,t));return"win"===brackets.platform&&-1!==n.indexOf(":")&&(n="file:///"+n),n
14}function l(e,t){var n=PathUtils.isAbsoluteUrl(t)?t:s(e,t),r=$.get(n);return r}function c(e,t){var i=new $.Deferred;return l(e,t).done(function(e){var t=this.url;if(".less"===t.slice(-5))o(e,t).done(function(e){i.resolve(n(e))}).fail(i.reject);else{var a=new $.Deferred,s=r(t,a);a.done(function(){i.resolve(s)}).fail(i.reject)}}).fail(i.reject),i.promise()}function u(e){var t=d.getFileForPath(e+"/package.json"),n=new $.Deferred;return p.readAsText(t).done(function(e){try{var t=JSON.parse(e);n.resolve(t)}catch(r){n.reject()}}).fail(function(){n.reject()}),n.promise()}var d=e("filesystem/FileSystem"),p=e("file/FileUtils");t.addEmbeddedStyleSheet=n,t.addLinkedStyleSheet=r,t.parseLessCode=o,t.getModulePath=a,t.getModuleUrl=s,t.loadFile=l,t.loadStyleSheet=c,t.loadPackageJson=u}),define("utils/ExtensionLoader",["require","exports","module","utils/Global","thirdparty/lodash","filesystem/FileSystem","file/FileUtils","utils/Async","utils/ExtensionUtils","utils/UrlParams"],function(e,t){function n(){return brackets.app.getApplicationSupportDirectory?brackets.app.getApplicationSupportDirectory()+"/extensions/user":null}function r(e){return I[e]}function i(){return S}function o(e){S=e}function a(e){var t=new $.Deferred,n=m.getFileForPath(e.baseUrl+"/requirejs-config.json");return g.readAsText(n).done(function(n){try{var r=JSON.parse(n);h.extend(r.paths,e.paths),h.extend(r,h.omit(e,"paths")),t.resolve(r)}catch(i){t.reject("failed to parse requirejs-config.json")}}).fail(function(){t.resolve(e)}),t.promise()}function s(e,t,n){var r={context:e,baseUrl:t.baseUrl,paths:k,locale:brackets.getLocale()},o=a(r).then(function(t){var r=brackets.libRequire.config(t),i=new $.Deferred;return I[e]=r,r([n],i.resolve,i.reject),i.promise()}).then(function(t){var n;if(w[e]=t,t&&t.initExtension&&"function"==typeof t.initExtension){try{n=v.withTimeout(t.initExtension(),i())}catch(r){return console.error("[Extension] Error -- error thrown during initExtension for "+e+": "+r),(new $.Deferred).reject(r).promise()}if(n)return n.fail(function(t){console.error(t===v.ERROR_TIMEOUT?"[Extension] Error -- timeout during initExtension for "+e:"[Extension] Error -- failed initExtension for "+e+(t?": "+t:""))}),n}},function(e){console.error("[Extension] failed to load "+t.baseUrl+" "+e),"define"===e.requireType&&console.log(e.stack)});return o}function l(e,n,r){var i=new $.Deferred;return y.loadPackageJson(n.baseUrl).always(i.resolve),i.then(function(t){return t&&t.theme?void 0:s(e,n,r)}).then(function(){$(t).triggerHandler("load",n.baseUrl)},function(){$(t).triggerHandler("loadFailed",n.baseUrl)})}function c(e,t,n){var r=new $.Deferred,i=t.baseUrl+"/"+n+".js";return m.resolve(i,function(i,o){if(!i&&o.isFile){var a=brackets.libRequire.config({context:e,baseUrl:t.baseUrl,paths:$.extend({},t.paths,k)});a([n],function(){r.resolve()})}else r.reject()}),r.promise()}function u(e,t,n,r){var i=new $.Deferred;return m.getDirectoryForPath(e).getContents(function(o,a){if(o)console.error("[Extension] Error -- could not read native directory: "+e),i.reject();else{var s,l=[];for(s=0;s<a.length;s++)a[s].isDirectory&&l.push(a[s].name);if(0===l.length)return void i.resolve();v.doInParallel(l,function(e){var i={baseUrl:t.baseUrl+"/"+e,paths:t.paths};return r(e,i,n)}).always(function(){i.resolve()})}}),i.promise()}function d(e){return u(e,{baseUrl:e},"main",l)}function p(e){var t=g.getNativeBracketsDirectoryPath(),n={baseUrl:e};return n.paths={perf:t+"/perf",spec:t+"/spec"},u(e,n,"unittests",c)}function f(e){var t=new _;if(E)return(new $.Deferred).resolve().promise();e||(t.parse(),e="true"===t.get("reloadWithoutUserExts")?["default"]:["default","dev",n()]);var r=n();m.getDirectoryForPath(r).create();var i=r.replace(/\/user$/,"/disabled");m.getDirectoryForPath(i).create();var o=v.doSequentially(e,function(e){var t=e;return-1===e.indexOf("/")&&(t=g.getNativeBracketsDirectoryPath()+"/extensions/"+e),d(t)},!1);return o.always(function(){E=!0}),o}e("utils/Global");var h=e("thirdparty/lodash"),m=e("filesystem/FileSystem"),g=e("file/FileUtils"),v=e("utils/Async"),y=e("utils/ExtensionUtils"),_=e("utils/UrlParams").UrlParams,b=1e4,E=!1,w={},S=b,C=g.getNativeBracketsDirectoryPath(),I={};C=C.replace(/\/test$/,"/src");var k={text:C+"/thirdparty/text/text",i18n:C+"/thirdparty/i18n/i18n"};t._setInitExtensionTimeout=o,t._getInitExtensionTimeout=i,t.init=f,t.getUserExtensionPath=n,t.getRequireContextForExtension=r,t.loadExtension=l,t.testExtension=c,t.loadAllExtensionsInNativeDirectory=d,t.testAllExtensionsInNativeDirectory=p}),define("thirdparty/globmatch",["require","exports","module"],function(e,t,n,r){function i(e,t){var n={dot:!0,noext:!0};return"/"!==e[e.length-1]&&(n.matchBase=!0),t=t.replace(/\*\*/g,"{*,**/**/**}"),c(e,t,n)}function o(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function a(){var e=Object.getOwnPropertyDescriptor(String.prototype,"match"),t=e.value;e.value=function(e){return e instanceof u?e.match(this):t.call(this,e)},Object.defineProperty(String.prototype,e)}function s(e,t){return t=t||{},function(n){return c(n,e,t)}}function l(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function c(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),n.nocomment||"#"!==t.charAt(0)?""===t.trim()?""===e:new u(t,n).match(e):!1}function u(e,t){if(!(this instanceof u))return new u(e,t,b);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"win32"===r&&(e=e.split("\\").join("/"));var n=e+"\n"+w(t),i=c.cache.get(n);return i?i:(c.cache.set(n,this),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,void this.make())}function d(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&console.error(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(D)}),t.debug&&console.error(this.pattern,n),n=n.map(function(e){return e.map(this.parse,this)},this),t.debug&&console.error(this.pattern,n),n=n.filter(function(e){return-1===e.indexOf(!1)}),t.debug&&console.error(this.pattern,n),this.set=n}}function p(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,o=e.length;o>i&&"!"===e.charAt(i);i++)t=!t,r++;r&&(this.pattern=e.substr(r)),this.negate=t}}function f(e,t){function n(){m.push(_),_=""}if(t=t||this.options,e="undefined"==typeof e?this.pattern:e,"undefined"==typeof e)throw new Error("undefined pattern");if(t.nobrace||!e.match(/\{.*\}/))return[e];var r=!1;if("{"!==e.charAt(0)){for(var i=null,o=0,a=e.length;a>o;o++){var s=e.charAt(o);if("\\"===s)r=!r;else if("{"===s&&!r){i=e.substr(0,o);break}}if(null===i)return[e];var l=f(e.substr(o),t);return l.map(function(e){return i+e})}var c=e.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(c){for(var u=f(e.substr(c[0].length),t),d=+c[1],p=+c[2],h=d>p?-1:1,m=[],o=d;o!=p+h;o+=h)for(var g=0,v=u.length;v>g;g++)m.push(o+u[g]);return m}var o=1,y=1,m=[],_="",r=!1;e:for(o=1,a=e.length;a>o;o++){var s=e.charAt(o);if(r)r=!1,_+="\\"+s;else switch(s){case"\\":r=!0;continue;case"{":y++,_+="{";continue;case"}":if(y--,0===y){n(),o++;break e}_+=s;continue;case",":1===y?n():_+=s;continue;default:_+=s;continue}}if(0!==y)return f("\\"+e,t);var u=f(e.substr(o),t),b=1===m.length;m=m.map(function(e){return f(e,t)}),m=m.reduce(function(e,t){return e.concat(t)}),b&&(m=m.map(function(e){return"{"+e+"}"}));for(var E=[],o=0,a=m.length;a>o;o++)for(var g=0,v=u.length;v>g;g++)E.push(m[o]+u[g]);return E}function h(e,t){function n(){if(o){switch(o){case"*":s+=I,l=!0;break;case"?":s+=C,l=!0;break;default:s+="\\"+o}o=!1}}var r=this.options;if(!r.noglobstar&&"**"===e)return E;if(""===e)return"";for(var i,o,a,s="",l=!!r.nocase,c=!1,u=[],d=!1,p=-1,f=-1,h="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=0,g=e.length;g>m&&(a=e.charAt(m));m++)if(r.debug&&console.error("%s %s %s %j",e,m,s,a),c&&T[a])s+="\\"+a,c=!1;else switch(a){case"/":return!1;case"\\":n(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(r.debug&&console.error("%s %s %s %j <-- stateChar",e,m,s,a),d){"!"===a&&m===f+1&&(a="^"),s+=a;continue}n(),o=a,r.noext&&n();continue;case"(":if(d){s+="(";continue}if(!o){s+="\\(";continue}i=o,u.push({type:i,start:m-1,reStart:s.length}),s+="!"===o?"(?:(?!":"(?:",o=!1;continue;case")":if(d||!u.length){s+="\\)";continue}switch(l=!0,s+=")",i=u.pop().type){case"!":s+="[^/]*?)";break;case"?":case"+":case"*":s+=i;case"@":}continue;case"|":if(d||!u.length||c){s+="\\|",c=!1;continue}s+="|";continue;case"[":if(n(),d){s+="\\"+a;continue}d=!0,f=m,p=s.length,s+=a;continue;case"]":if(m===f+1||!d){s+="\\"+a,c=!1;continue}l=!0,d=!1,s+=a;continue;default:n(),c?c=!1:!T[a]||"^"===a&&d||(s+="\\"),s+=a}if(d){var y=e.substr(f+1),_=this.parse(y,M);s=s.substr(0,p)+"\\["+_[0],l=l||_[1]}for(var b;b=u.pop();){var w=s.slice(b.reStart+3);w=w.replace(/((?:\\{2})*)(\\?)\|/g,function(e,t,n){return n||(n="\\"),t+t+n+"|"});var S="*"===b.type?I:"?"===b.type?C:"\\"+b.type;l=!0,s=s.slice(0,b.reStart)+S+"\\("+w}n(),c&&(s+="\\\\");var k=!1;switch(s.charAt(0)){case".":case"[":case"(":k=!0}if(""!==s&&l&&(s="(?=.)"+s),k&&(s=h+s),t===M)return[s,l];if(!l)return v(e);var x=r.nocase?"i":"",D=new RegExp("^"+s+"$",x);return D._glob=e,D._src=s,D}function m(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1;var t=this.options,n=t.noglobstar?I:t.dot?k:x,r=t.nocase?"i":"",i=e.map(function(e){return e.map(function(e){return e===E?n:"string"==typeof e?y(e):e._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{return this.regexp=new RegExp(i,r)}catch(o){return this.regexp=!1}}function g(e,t){if(this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"win32"===r&&(e=e.split("\\").join("/")),e=e.split(D),n.debug&&console.error(this.pattern,"split",e);for(var i=this.set,o=0,a=i.length;a>o;o++){var s=i[o],l=this.matchOne(e,s,t);if(l)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}function v(e){return e.replace(/\\(.)/g,"$1")}function y(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}n.exports=i,c.Minimatch=u;var _=function(){var e={},t=0;this.set=function(n,r){t++,t>=100&&(e={}),e[n]=r},this.get=function(t){return e[t]}},b=c.cache=new _({max:100}),E=c.GLOBSTAR=u.GLOBSTAR={},w=function(e){return JSON.stringify(e)},S={basename:function(e){e=e.split(/[\/\\]/);var t=e.pop();return t||(t=e.pop()),t}},C="[^/]",I=C+"*?",k="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",x="(?:(?!(?:\\/|^)\\.).)*?",T=o("().*{}+?[]^$\\!"),D=/\/+/;c.monkeyPatch=a,c.filter=s,c.defaults=function(e){if(!e||!Object.keys(e).length)return c;var t=c,n=function(n,r,i){return t.minimatch(n,r,l(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,l(e,r))},n},u.defaults=function(e){return e&&Object.keys(e).length?c.defaults(e).Minimatch:u},u.prototype.make=d,u.prototype.parseNegate=p,c.braceExpand=function(e,t){return new u(e,t).braceExpand()},u.prototype.braceExpand=f,u.prototype.parse=h;var M={};c.makeRe=function(e,t){return new u(e,t||{}).makeRe()},u.prototype.makeRe=m,c.match=function(e,t,n){var r=new u(t,n);return e=e.filter(function(e){return r.match(e)}),n.nonull&&!e.length&&e.push(t),e},u.prototype.match=g,u.prototype.matchOne=function(e,t,n){var r=this.options;r.debug&&console.error("matchOne",{"this":this,file:e,pattern:t}),r.matchBase&&1===t.length&&(e=S.basename(e.join("/")).split("/")),r.debug&&console.error("matchOne",e.length,t.length);for(var i=0,o=0,a=e.length,s=t.length;a>i&&s>o;i++,o++){r.debug&&console.error("matchOne loop");var l=t[o],c=e[i];if(r.debug&&console.error(t,l,c),l===!1)return!1;if(l===E){r.debug&&console.error("GLOBSTAR",[t,l,c]);var u=i,d=o+1;if(d===s){for(r.debug&&console.error("** at the end");a>i;i++)if("."===e[i]||".."===e[i]||!r.dot&&"."===e[i].charAt(0))return!1;return!0}e:for(;a>u;){var p=e[u];if(r.debug&&console.error("\nglobstar while",e,u,t,d,p),this.matchOne(e.slice(u),t.slice(d),n))return r.debug&&console.error("globstar found match!",u,a,p),!0;if("."===p||".."===p||!r.dot&&"."===p.charAt(0)){r.debug&&console.error("dot detected!",e,u,t,d);break e}r.debug&&console.error("globstar swallow a segment, and continue"),u++}return n&&u===a?!0:!1}var f;if("string"==typeof l?(f=r.nocase?c.toLowerCase()===l.toLowerCase():c===l,r.debug&&console.error("string match",l,c,f)):(f=c.match(l),r.debug&&console.error("pattern match",l,c,f)),!f)return!1}if(i===a&&o===s)return!0;if(i===a)return n;if(o===s){var h=i===a-1&&""===e[i];return h}throw new Error("wtf?")}}),define("preferences/PreferencesBase",["require","exports","module","file/FileUtils","filesystem/FileSystem","thirdparty/lodash","utils/Async","thirdparty/globmatch"],function(e,t){function n(e){this.data=e||{}}function r(e){this.name="ParsingError",this.message=e||""}function i(e,t){this.path=e,this.createIfNew=t,this._lineEndings=p.getPlatformLineEndings()}function o(e){this.storage=e,$(e).on("changed",this.load.bind(this)),this.data={},this._dirty=!1,this._layers=[],this._layerMap={},this._exclusions=[]}function a(e,t){var n,r=Object.keys(e);if(t)for(n=0;n<r.length;n++){var i=r[n];if(g(t,i))return i}}function s(){this.projectPath=null}function l(e){this.setPrefFilePath(e)}function c(e){h.extend(this,e)}function u(e,t){this.base=e,this.prefix=t,this._listenerInstalled=!1}function d(e){this.contextNormalizer=e,this._knownPrefs={},this._scopes={"default":new o(new n)},this._scopes["default"].load(),this._defaultContext={scopeOrder:["default"],_shadowScopeOrder:[{id:"default",scope:this._scopes["default"],promise:(new $.Deferred).resolve().promise()}]},this._pendingScopes={},this._saveInProgress=null,this._nextSaveDeferred=null,this.finalized=!1,this._pathScopeDefinitions={},this._pathScopeFilenames=[],this._pathScopes={},this._changeEventQueue=null;var t=function(e){var t=this._knownPrefs[e];t&&$(t).trigger(v)}.bind(this);$(this).on(v,function(e,n){n.ids.forEach(t)}.bind(this))}var p=e("file/FileUtils"),f=e("filesystem/FileSystem"),h=e("thirdparty/lodash"),m=e("utils/Async"),g=e("thirdparty/globmatch"),v="change",y="scopeOrderChange";n.prototype={load:function(){var e=new $.Deferred;return e.resolve(this.data),e.promise()},save:function(e){var t=new $.Deferred;return this.data=e,t.resolve(),t.promise()},fileChanged:function(){}},r.prototype=new Error,i.prototype={load:function(){var e=new $.Deferred,t=this.path,n=this.createIfNew,i=this;if(t){var o=f.getFileForPath(t);o.read({},function(o,a){if(o)return void(n?e.resolve({}):e.reject(new Error("Unable to load prefs at "+t+" "+o)));if(i._lineEndings=p.sniffLineEndings(a),/^\s*$/.test(a))e.resolve({});else try{e.resolve(JSON.parse(a))}catch(s){e.reject(new r("Invalid JSON settings at "+t+"("+s.toString()+")"))}})}else e.resolve({});return e.promise()},save:function(e){var t=new $.Deferred,n=this.path,r=f.getFileForPath(n);if(n)try{var i=JSON.stringify(e,null,4);i=p.translateLineEndings(i,this._lineEndings),r.write(i,{},function(e){e?t.reject("Unable to save prefs at "+n+" "+e):t.resolve()})}catch(o){t.reject("Unable to convert prefs to JSON"+o.toString())}else t.resolve();return t.promise()},setPath:function(e){this.path=e,$(this).trigger("changed")},fileChanged:function(e){e===this.path&&$(this).trigger("changed")}},h.extend(o.prototype,{load:function(){var e=new $.Deferred;return this.storage.load().then(function(t){var n=this.getKeys();this.data=t,e.resolve(),$(this).trigger(v,{ids:h.union(this.getKeys(),n)})}.bind(this)).fail(function(t){e.reject(t)}),e.promise()},save:function(){var e=this;return this._dirty?(e._dirty=!1,this.storage.save(this.data)):(new $.Deferred).resolve().promise()},set:function(e,t,n,r){if(r||(r=this.getPreferenceLocation(e,n)),r&&r.layer){var i=this._layerMap[r.layer];if(i){void 0===this.data[i.key]&&(this.data[i.key]={});var o=i.set(this.data[i.key],e,t,n,r.layerID);return this._dirty=this._dirty||o,o}return!1}return this._performSet(e,t)},_performSet:function(e,t){return h.isEqual(this.data[e],t)?!1:(this._dirty=!0,void 0===t?delete this.data[e]:this.data[e]=h.cloneDeep(t),!0)},get:function(e,t){var n,r,i,o=this._layers,a=this.data;for(t=t||{},n=0;n<o.length;n++)if(r=o[n],i=r.get(a[r.key],e,t),void 0!==i)return i;return-1===this._exclusions.indexOf(e)?a[e]:void 0},getPreferenceLocation:function(e,t){var n,r,i,o=this._layers,a=this.data;for(t=t||{},n=0;n<o.length;n++)if(r=o[n],i=r.getPreferenceLocation(a[r.key],e,t),void 0!==i)return{layer:r.key,layerID:i};return-1===this._exclusions.indexOf(e)&&void 0!==a[e]?{}:void 0},getKeys:function(e){e=e||{};var t,n,r=this._layers,i=this.data,o=[h.difference(h.keys(i),this._exclusions)];for(t=0;t<r.length;t++)n=r[t],o.push(n.getKeys(i[n.key],e));return h.union.apply(null,o)},addLayer:function(e){this._layers.push(e),this._layerMap[e.key]=e,this._exclusions.push(e.key),$(this).trigger(v,{ids:e.getKeys(this.data[e.key],{})})},fileChanged:function(e){this.storage.fileChanged(e)},defaultFilenameChanged:function(e,t){var n=[],r=this.data;return h.each(this._layers,function(i){if(i.defaultFilenameChanged&&r[i.key]){var o=i.defaultFilenameChanged(r[i.key],e,t);o&&n.push(o)}}),h.union.apply(null,n)}}),s.prototype={key:"project",get:function(e,t){return e&&this.projectPath&&e[this.projectPath]&&e[this.projectPath][t]?e[this.projectPath][t]:void 0},getPreferenceLocation:function(e,t){return e&&this.projectPath&&e[this.projectPath]&&e[this.projectPath][t]?this.projectPath:void 0},set:function(e,t,n,r,i){if(i||(i=this.getPreferenceLocation(e,t)),!i)return!1;var o=e[i];return o||(e[i]=o={}),h.isEqual(o[t],n)?!1:(void 0===n?delete o[t]:o[t]=h.cloneDeep(n),!0)},getKeys:function(e){return e?h.union.apply(null,h.map(h.values(e),h.keys)):void 0},setProjectPath:function(e){this.projectPath=e}},l.prototype={key:"path",get:function(e,t,n){var r=this.getPreferenceLocation(e,t,n);if(r)return e[r][t]},getPreferenceLocation:function(e,t,n){if(e){var r=p.getRelativeFilename(this.prefFilePath,n.filename);if(r)return a(e,r)}},set:function(e,t,n,r,i){if(i||(i=this.getPreferenceLocation(e,t,r)),!i)return!1;var o=e[i];return o||(e[i]=o={}),h.isEqual(o[t],n)?!1:(void 0===n?delete o[t]:o[t]=h.cloneDeep(n),!0)},getKeys:function(e,t){if(e){var n=p.getRelativeFilename(this.prefFilePath,t.filename);if(n){var r=a(e,n);return r?h.keys(e[r]):[]}return h.union.apply(null,h.map(h.values(e),h.keys))}},setPrefFilePath:function(e){this.prefFilePath=e?p.getDirectoryPath(e):"/"},defaultFilenameChanged:function(e,t,n){var r=a(e,p.getRelativeFilename(this.prefFilePath,t)),i=a(e,p.getRelativeFilename(this.prefFilePath,n));if(r!==i)return void 0===r?h.keys(e[i]):void 0===i?h.keys(e[r]):h.union(h.keys(e[i]),h.keys(e[r]))}},h.extend(c.prototype,{on:function(e,t){$(this).on(e,t)},off:function(e,t){$(this).off(e,t)}}),u.prototype={definePreference:function(e,t,n,r){return this.base.definePreference(this.prefix+e,t,n,r)},getPreference:function(e){return this.base.getPreference(this.prefix+e)},get:function(e,t){return this.base.get(this.prefix+e,t)},getPreferenceLocation:function(e,t){return this.base.getPreferenceLocation(this.prefix+e,t)},set:function(e,t,n,r){return this.base.set(this.prefix+e,t,n,r)},_installListener:function(){if(!this._listenerInstalled){var e=$(this),t=this.prefix,n=function(e){return e.substr(0,t.length)===t?!0:!1},r=function(e){return e.substr(t.length)};$(this.base).on(v,function(t,i){var o=i.ids.filter(n);o.length>0&&e.trigger(v,{ids:o.map(r)})}),this._listenerInstalled=!0}},on:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t){var r=this.getPreference(t);r.on(e,n)}else this._installListener(),$(this).on(e,n)},off:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t){var r=this.getPreference(t);r.off(e,n)}else $(this).off(e,n)},save:function(){return this.base.save()}},h.extend(d.prototype,{definePreference:function(e,t,n,r){if(r=r||{},this._knownPrefs.hasOwnProperty(e))throw new Error("Preference "+e+" was redefined");var i=this._knownPrefs[e]=new c({type:t,initial:n,name:r.name,description:r.description,validator:r.validator});return this.set(e,n,{location:{scope:"default"}}),i},getPreference:function(e){return this._knownPrefs[e]},_pushToScopeOrder:function(e,t){var n=this._defaultContext.scopeOrder,r=h.findIndex(n,function(e){return e===t});if(!(r>-1))throw new Error("Internal error: scope "+t+" should be in the scope order");n.splice(r,0,e)},_tryAddToScopeOrder:function(e){for(var t=this._defaultContext._shadowScopeOrder,n=h.findIndex(t,function(t){return t===e}),r=$(this),i=n+1;i<t.length&&"pending"!==t[i].promise.state()&&"resolved"!==t[i].promise.state();)i++;switch(t[i].promise.state()){case"pending":t[i].promise.always(function(){this._tryAddToScopeOrder(e)}.bind(this));break;case"resolved":this._pushToScopeOrder(e.id,t[i].id),r.trigger(y,{id:e.id,action:"added"}),this._triggerChange({ids:e.scope.getKeys()});break;default:throw new Error('Internal error: no scope found to add before. "default" is missing?..')}},_addToScopeOrder:function(e,t,n,r){var i,o,a=this._defaultContext._shadowScopeOrder,s=!1,l=this;if($(t).on(v+".prefsys",function(e,t){l._triggerChange(t)}.bind(this)),o=h.findIndex(a,function(t){return t.id===e}),o>-1)i=a[o];else if(i={id:e,promise:n,scope:t},r)if(o=h.findIndex(a,function(e){return e.id===r}),o>-1)a.splice(o,0,i);else{var c=this._pendingScopes[r];c||(c=[],this._pendingScopes[r]=c),c.unshift(i),s=!0}else a.unshift(i);if(!s&&(n.then(function(){this._scopes[e]=t,this._tryAddToScopeOrder(i)}.bind(this)).fail(function(){h.pull(a,i)}.bind(this)),this._pendingScopes[e])){var u=this._pendingScopes[e];delete this._pendingScopes[e],u.forEach(function(t){this._addToScopeOrder(t.id,t.scope,t.promise,e)}.bind(this))}},addToScopeOrder:function(e,t){var n,r=this._defaultContext._shadowScopeOrder,i=h.findIndex(r,function(t){return t.id===e});i>-1&&(n=r[i],this._addToScopeOrder(n.id,n.scope,n.promise,t))},removeFromScopeOrder:function(e){var t=this._scopes[e];if(t){h.pull(this._defaultContext.scopeOrder,e);var n=$(this);$(t).off(".prefsys"),n.trigger(y,{id:e,action:"removed"}),this._triggerChange({ids:t.getKeys()})}},_getContext:function(e){return e?(this.contextNormalizer&&(e=this.contextNormalizer(e)),e):this._defaultContext},addScope:function(e,t,n){var i;if(n=n||{},this._scopes[e])throw new Error("Attempt to redefine preferences scope: "+e);return t.get||(t=new o(t)),i=t.load(),this._addToScopeOrder(e,t,i,n.before),i.fail(function(e){e instanceof r&&console.error(e)}),i},removeScope:function(e){var t,n=this._scopes[e];n&&(this.removeFromScopeOrder(e),t=h.findIndex(this._defaultContext._shadowScopeOrder,function(t){return t.id===e}),this._defaultContext._shadowScopeOrder.splice(t,1),delete this._scopes[e])},_getScopeOrder:function(e){return e.scopeOrder||this._defaultContext.scopeOrder},get:function(e,t){var n;t=this._getContext(t);var r=this._getScopeOrder(t);for(n=0;n<r.length;n++){var i=this._scopes[r[n]];if(i){var o=i.get(e,t);if(void 0!==o){var a=this.getPreference(e),s=a&&a.validator;if(!s||s(o))return h.cloneDeep(o)}}}},getPreferenceLocation:function(e,t){var n,r;t=this._getContext(t);var i=this._getScopeOrder(t);for(n=0;n<i.length;n++){r=i[n];var o=this._scopes[r];if(o){var a=o.getPreferenceLocation(e,t);if(void 0!==a)return a.scope=r,a}}},set:function(e,t,n,r){n=n||{};var i=this._getContext(n.context),o=n.location&&"default"===n.location.scope?!0:!1,a=n.location||this.getPreferenceLocation(e,i);if(!a||"default"===a.scope&&!o){var s=this._getScopeOrder(i);if(!(s.length>1))return{valid:!0,stored:!1};a={scope:s[s.length-2]}}var l=this._scopes[a.scope];if(!l)return{valid:!0,stored:!1};var c=this.getPreference(e),u=c&&c.validator;if(u&&!u(t))return{valid:!1,stored:!1};var d=l.set(e,t,i,a);return d&&(r||this.save(),this._triggerChange({ids:[e]})),{valid:!0,stored:d}},save:function(){if(this.finalized)return console.log("PreferencesSystem.save() called after finalized!"),(new $.Deferred).reject().promise();if(this._saveInProgress)return this._nextSaveDeferred||(this._nextSaveDeferred=new $.Deferred),this._nextSaveDeferred.promise();var e=this._nextSaveDeferred||new $.Deferred;return this._saveInProgress=e,this._nextSaveDeferred=null,m.doInParallel(h.values(this._scopes),function(e){return e?e.save():(new $.Deferred).resolve().promise()}.bind(this)).then(function(){this._saveInProgress=null,this._nextSaveDeferred&&this.save(),e.resolve()}.bind(this)).fail(function(t){e.reject(t)}),e.promise()},setDefaultFilename:function(e){var t=this._defaultContext.filename;if(t!==e){var n=[];h.each(this._scopes,function(r){var i=r.defaultFilenameChanged(e,t);i&&n.push(i)}),this._defaultContext.filename=e,n=h.union.apply(null,n),n.length>0&&this._triggerChange({ids:n})}},buildContext:function(e){return h.defaults(e,this._defaultContext)},on:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t){var r=this.getPreference(t);r.on(e,n)}else $(this).on(e,n)},off:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t){var r=this.getPreference(t);r.off(e,n)}else $(this).off(e,n)},_triggerChange:function(e){this._changeEventQueue?this._changeEventQueue=h.union(this._changeEventQueue,e.ids):$(this).trigger(v,e)},pauseChangeEvents:function(){this._changeEventQueue||(this._changeEventQueue=[])},resumeChangeEvents:function(){this._changeEventQueue&&($(this).trigger(v,{ids:this._changeEventQueue}),this._changeEventQueue=null)},fileChanged:function(e){h.forEach(this._scopes,function(t){t.fileChanged(e)})},getPrefixedSystem:function(e){return new u(this,e+".")},_finalize:function(){function e(){n._saveInProgress?n._saveInProgress.done(e):(n.finalized=!0,t.resolve())}var t=new $.Deferred,n=this;return e(),t.promise()}}),t.PreferencesSystem=d,t.Scope=o,t.MemoryStorage=n,t.PathLayer=l,t.ProjectLayer=s,t.FileStorage=i}),define("preferences/PreferencesImpl",["require","exports","module","./PreferencesBase","utils/Async"],function(e,t){function n(){return u}function r(e){var t=brackets.app.getApplicationSupportDirectory()+"/";0===t.indexOf(e.fullPath)&&(p.fileChanged(l),v.fileChanged(y))}var i=e("./PreferencesBase"),o=e("utils/Async"),a="brackets.json",s="state.json",l=brackets.app.getApplicationSupportDirectory()+"/"+a,c=new $.Deferred,u=!1,d=[],p=new i.PreferencesSystem;p.pauseChangeEvents();var f=new i.FileStorage(void 0,!0),h=new i.Scope(f),m=new i.PathLayer;h.addLayer(m);var g=p.addScope("user",new i.FileStorage(l,!0));d.push(g),g.fail(function(e){d.push(p.addScope("user",new i.MemoryStorage,{before:"default"})),e.name&&"ParsingError"===e.name&&(u=!0)}).always(function(){d.push(p.addScope("project",h,{before:"user"})),d.push(p.addScope("session",new i.MemoryStorage)),o.waitForAll(d).always(function(){c.resolve()})});var v=new i.PreferencesSystem,y=brackets.app.getApplicationSupportDirectory()+"/"+s,_=new i.Scope(new i.FileStorage(y,!0)),b=new i.ProjectLayer;_.addLayer(b);var E=v.addScope("user",_);t.manager=p,t.projectStorage=f,t.projectPathLayer=m,t.userScopeLoading=g,t.stateManager=v,t.stateProjectLayer=b,t.smUserScopeLoading=E,t.userPrefFile=l,t.isUserScopeCorrupt=n,t.managerReady=c.promise(),t.reloadUserPrefs=r,t.STATE_FILENAME=s,t.SETTINGS_FILENAME=a}),define("preferences/PreferencesManager",["require","exports","module","preferences/PreferenceStorage","utils/AppInit","utils/Async","command/Commands","command/CommandManager","utils/DeprecationWarning","file/FileUtils","utils/ExtensionLoader","preferences/PreferencesBase","filesystem/FileSystem","strings","preferences/PreferencesImpl","thirdparty/lodash"],function(e,t){function n(){if(!k){var e=R.getNativeBracketsDirectoryPath();k=[e+"/extensions/default/",e+"/extensions/dev/",A.getUserExtensionPath()+"/"]}return k}function r(e){var n,r,i=t._getExtensionPaths();return i.some(function(t){return 0===e.uri.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())?(n=t,!0):void 0}),r=n?V+e.uri.replace(n,""):V+e.id}function i(e,t,n){if(!n){var i="object"==typeof e?e.uri:e;L.deprecationWarning("getPreferenceStorage is called with client ID '"+i+",' use PreferencesManager.definePreference instead.")}if(!e||"object"==typeof e&&(!e.id||!e.uri))return void console.error("Invalid clientID");"object"==typeof e&&(e=r(e));var o=C[e];if(void 0===o){if(n)return;o=t&&JSON.stringify(t)?t:{},C[e]=o}else t&&U.forEach(t,function(e,t){void 0===o[t]&&(o[t]=e)});return new x(e,o)}function o(){I.setItem(S,JSON.stringify(C))}function a(){C={},I.setItem(S,JSON.stringify(C))}function s(e){I=e,B&&(C=JSON.parse(I.getItem(S))),C||a()}function l(e){return e=e||H,e&&q?void 0!==R.getRelativeFilename(q,e):!1}function c(){return $.userPrefFile}function u(){l()!==z&&(z?$.manager.removeFromScopeOrder("project"):$.manager.addToScopeOrder("project","user"),z=!z)}function d(e){q=R.getDirectoryPath(e),u(),$.projectPathLayer.setPrefFilePath(e),$.projectStorage.setPath(e)}function p(e){H=e,u(),$.manager.setDefaultFilename(e)}function f(e){return $.manager.getPrefixedSystem(e)}function h(e,t,n,a){$.smUserScopeLoading.done(function(){$.userScopeLoading.done(function(){if(!e||"object"==typeof e&&(!e.id||!e.uri))return void console.error("Invalid clientID");var s=i(e,null,!0);if(s){var l="object"==typeof e?r(e):e;void 0===C.convertedKeysMap&&(C.convertedKeysMap={});var c=C.convertedKeysMap;s.convert(t,c[l],n,a).done(function(e,t){C.convertedKeysMap[l]=t,o()})}}).fail(function(t){console.error("Error while converting ","object"==typeof e?r(e):e),console.error(t)})})}function m(e,t){var n=e.indexOf("project")>-1;if(n===t)return e;var r;if(t){var i=e.indexOf("user");-1===i&&(i=e.length-2),r=U.first(e,i),r.push("project"),r.push.apply(r,U.rest(e,i))}else r=U.without(e,"project");return r}function g(e){return"string"==typeof e&&(e={filename:e},e.scopeOrder=l(e.filename)?K:X),e}function v(){var e=$.manager.buildContext({});delete e.filename,K=m(e.scopeOrder,!0),X=m(e.scopeOrder,!1),G.scopeOrder=K}function y(){var e=c(),t=P.getFileForPath(e);t.exists(function(n,r){r?O.execute(M.FILE_OPEN,{fullPath:e}):R.writeText(t,"",!0).done(function(){O.execute(M.FILE_OPEN,{fullPath:e})})})}function _(e,n,r){L.deprecationWarning("setValueAndSave called for "+e+". Use set instead.");var i=t.set(e,n,r).stored;return $.manager.save(),i}function b(e,t){return $.stateManager.get(e,t)}function E(e,t,n,r){$.stateManager.set(e,t,n),r||$.stateManager.save()}function w(){var e=[$.managerReady,$.smUserScopeLoading,$.manager._finalize(),$.stateManager._finalize()],t=function(e){return e};return D.doSequentially(e,t,!1)}var S,C,I,k,x=e("preferences/PreferenceStorage").PreferenceStorage,T=e("utils/AppInit"),D=e("utils/Async"),M=e("command/Commands"),O=e("command/CommandManager"),L=e("utils/DeprecationWarning"),R=e("file/FileUtils"),A=e("utils/ExtensionLoader"),N=e("preferences/PreferencesBase"),P=e("filesystem/FileSystem"),F=e("strings"),$=e("preferences/PreferencesImpl"),U=e("thirdparty/lodash"),j="com.adobe.brackets.preferences",V="com.adobe.brackets.",B=!1;S=localStorage.getItem("preferencesKey"),S?B=!!localStorage.getItem("doLoadPreferences"):(S=j,B=!0),s(localStorage),t.getPreferenceStorage=i,t.savePreferences=o,t.getClientID=r,t._reset=a,t._getExtensionPaths=n;var W,H=null,q=null,z=!0,G={},K=null,X=null;$.manager.contextNormalizer=g,v(),$.manager.on("scopeOrderChange",v),O.register(F.CMD_OPEN_PREFERENCES,M.FILE_OPEN_PREFERENCES,y),T.appReady(function(){$.manager.resumeChangeEvents()}),t._isUserScopeCorrupt=$.isUserScopeCorrupt,t._manager=$.manager,t._setCurrentEditingFile=p,t._setProjectSettingsFile=d,t._smUserScopeLoading=$.smUserScopeLoading,t._stateProjectLayer=$.stateProjectLayer,t._reloadUserPrefs=$.reloadUserPrefs,t.CURRENT_FILE=W,t.CURRENT_PROJECT=G,t.ready=$.managerReady,t.getUserPrefFile=c,t.get=$.manager.get.bind($.manager),t.set=$.manager.set.bind($.manager),t.save=$.manager.save.bind($.manager),t.on=$.manager.on.bind($.manager),t.off=$.manager.off.bind($.manager),t.getPreference=$.manager.getPreference.bind($.manager),t.getExtensionPrefs=f,t.setValueAndSave=_,t.getViewState=b,t.setViewState=E,t.finalize=w,t.addScope=$.manager.addScope.bind($.manager),t.stateManager=$.stateManager,t.FileStorage=N.FileStorage,t.SETTINGS_FILENAME=$.SETTINGS_FILENAME,t.definePreference=$.manager.definePreference.bind($.manager),t.fileChanged=$.manager.fileChanged.bind($.manager),t.convertPreferences=h
15}),define("utils/Resizer",["require","exports","module","utils/AppInit","preferences/PreferencesManager"],function(e,t,n){function r(e){var t=$(e).data("show");t&&t.apply(e)}function i(e){var t=$(e).data("hide");t&&t.apply(e)}function o(e){$(e).is(":visible")?i(e):r(e)}function a(e){var t=$(e).data("removeSizable");t&&t.apply(e)}function s(e){var t=$(e).data("resyncSizer");t&&t.apply(e)}function l(e){return $(e).is(":visible")}function c(e,n,r,a,s,l,c,u){function d(e){void 0!==l&&$(l,C).css("left",e)}function p(e,t){R.apply(S,[e]),I.length&&N.apply(I,[t])}function _(e){var t=e||1;(r===v||r===m)&&w.css(A,t)}var w=$('<div class="'+n+'-resizer"></div>'),S=$(e),C=S.parent(),I=$(S.find(".resizable-content:first")[0]),k=$(window.document.body),x=S.attr("id"),T=b.getViewState(x)||{},D=null,M=n===f?"clientX":"clientY",O=r===h||r===g?1:-1,L=n===f?C.innerWidth:C.innerHeight,R=function(e){if(e){if(u){var t,r,i=L.apply(C);return r=n===f?"width":"height",t=e/i,this.css(r,100*t+"%"),this}return n===f?this.width(e):this.height(e)}return n===f?this.width():this.height()},A=n===f?"left":"top",N=n===f?I.width:I.height;return x?(void 0===a&&(a=y),s=s||!1,S.prepend(w),S.css("box-sizing","border-box"),C[0]&&C.is(".content")&&!c&&(console.warn("Deprecated: resizable panels should be created via WorkspaceManager.createBottomPanel(). Using Resizer directly will stop working in the future. \nElement:",e),$(t).triggerHandler("deprecatedPanelAdded",[S])),S.data("removeSizable",function(){w.off(".resizer"),S.removeData("show"),S.removeData("hide"),S.removeData("resyncSizer"),S.removeData("removeSizable"),w.remove()}),S.data("resyncSizer",function(){_(R.apply(S))}),S.data("show",function(){var e=S.offset(),t=R.apply(S)||T.size,n=N.apply(I)||T.contentSize;p(t,n),S.show(),T.visible=!0,s&&(S.prepend(w),r===h?w.css(A,""):r===v&&w.css(A,e[A]+t)),d(t),S.trigger("panelExpanded",[t]),b.setViewState(x,T,null,E)}),S.data("hide",function(){var e=S.offset(),t=R.apply(S),n=R.apply(w);S.hide(),T.visible=!1,s&&(w.insertBefore(S),r===v?w.css(A,""):r===h&&w.css(A,e[A]+t-n)),d(0),S.trigger("panelCollapsed",[t]),b.setViewState(x,T,null,E)}),w.on("mousedown.resizer",function(e){function t(){E&&(h!==m&&(m=h,S.is(":visible")?10>h?(o(S),R.apply(S,[0])):(v||(v=!0,S.trigger("panelResizeStart",h)),p(h,h-g),d(h),S.trigger("panelResizeUpdate",[h])):h>10&&(R.apply(S,[h]),o(S),v||(v=!0,S.trigger("panelResizeStart",h)))),D=window.requestAnimationFrame(t))}function r(e){h=Math.max(u+O*(c-e[M]),a);var n=S.data("maxsize");void 0!==n&&(h=Math.min(h,n)),e.preventDefault(),null===D&&(D=window.requestAnimationFrame(t))}function i(){if(E){var e=R.apply(S);S.is(":visible")&&(T.size=e,I.length&&(T.contentSize=N.apply(I)),b.setViewState(x,T),_(e)),E=!1,v&&S.trigger("panelResizeEnd",[e]),window.setTimeout(function(){$(window.document).off("mousemove",r),l.off("mousedown"),l.remove(),D=null},300)}}var l=$("<div class='resizing-container "+n+"-resizing' />"),c=e[M],u=S.is(":visible")?R.apply(S):0,h=u,m=u,g=0,v=!1;E=!0,k.append(l),I.length&&S.children().not(".horz-resizer, .vert-resizer, .resizable-content").each(function(e,t){g+=n===f?$(t).outerWidth():$(t).outerHeight()}),$(window.document).on("mousemove",r),s&&l.on("mousedown",function(){$(window.document).off("mousemove",r),l.off("mousedown"),l.remove(),D=null,o(S)}),$(window.document).one("mouseup",i),e.preventDefault()}),void(T&&(void 0!==T.size&&R.apply(S,[T.size]),void 0!==T.contentSize&&N.apply(I,[T.contentSize]),void 0===T.visible||T.visible?(d(R.apply(S)),_(R.apply(S))):i(S)))):void console.error("Resizable panels must have a DOM id to use as a preferences key:",e)}function u(e){return e?"user":null}var d,p="vert",f="horz",h="top",m="bottom",g="left",v="right",y=100,_=e("utils/AppInit"),b=e("preferences/PreferencesManager"),E=!1;_.htmlReady(function(){var e=y;d=$(".main-view"),$(".vert-resizable").each(function(t,n){void 0!==$(n).data().minsize&&(e=$(n).data().minsize),$(n).hasClass("top-resizer")&&c(n,p,h,e,$(n).hasClass("collapsible"))}),$(".horz-resizable").each(function(t,n){void 0!==$(n).data().minsize&&(e=$(n).data().minsize),$(n).hasClass("right-resizer")&&c(n,f,v,e,$(n).hasClass("collapsible"),$(n).data().forceleft)})}),b.convertPreferences(n,{panelState:"user"},!0,u),t.makeResizable=c,t.removeSizable=a,t.resyncSizer=s,t.toggle=o,t.show=r,t.hide=i,t.isVisible=l,t.DIRECTION_VERTICAL=p,t.DIRECTION_HORIZONTAL=f,t.POSITION_TOP=h,t.POSITION_RIGHT=v,t.POSITION_BOTTOM=m,t.POSITION_LEFT=g}),define("view/WorkspaceManager",["require","exports","module","utils/AppInit","utils/Resizer"],function(e,t){function n(){var e=d.height();return p.siblings().each(function(t,n){var r=$(n);"none"!==r.css("display")&&"absolute"!==r.css("position")&&(e-=r.outerHeight())}),Math.max(e,0)}function r(){var e=p.height();p.siblings().each(function(t,n){var r=$(n);"none"===r.css("display")?r.data("maxsize",e):r.data("maxsize",e+r.outerHeight())})}function i(e){var r=n();p.height(r),$(t).trigger("workspaceUpdateLayout",[r,e])}function o(){d&&p&&(i(),m||(m=!0,$(window.document).one("mousemove",function(){m=!1,r()})))}function a(e){e.on("panelCollapsed panelExpanded panelResizeUpdate",function(){i()}),e.on("panelCollapsed panelExpanded panelResizeEnd",function(){r()})}function s(e,t){this.$panel=e,h.makeResizable(e[0],h.DIRECTION_VERTICAL,h.POSITION_TOP,t,!1,void 0,!0),a(e)}function l(e,t,n){return t.insertBefore("#status-bar"),t.hide(),r(),new s(t,n)}function c(e){i(e),r()}function u(e,t){d=e,p=t}var d,p,f=e("utils/AppInit"),h=e("utils/Resizer"),m=!1;s.prototype.$panel=null,s.prototype.isVisible=function(){return this.$panel.is(":visible")},s.prototype.show=function(){h.show(this.$panel[0])},s.prototype.hide=function(){h.hide(this.$panel[0])},s.prototype.setVisible=function(e){e?h.show(this.$panel[0]):h.hide(this.$panel[0])},f.htmlReady(function(){d=$(".content"),p=$("#editor-holder"),a($("#sidebar"))}),$(h).on("deprecatedPanelAdded",function(e,t){a(t)}),window.addEventListener("resize",o,!0),t.createBottomPanel=l,t.recomputeLayout=c,t._setMockDOM=u}),define("view/MainViewFactory",["require","exports","module","thirdparty/lodash"],function(e,t){function n(e){o.push(e)}function r(e){return i.find(o,function(t){return t.canOpenFile(e)})}var i=e("thirdparty/lodash"),o=[];t.registerViewFactory=n,t.findSuitableFactoryForPath=r}),define("view/ViewStateManager",["require","exports","module","thirdparty/lodash"],function(e,t){function n(){l={}}function r(e,t){l[e.fullPath]=t}function i(e){e.getViewState&&r(e.getFile(),e.getViewState())}function o(e){return l[e.fullPath]}function a(e){l=s.extend(l,e)}var s=e("thirdparty/lodash"),l={};t.reset=n,t.updateViewState=i,t.getViewState=o,t.addViewStates=a}),define("utils/ViewUtils",["require","exports","module","thirdparty/lodash","file/FileUtils"],function(e,t){function n(e,t,n,r,i){var o=0,a=t.get(0),s=a.scrollTop,l=Math.min(s-g,0),c=e.width();if(n&&(n.css("background-position","0px "+l+"px"),i&&(o=e.offset().top,n.css("top",o)),i&&n.css("width",c)),r){var u=a.clientHeight,d=e.outerHeight(),p=a.scrollHeight,f=g;p>u&&(f-=Math.min(g,p-(s+u))),r.css("background-position","0px "+f+"px"),r.css("top",o+d-g),r.css("width",c)}}function r(e,t,n){var r=e.find(".scroller-shadow."+t);return 0===r.length&&(r=$(window.document.createElement("div")).addClass("scroller-shadow "+t),e.append(r)),n||(r.css("position","absolute"),r.css(t,"0")),r}function i(e,t,i){var o=!1;t||(t=e,o=!0);var a=$(e),s=$(t),l=r(a,"top",o),c=i?r(a,"bottom",o):null,u=function(){n(a,s,l,c,o)};s.off("scroll.scroller-shadow"),a.off("contentChanged.scroller-shadow"),s.on("scroll.scroller-shadow",u),a.on("contentChanged.scroller-shadow",u),u()}function o(e,t){t||(t=e);var n=$(e),r=$(t);n.find(".scroller-shadow.top").remove(),n.find(".scroller-shadow.bottom").remove(),r.off("scroll.scroller-shadow"),n.off("contentChanged.scroller-shadow")}function a(e,t,n){n?e.addClass(t):e.removeClass(t)}function s(e,t,n){var r,i,o=e.find("ul"),s=$("#sidebar"),l=!0;r=$(window.document.createElement("div")).addClass("sidebar-selection"),e.prepend(r),e.css("overflow","auto"),e.css("position","relative"),i=$(window.document.createElement("div")).addClass("sidebar-selection-extension"),e.append(i),t="."+(t||"selected");var c=function(){var t=r.height(),n=r.offset(),o=e.offset(),c=i.outerHeight(),u=o.top,d=u+e.outerHeight(),p=n.top;i.css("top",p),i.css("left",s.width()-i.outerWidth()),a(i,"selectionExtension-visible",l);var f=Math.floor((t-c)/2),h=p+c+f;u>p||h>d?i.css("clip","rect("+Math.max(u-p-f,0)+"px, auto, "+(c-Math.max(h-d,0))+"px, auto)"):i.css("clip","")},u=function(){i.addClass("forced-hidden"),r.addClass("forced-hidden")},d=function(a,s){var u=o.find(t).closest("li");if(n&&(l=u.hasClass(n)),i.removeClass("forced-hidden"),r.removeClass("forced-hidden"),i.hide(),r.hide(),1===u.length){var d=u.offset().top-e.offset().top+e.get(0).scrollTop;r.width(e.get(0).scrollWidth),r.css("top",d),r.show(),c(),i.show();var p=e.get(0),f=p.clientHeight,h=r.height(),m=d+h,g=p.scrollTop+f;s&&(d>=g?u.get(0).scrollIntoView(!1):m<=p.scrollTop&&u.get(0).scrollIntoView(!0))}};o.on("selectionChanged",d),e.on("scroll",c),e.on("selectionRedraw",c),e.on("selectionHide",u),d(),v.push(c)}function l(){v.forEach(function(e){e.apply()})}function c(e,t){var n,r={top:0,right:0,bottom:0,left:0},i=e.offset()||{top:0,left:0};return n=t.top+t.height-(i.top+e.height()),n>0&&(r.bottom=n),n=i.top-t.top,n>0&&(r.top=n),n=i.left-t.left,n>0&&(r.left=n),n=t.left+t.width-(i.left+e.width()),n>0&&(r.right=n),r}function u(e,t,n){var r=t.offset(),i={top:r.top,left:r.left,height:t.height(),width:t.width()},o=c(e,i);o.bottom>0?e.scrollTop(e.scrollTop()+o.bottom):o.top>0&&e.scrollTop(e.scrollTop()-o.top),n&&(o.left>0?e.scrollLeft(e.scrollLeft()-o.left):o.right>0&&e.scrollLeft(e.scrollLeft()+o.right))}function d(e){var t=e.name,n=m.getSmartFileExtension(t),r=t.lastIndexOf("."+n);return t=r>0?h.escape(t.substring(0,r))+"<span class='extension'>"+h.escape(t.substring(r))+"</span>":h.escape(t)}function p(e){if(e.length<=1)return[];var t={},n=[],r=[];e.forEach(function(e,i){var o=e.fullPath.split("/");o.pop(),r[i]=o.pop(),n[i]=o,t[r[i]]?t[r[i]].push(i):t[r[i]]=[i]});var i,o=function(e){var t=!1;return h.forEach(e,function(i,o){i.length>1&&i.forEach(function(i){0!==n[i].length&&(r[i]=n[i].pop()+"/"+r[i],t=!0,e[r[i]]?e[r[i]].push(i):e[r[i]]=[i])}),delete e[o]}),t};do i=o(t);while(i);return r}function f(e,t,n){if(1!==Math.abs(n))return console.error("traverseViewArray called with unsupported direction: "+n.toString()),null;if(-1===t){if(e.length>0)return e[0]}else if(e.length>1)return t+=n,t>=e.length?t=0:0>t&&(t=e.length-1),e[t];return null}var h=e("thirdparty/lodash"),m=e("file/FileUtils"),g=5,v=[];$(window).resize(l),t.SCROLL_SHADOW_HEIGHT=g,t.addScrollerShadow=i,t.removeScrollerShadow=o,t.sidebarList=s,t.scrollElementIntoView=u,t.getElementClipSize=c,t.getFileEntryDisplay=d,t.toggleClass=a,t.getDirNamesForDuplicateFiles=p,t.traverseViewArray=f}),define("document/InMemoryFile",["require","exports","module","filesystem/File","filesystem/FileSystemError"],function(e,t,n){function r(e,t){i.call(this,e,t)}var i=e("filesystem/File"),o=e("filesystem/FileSystemError");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype.parentClass=i.prototype,r.prototype.read=function(e,t){"function"==typeof e&&(t=e),t(o.NOT_FOUND)},r.prototype.write=function(e,t,n){"function"==typeof t&&(n=t),n(o.NOT_FOUND)},r.prototype.exists=function(e){e(null,!1)},r.prototype.stat=function(e){e(o.NOT_FOUND)},r.prototype.unlink=function(e){e(o.NOT_FOUND)},r.prototype.rename=function(e,t){t(o.NOT_FOUND)},r.prototype.moveToTrash=function(e){e(o.NOT_FOUND)},n.exports=r}),define("text!htmlContent/pane.html",[],function(){return'<div id="{{id}}" class="view-pane">\n <div class="pane-header"></div>\n <div class="pane-content">\n <div class="not-editor"></div>\n </div>\n</div>'}),define("view/Pane",["require","exports","module","thirdparty/lodash","filesystem/FileSystem","document/InMemoryFile","view/ViewStateManager","view/MainViewManager","document/DocumentManager","command/CommandManager","command/Commands","strings","utils/ViewUtils","project/ProjectManager","text!htmlContent/pane.html"],function(e,t){function n(e,t){return{indexRequested:e,index:t}}function r(e,t){this._initialize();var n=this,r=t.append(Mustache.render(m,{id:e})).find("#"+e),o=r.find(".pane-header"),a=r.find(".pane-content");r.on("focusin.pane",function(e){n._lastFocusedElement=e.target}),this._lastFocusedElement=r[0],Object.defineProperty(this,"id",{get:function(){return e},set:function(){console.error("cannot change the id of a working pane")}}),Object.defineProperty(this,"$el",{get:function(){return r},set:function(){console.error("cannot change the DOM node of a working pane")}}),Object.defineProperty(this,"$header",{get:function(){return o},set:function(){console.error("cannot change the DOM node of a working pane")}}),Object.defineProperty(this,"$content",{get:function(){return a},set:function(){console.error("cannot change the DOM node of a working pane")}}),Object.defineProperty(this,"$container",{get:function(){return t},set:function(){console.error("cannot change the DOM node of a working pane")}}),this.updateHeaderText(),$(c).on(this._makeEventName("fileNameChange"),i.bind(this._handleFileNameChange,this)),$(c).on(this._makeEventName("pathDeleted"),i.bind(this._handleFileDeleted,this)),$(l).on(this._makeEventName("activePaneChange"),i.bind(this._handleActivePaneChange,this)),$(l).on(this._makeEventName("workingSetAdd"),i.bind(this.updateHeaderText,this)),$(l).on(this._makeEventName("workingSetRemove"),i.bind(this.updateHeaderText,this)),$(l).on(this._makeEventName("workingSetAddList"),i.bind(this.updateHeaderText,this)),$(l).on(this._makeEventName("workingSetRemoveList"),i.bind(this.updateHeaderText,this))}var i=e("thirdparty/lodash"),o=e("filesystem/FileSystem"),a=e("document/InMemoryFile"),s=e("view/ViewStateManager"),l=e("view/MainViewManager"),c=e("document/DocumentManager"),u=e("command/CommandManager"),d=e("command/Commands"),p=e("strings"),f=e("utils/ViewUtils"),h=e("project/ProjectManager"),m=e("text!htmlContent/pane.html");r.prototype.id=null,r.prototype.$container=null,r.prototype.$el=null,r.prototype.$header=null,r.prototype.$content=null,r.prototype._viewList=[],r.prototype._viewListMRUOrder=[],r.prototype._viewListAddedOrder=[],r.prototype._views={},r.prototype._currentView=null,r.prototype._lastFocusedElement=null,r.prototype._initialize=function(){this._viewList=[],this._viewListMRUOrder=[],this._viewListAddedOrder=[],this._views={},this._currentView=null,this.showInterstitial(!0)},r.prototype._makeEventName=function(e){return e+".pane-"+this.id},r.prototype._reparent=function(e){e.$el.appendTo(this.$content),this._views[e.getFile().fullPath]=e,e.notifyContainerChange&&e.notifyContainerChange()},r.prototype._hideCurrentView=function(){if(this._currentView){var e=this._currentView;this._setViewVisibility(this._currentView,!1),this.showInterstitial(!0),this._currentView=null,this._notifyCurrentViewChange(null,e)}},r.prototype.moveView=function(e,t,r){var i=this,o=new $.Deferred,a=new $.Deferred;if(this.getCurrentlyViewedPath()===e.fullPath){var s=this.traverseViewListByMRU(1,e.fullPath);s?this._execOpenFile(s.fullPath).fail(function(){i._hideCurrentView()}).always(function(){o.resolve()}):(this._hideCurrentView(),o.resolve())}else o.resolve();return o.done(function(){i._viewList.splice(i.findInViewList(e.fullPath),1),i._viewListMRUOrder.splice(i.findInViewListMRUOrder(e.fullPath),1),i._viewListAddedOrder.splice(i.findInViewListAddedOrder(e.fullPath),1),t._addToViewList(e,n(!0,r));var o=i._views[e.fullPath];o?(delete i._views[e.fullPath],t.addView(o,!t.getCurrentlyViewedFile()),a.resolve()):t.getCurrentlyViewedFile()?a.resolve():t._execOpenFile(e.fullPath).always(function(){a.resolve()})}),a.promise()},r.prototype.mergeFrom=function(e){var t=e._currentView;e._hideCurrentView(),this._viewList=i.union(this._viewList,e._viewList),this._viewListMRUOrder=i.union(this._viewListMRUOrder,e._viewListMRUOrder),this._viewListAddedOrder=i.union(this._viewListAddedOrder,e._viewListAddedOrder);var n=this,r=[];i.forEach(e._views,function(t){var i=t.getFile(),o=i&&i.fullPath;o&&-1!==e.findInViewList(o)?n._reparent(t):r.push(t)}),t&&!e._isViewNeeded(t)&&-1===r.indexOf(t)&&r.push(t),i.forEach(r,function(e){e.destroy()}),e._initialize()},r.prototype.destroy=function(){(this._currentView||Object.keys(this._views).length>0||this._viewList.length>0)&&console.warn("destroying a pane that isn't empty"),this._reset(),$(c).off(this._makeEventName("")),$(l).off(this._makeEventName("")),this.$el.off(".pane"),this.$el.remove()},r.prototype.getViewList=function(){return i.clone(this._viewList)},r.prototype.getViewListSize=function(){return this._viewList.length},r.prototype.findInViewList=function(e){return i.findIndex(this._viewList,function(t){return t.fullPath===e})},r.prototype.findInViewListAddedOrder=function(e){return i.findIndex(this._viewListAddedOrder,function(t){return t.fullPath===e})},r.prototype.findInViewListMRUOrder=function(e){return i.findIndex(this._viewListMRUOrder,function(t){return t.fullPath===e})},r.prototype.ITEM_NOT_FOUND=-1,r.prototype.ITEM_FOUND_NO_SORT=0,r.prototype.ITEM_FOUND_NEEDS_SORT=1,r.prototype.reorderItem=function(e,t,n){var r=void 0!==t&&null!==t&&t>=0,i=this.findInViewList(e.fullPath);if(-1!==i){if(n||r&&i!==t){var o=this._viewList.splice(i,1)[0];return this._viewList.splice(t,0,o),this.ITEM_FOUND_NEEDS_SORT}return this.ITEM_FOUND_NO_SORT}return this.ITEM_NOT_FOUND},r.prototype._canAddFile=function(e){return this._views.hasOwnProperty(e.fullPath)&&-1===this.findInViewList(e.fullPath)||!l._getPaneIdForPath(e.fullPath)},r.prototype._addToViewList=function(e,t){t&&t.indexRequested?this._viewList.splice(t.index,0,e):this._viewList.push(e);var n=this.getCurrentlyViewedPath();n&&n===e.fullPath?this._viewListMRUOrder.unshift(e):this._viewListMRUOrder.push(e),this._viewListAddedOrder.unshift(e)},r.prototype.addToViewList=function(e,t){var r=void 0!==t&&null!==t&&t>=0&&t<this._viewList.length;return this._addToViewList(e,n(r,t)),r||(t=this._viewList.length-1),t},r.prototype.addListToViewList=function(e){var t=this,n=[];return e.forEach(function(e){t._canAddFile(e)&&(t._addToViewList(e),n.push(e))}),n},r.prototype._notifyCurrentViewChange=function(e,t){this.updateHeaderText(),$(this).triggerHandler("currentViewChange",[e,t])},r.prototype._doDestroyView=function(e){this._currentView===e&&this._hideCurrentView(),delete this._views[e.getFile().fullPath],e.destroy()},r.prototype._doRemove=function(e,t){var n=this.findInViewList(e.fullPath);n>-1&&(this._viewList.splice(n,1),this._viewListMRUOrder.splice(this.findInViewListMRUOrder(e.fullPath),1),this._viewListAddedOrder.splice(this.findInViewListAddedOrder(e.fullPath),1));var r=this._views[e.fullPath];return r&&(t||this._doDestroyView(r)),n>-1||Boolean(r)},r.prototype.makeViewMostRecent=function(e){var t=this.findInViewListMRUOrder(e.fullPath);-1!==t&&(this._viewListMRUOrder.splice(t,1),this._viewListMRUOrder.unshift(e))},r.prototype.sortViewList=function(e){this._viewList.sort(i.partial(e,this.id))},r.prototype.moveWorkingSetItem=function(e,t){this._viewList.splice(t,0,this._viewList.splice(e,1)[0])},r.prototype.swapViewListIndexes=function(e,t){var n=this._viewList[e];return this._viewList[e]=this._viewList[t],this._viewList[t]=n,!0},r.prototype.traverseViewListByMRU=function(e,t){if(!t&&this._currentView){var n=this._currentView.getFile();t=n&&n.fullPath}var r=t?this.findInViewListMRUOrder(t):-1;return f.traverseViewArray(this._viewListMRUOrder,r,e)},r.prototype.updateHeaderText=function(){var e,t,n=this.getCurrentlyViewedFile();n?(e=l.getAllOpenFiles().filter(function(e){return e.name===n.name}),e.length<2?this.$header.text(n.name):(t=h.makeProjectRelativeIfPossible(n.fullPath),this.$header.text(t))):this.$header.html(p.EMPTY_VIEW_HEADER)},r.prototype._handleFileNameChange=function(e,t,n){var r=this.findInViewList(n)>=0;if(this._views.hasOwnProperty(t)){var i=this._views[t];this._views[n]=i,delete this._views[t]}this.updateHeaderText(),r&&$(this).triggerHandler("viewListChange")},r.prototype._handleFileDeleted=function(e,t){this.removeView({fullPath:t})&&$(this).triggerHandler("viewListChange")},r.prototype.showInterstitial=function(e){this.$content&&this.$content.find(".not-editor").css("display",e?"":"none")},r.prototype.getViewForPath=function(e){return this._views[e]},r.prototype.addView=function(e,t){var n=e.getFile(),r=n&&n.fullPath;return r?(e.$el.parent()!==this.$content?this._reparent(e):this._views[r]=e,void(t&&this.showView(e))):void console.error("cannot add a view that does not have a fullPath")},r.prototype._setViewVisibility=function(e,t){e.$el.css("display",t?"":"none"),e.notifyVisibilityChange&&e.notifyVisibilityChange(t)},r.prototype.showView=function(e){if(this._currentView&&this._currentView===e)return this._setViewVisibility(this._currentView,!0),void this.updateLayout(!0);var t=e.getFile(),n=t&&t.fullPath,r=this._currentView;this._currentView?(this._currentView.getFile()&&s.updateViewState(this._currentView),this._setViewVisibility(this._currentView,!1)):this.showInterstitial(!1),this._currentView=e,this._setViewVisibility(this._currentView,!0),this.updateLayout(),this._notifyCurrentViewChange(e,r),r&&this.destroyViewIfNotNeeded(r),this._views.hasOwnProperty(n)||console.error(n+" found in pane working set but pane.addView() has not been called for the view created for it")},r.prototype._updateHeaderHeight=function(){var e=this.$el.height();l.getPaneCount()>1?(this.$header.show(),e-=this.$header.outerHeight()):this.$header.hide(),this.$content.height(e)},r.prototype.updateLayout=function(e){this._updateHeaderHeight(),this._currentView&&this._currentView.updateLayout(e)},r.prototype._isViewNeeded=function(e){var t=e.getFile().fullPath,n=this.getCurrentlyViewedPath();return this._currentView&&n===t||-1!==this.findInViewList(t)},r.prototype.getCurrentlyViewedFile=function(){return this._currentView?this._currentView.getFile():null},r.prototype.getCurrentlyViewedPath=function(){var e=this.getCurrentlyViewedFile();return e?e.fullPath:null},r.prototype.destroyViewIfNotNeeded=function(e){if(!this._isViewNeeded(e)){var t=e.getFile(),n=t&&t.fullPath;delete this._views[n],e.destroy()}},r.prototype._reset=function(){var e=[],t=this._currentView;i.forEach(this._views,function(t){e.push(t)}),this._currentView&&-1===e.indexOf(this._currentView)&&e.push(this._currentView),this._initialize(),t&&this._notifyCurrentViewChange(null,t),e.forEach(function(e){e.destroy()})},r.prototype._execOpenFile=function(e){return u.execute(d.CMD_ADD_TO_WORKINGSET_AND_OPEN,{fullPath:e,paneId:this.id,options:{noPaneActivate:!0}})},r.prototype.removeView=function(e,t,n){var r=!t&&this.traverseViewListByMRU(1,e.fullPath);if(r&&r.fullPath!==e.fullPath&&this.getCurrentlyViewedPath()===e.fullPath){var i=this,o=r.fullPath,a=-1!==this.findInViewList(o);return this._doRemove(e,a)?(a&&this._execOpenFile(o).fail(function(){i._doDestroyView(i._currentView)}),!0):!1}return this._doRemove(e,n)},r.prototype.removeViews=function(e){var t,n=this,r=!1;if(r=-1!==i.findIndex(e,function(e){return e.fullPath===n.getCurrentlyViewedPath()}),t=e.filter(function(e){return n.removeView(e,!0,!0)}),r){var o=this.traverseViewListByMRU(1,this.getCurrentlyViewedPath()),a=o&&o.fullPath,s=a&&-1!==this.findInViewList(a);s?this._execOpenFile(a).fail(function(){n._doDestroyView(n._currentView)}):this._doDestroyView(this._currentView)}return t},r.prototype.focus=function(){document.activeElement.blur(),this._lastFocusedElement&&$(this._lastFocusedElement).is(":visible")?$(this._lastFocusedElement).focus():this._currentView?this._currentView.$el.focus():this.$el.focus()},r.prototype._handleActivePaneChange=function(e,t){this.$el.toggleClass("active-pane",Boolean(t===this.id))},r.prototype.loadState=function(e){var t,n,r=[],a={},l=this,c=function(){return l._viewList.length>0?l._viewList[0].fullPath:null};return i.forEach(e,function(e){r.push(o.getFileForPath(e.file)),e.active&&(t=e.file),e.viewState&&(a[e.file]=e.viewState)}),this.addListToViewList(r),s.addViewStates(a),t=t||c(),t&&(n={paneId:l.id,fullPath:t}),(new $.Deferred).resolve(n)},r.prototype.saveState=function(){var e=[],t=this.getCurrentlyViewedPath();return this._currentView&&this._currentView.getFile()&&s.updateViewState(this._currentView),this._viewList.forEach(function(n){n instanceof a||e.push({file:n.fullPath,active:n.fullPath===t,viewState:s.getViewState(n)})}),e},r.prototype.getScrollState=function(){return this._currentView&&this._currentView.getScrollPos?{scrollPos:this._currentView.getScrollPos()}:void 0},r.prototype.restoreAndAdjustScrollState=function(e,t){this._currentView&&e&&e.scrollPos&&this._currentView.adjustScrollPos&&this._currentView.adjustScrollPos(e.scrollPos,t)},t.Pane=r}),define("view/MainViewManager",["require","exports","module","thirdparty/lodash","strings","utils/AppInit","command/CommandManager","view/MainViewFactory","view/ViewStateManager","command/Commands","widgets/Dialogs","widgets/DefaultDialogs","editor/EditorManager","filesystem/FileSystemError","document/DocumentManager","preferences/PreferencesManager","project/ProjectManager","view/WorkspaceManager","utils/Async","utils/ViewUtils","utils/Resizer","view/Pane"],function(e,t){function n(e,t){return{file:e,paneId:t}}function r(){return Ut}function i(e){return e&&e!==Lt?e:r()}function o(e){return e=i(e),jt[e]?jt[e]:null}function a(){o(Lt).focus()}function s(e){return e===Lt||e===Ot}function l(e,t){var r,i,a=o(e);Bt||(a.makeViewMostRecent(t),r=ut.findIndex(Wt,function(n){return n.file===t&&n.paneId===e}),i=n(t,a.id),-1!==r&&(Wt.splice(r,1),Wt.unshift(i)))}function c(e){var t=o(e);t.getCurrentlyViewedFile()&&l(e,t.getCurrentlyViewedFile())}function u(e){if(!s(e)&&e!==Ut){var n=Ut,r=o(Lt),i=o(e);if(!i)throw new Error("invalid pane id: "+e);Ut=e,$(t).triggerHandler("activePaneChange",[e,n]),$(t).triggerHandler("currentFileChange",[o(Lt).getCurrentlyViewedFile(),e,r.getCurrentlyViewedFile(),n]),c(Ut)}a()}function d(e){return ut.find(jt,function(t){return t.$el[0]===e[0]?t:void 0})}function p(e){var t=o(e);return t?t.getCurrentlyViewedFile():null}function f(e){var t=p(e);return t?t.fullPath:null}function h(e,t){if(t){var n=t.$el.parent().parent(),r=d(n);if(r)r.id!==Ut&&u(r.id);else{var i=n.parents(".view-pane");1===i.length&&(n=$(i[0]),r=d(n),r&&r.id!==Ut&&(u(r.id),t.focus()))}}}function m(e,t){e===Ot?ut.forEach(jt,t):t(o(e))}function g(e){m(e,function(e){Vt[e.id]=e.getScrollState()})}function v(e,t){m(e,function(e){e.restoreAndAdjustScrollState(Vt[e.id],t),delete Vt[e.id]})}function y(e){var t=[];return m(e,function(e){var n=e.getViewList();t=ut.union(t,n)}),t}function _(){var e=y(Ot);return ut.forEach(jt,function(t){var n=t.getCurrentlyViewedFile();n&&(e=ut.union(e,[n]))}),e}function b(){return Object.keys(jt)}function E(e){var t=0;return m(e,function(e){t+=e.getViewListSize()}),t}function w(e){return Ht[e][$t]}function S(){return Object.keys(jt).length}function C(e,t,n){var r=-1;return m(e,function(e){var i=e[n].call(e,t);return i>=0?(r=i,!1):void 0}),r}function I(e){var t,n=[];return ut.forEach(jt,function(r){t=r.findInViewList(e),t>=0&&n.push({paneId:r.id,index:t})}),n}function k(e,t){return C(e,t,"findInViewList")}function x(e,t){return C(e,t,"findInViewListAddedOrder")}function T(e,t){return C(e,t,"findInViewListMRUOrder")}function D(e){var t=I(e).shift();return t||ut.forEach(jt,function(n){return n.getCurrentlyViewedPath()===e?(t={paneId:n.id},!1):void 0}),t?t.paneId:null}function M(e,r,i,a){var s=o(e),l=D(r.fullPath);if(!s)throw new Error("invalid pane id: "+e);if(-1===k(Ot,r.fullPath)){l&&l!==s.id&&(s=o(l));var c=s.reorderItem(r,i,a),u=n(r,s.id);c===s.ITEM_FOUND_NEEDS_SORT?(console.warn("pane.reorderItem returned pane.ITEM_FOUND_NEEDS_SORT which shouldn't happen "+r),$(t).triggerHandler("workingSetSort",[s.id])):c===s.ITEM_NOT_FOUND&&(i=s.addToViewList(r,i),s.getCurrentlyViewedFile()===r?Wt.unshift(u):Wt.push(u),$(t).triggerHandler("workingSetAdd",[r,i,s.id]))}}function O(e,r){var i,a=o(e);i=a.addListToViewList(r),i.forEach(function(e){Wt.push(n(e,a.id))}),$(t).triggerHandler("workingSetAddList",[i,a.id]);var s=r.filter(function(e){return-1===a.findInViewList(e.fullPath)&&D(e.fullPath)});s.length&&O(D(s[0].fullPath),s)}function L(e,t){var n,r=function(n){return n.file===t&&n.paneId===e};do n=ut.findIndex(Wt,r),-1!==n&&Wt.splice(n,1);while(-1!==n)}function R(e,n,r){var i=o(e);i.removeView(n)&&(L(i.id,n),$(t).triggerHandler("workingSetRemove",[n,r,i.id]))}function A(e,n,r,i){var a=new $.Deferred,s=o(e),l=o(n);return s.moveView(r,l,i).done(function(){Wt.every(function(e){return e.file===r&&e.paneId===s.id?(e.paneId=l.id,!1):!0}),$(t).triggerHandler("workingSetMove",[r,s.id,l.id]),a.resolve()}),a.promise()}function N(e,t){var n,r=function(e){return e.file.fullPath===t};do n=ut.findIndex(Wt,r),-1!==n&&Wt.splice(n,1);while(-1!==n)}function P(e,n){m(e,function(e){e.sortViewList(n),$(t).triggerHandler("workingSetSort",[e.id])})}function F(e,n,r){var i=o(e);i.moveWorkingSetItem(n,r),$(t).triggerHandler("workingSetSort",[i.id]),$(t).triggerHandler("_workingSetDisableAutoSort",[i.id])}function U(e,n,r){var i=o(e);i.swapViewListIndexes(n,r),$(t).triggerHandler("workingSetSort",[i.id]),$(t).triggerHandler("_workingSetDisableAutoSort",[i.id])}function j(e){var t=p(),n=r(),i=ut.findIndex(Wt,function(e){return e.file===t&&e.paneId===n});return kt.traverseViewArray(Wt,i,e)}function V(){Bt=!0}function B(){var e=o(Lt);Bt&&(Bt=!1,l(e.id,e.getCurrentlyViewedFile()))}function W(e,t){var n;n=$t===Nt?ct.innerWidth():ct.innerHeight(),xt.resyncSizer(e.$el),e.$el.data("maxsize",n-Ft),e.updateLayout(t)}function H(e,t,n){var r;r=$t===Nt?ct.innerWidth():ct.innerHeight(),ut.forEach(jt,function(e){if(e.id===At&&$t===Pt){var t=(jt[Rt].$el.height()+1)/r;e.$el.css("height",100-100*t+"%")}W(e,n)})}function q(e){var t=Object.keys(jt),n=100/t.length;ut.forEach(jt,function(t){t.$el.css(t.id===Rt?$t===Nt?{height:"100%",width:n+"%","float":"left"}:{height:n+"%",width:"100%"}:$t===Nt?{height:"100%",width:"auto","float":"none"}:{width:"100%",height:"50%"}),W(t,e)})}function z(){m(Ot,function(e){e.updateHeaderText()})}function G(e){var n;return jt.hasOwnProperty(e)||(n=new Tt(e,ct),jt[e]=n,$(t).triggerHandler("paneCreate",[n.id]),n.$el.on("click.mainview dragover.mainview",function(){u(n.id)}),$(n).on("viewListChange.mainview",function(){z(),$(t).triggerHandler("workingSetUpdate",[n.id])}),$(n).on("currentViewChange.mainview",function(e,r,i){z(),Ut===n.id&&$(t).triggerHandler("currentFileChange",[r&&r.getFile(),n.id,i&&i.getFile(),n.id])})),n}function K(){var e=jt[Rt];xt.makeResizable(e.$el,$t===Pt?xt.DIRECTION_VERTICAL:xt.DIRECTION_HORIZONTAL,$t===Pt?xt.POSITION_BOTTOM:xt.POSITION_RIGHT,Ft,!1,!1,!1,!0),e.$el.on("panelResizeUpdate",function(){H()})}function X(e){var n,r;e!==$t&&(n=jt[Rt],xt.removeSizable(n.$el),$t&&ct.removeClass("split-"+$t.toLowerCase()),ct.addClass("split-"+e.toLowerCase()),$t=e,r=G(At),K(),q(),$(t).triggerHandler("paneLayoutChange",[$t]),r&&p(n.id)&&u(r.id))}function Y(e,t,n){var r=D(t.file.fullPath),i=n||{};r&&(e=r,i.noPaneActivate||u(e));var a=o(e);(t.isUntitled()||!St.isWithinProject(t.file.fullPath))&&M(e,t.file),_t.openDocument(t,a),l(e,t.file)}function Q(e,t,n){var r=new $.Deferred,a=n||{};if(!t||!o(e))return r.reject("bad argument").promise();var s=D(t.fullPath);s&&(wt.getViewState("splitview.multipane-info")||s===i(e)||(wt.setViewState("splitview.multipane-info",!0),window.setTimeout(function(){vt.showModalDialog(yt.DIALOG_ID_INFO,dt.SPLITVIEW_INFO_TITLE,dt.SPLITVIEW_MULTIPANE_WARNING)},500)),e=s,a.noPaneActivate||u(e));var l=o(e),c=ht.findSuitableFactoryForPath(t.fullPath);return c?t.exists(function(n,i){i?c.openFile(t,l).done(function(){St.isWithinProject(t.fullPath)||M(e,t),r.resolve(t)}).fail(function(e){r.reject(e)}):r.reject(n||bt.NOT_FOUND)}):Et.getDocumentForPath(t.fullPath).done(function(t){Y(e,t,a),r.resolve(t.file)
16}).fail(function(e){r.reject(e)}),r}function J(){if(jt.hasOwnProperty(At)){var e=jt[Rt],n=jt[At],r=n.getViewList(),i=p();xt.removeSizable(e.$el),e.mergeFrom(n),$(t).triggerHandler("workingSetRemoveList",[r,n.id]),u(e.id),n.$el.off(".mainview"),$(n).off(".mainview"),n.destroy(),delete jt[At],$(t).triggerHandler("paneDestroy",n.id),$(t).triggerHandler("workingSetAddList",[r,e.id]),Wt.forEach(function(t){t.paneId===n.id&&(t.paneId=e.id)}),ct.removeClass("split-"+$t.toLowerCase()),$t=null,q(),$(t).triggerHandler("paneLayoutChange",[$t]),i&&p()!==i&&t._open(e.id,i)}}function Z(e,n,r){var i=r||{};m(e,function(e){return e.removeView(n,i.noOpenNextFile)?(L(e.id,n),$(t).triggerHandler("workingSetRemove",[n,!1,e.id]),!1):void 0})}function et(e,n){m(e,function(e){var r=e.removeViews(n);r.forEach(function(t){L(e.id,t)}),$(t).triggerHandler("workingSetRemoveList",[r,e.id])})}function tt(e){m(e,function(e){var n=e.getViewList();n.forEach(function(t){L(e.id,t)}),e._reset(),$(t).triggerHandler("workingSetRemoveList",[n,e.id])})}function nt(e){var t=d($(e._masterEditor.$el.parent().parent()));if(!t){var n=I(e.file.fullPath).shift();n&&(t=jt[n.paneId])}return t}function rt(e){if(!(e instanceof Et.Document))throw new Error("_destroyEditorIfUnneeded() should be passed a Document");if(e._masterEditor){var t=nt(e);t?t.destroyViewIfNotNeeded(e._masterEditor):e._masterEditor.destroy()}}function it(){function e(){var e={location:{scope:"user",layer:"project"}},t=wt.getViewState(Mt,e);if(t){var n={orientation:null,activePaneId:Rt,panes:{"first-pane":[]}};return t.forEach(function(e){n.panes[Rt].push(e)}),n}}var r,i=[],o={location:{scope:"user",layer:"project"}},a=wt.getViewState(Dt,o);a||(a=e()),J(),Wt=[],mt.reset(),a&&(r=Object.keys(a.panes),$t=r.length>1?a.orientation:null,ut.forEach(a.panes,function(e,t){G(t),i.push(jt[t].loadState(e))}),It.waitForAll(i).then(function(e){if(q(),r.length>1&&(K(),$.isNumeric(a.splitPercentage)&&a.splitPercentage>0)){var o;o=$t===Nt?"width":"height",jt[Rt].$el.css(o,100*a.splitPercentage+"%"),H()}$t&&(ct.addClass("split-"+$t.toLowerCase()),$(t).triggerHandler("paneLayoutChange",$t)),ut.forEach(jt,function(e){var r=e.getViewList();r.forEach(function(t){Wt.push(n(t,e.id))}),$(t).triggerHandler("workingSetAddList",[r,e.id])}),i=[],e.forEach(function(e){e&&i.push(ft.execute(gt.FILE_OPEN,e))}),It.waitForAll(i).then(function(){u(a.activePaneId)})}))}function ot(){function e(){var e,t;return 1===S()?1:($t===Nt?(e=ct.innerWidth(),t=jt[Rt].$el.width()):(e=ct.innerHeight(),t=jt[Rt].$el.height()),t/e)}var t=St.getProjectRoot(),n={location:{scope:"user",layer:"project",layerID:t.fullPath}},i={orientation:$t,activePaneId:r(),splitPercentage:e(),panes:{}};t&&(ut.forEach(jt,function(e){i.panes[e.id]=e.saveState()}),wt.setViewState(Dt,i,n))}function at(e){if(Ut)throw new Error("MainViewManager has already been initialized");ct=e,G(Rt),Ut=Rt,jt[Rt]._handleActivePaneChange(void 0,Ut),q(),$(Ct).on("workspaceUpdateLayout",H)}function st(e,t){return 1>e||e>2||1>t||t>2||2===t&&2===e?(console.error("setLayoutScheme unsupported layout "+e+", "+t),!1):(e===t?J():X(e>t?Pt:Nt),!0)}function lt(){var e={rows:1,columns:1};return $t===Pt?e.rows=2:$t===Nt&&(e.columns=2),e}var ct,ut=e("thirdparty/lodash"),dt=e("strings"),pt=e("utils/AppInit"),ft=e("command/CommandManager"),ht=e("view/MainViewFactory"),mt=e("view/ViewStateManager"),gt=e("command/Commands"),vt=e("widgets/Dialogs"),yt=e("widgets/DefaultDialogs"),_t=e("editor/EditorManager"),bt=e("filesystem/FileSystemError"),Et=e("document/DocumentManager"),wt=e("preferences/PreferencesManager"),St=e("project/ProjectManager"),Ct=e("view/WorkspaceManager"),It=e("utils/Async"),kt=e("utils/ViewUtils"),xt=e("utils/Resizer"),Tt=e("view/Pane").Pane,Dt="mainView.state",Mt="project.files",Ot="ALL_PANES",Lt="ACTIVE_PANE",Rt="first-pane",At="second-pane",Nt="VERTICAL",Pt="HORIZONTAL",Ft=75,$t=null,Ut=null,jt={},Vt={},Bt=!1,Wt=[],Ht={};Ht[Rt]={},Ht[At]={},Ht[Rt][Nt]=dt.LEFT,Ht[Rt][Pt]=dt.TOP,Ht[At][Nt]=dt.RIGHT,Ht[At][Pt]=dt.BOTTOM,pt.htmlReady(function(){at($("#editor-holder"))}),$(St).on("projectOpen",it),$(St).on("beforeProjectClose beforeAppClose",ot),$(_t).on("activeEditorChange",h),$(Et).on("pathDeleted",N),t._initialize=at,t._getPane=o,t._removeView=R,t._moveView=A,t._sortWorkingSet=P,t._moveWorkingSetItem=F,t._swapWorkingSetListIndexes=U,t._destroyEditorIfNotNeeded=rt,t._edit=Y,t._open=Q,t._close=Z,t._closeAll=tt,t._closeList=et,t._getPaneIdForPath=D,t.addToWorkingSet=M,t.addListToWorkingSet=O,t.getWorkingSetSize=E,t.getWorkingSet=y,t.cacheScrollState=g,t.restoreAdjustedScrollState=v,t.findInWorkingSet=k,t.findInWorkingSetByAddedOrder=x,t.findInWorkingSetByMRUOrder=T,t.findInAllWorkingSets=I,t.beginTraversal=V,t.endTraversal=B,t.traverseToNextViewByMRU=j,t.getActivePaneId=r,t.setActivePaneId=u,t.getPaneIdList=b,t.getPaneTitle=w,t.getPaneCount=S,t.getAllOpenFiles=_,t.focusActivePane=a,t.setLayoutScheme=st,t.getLayoutScheme=lt,t.getCurrentlyViewedFile=p,t.getCurrentlyViewedPath=f,t.ALL_PANES=Ot,t.ACTIVE_PANE=Lt}),define("utils/AnimationUtils",["require","exports","module","utils/Async"],function(e,t){function n(e,t,n){function i(t){t.target===e&&a.resolve()}function o(){s.removeClass(t).off("webkitTransitionEnd",i)}var a=new $.Deferred,s=$(e);return n=n||400,s.is(":hidden")?a.resolve():s.addClass(t).on("webkitTransitionEnd",i),r.withTimeout(a.promise(),n,!0).done(o)}var r=e("utils/Async");t.animateUsingClass=n}),define("widgets/PopUpManager",["require","exports","module","utils/AppInit","command/CommandManager","utils/KeyEvent"],function(e,t){function n(e,t,n){n=n||!1,d.push(e[0]),e.data("PopUpManager-autoRemove",n),e.data("PopUpManager-removeHandler",t)}function r(e){if(e.find(":visible").length>0){var t=e.data("PopUpManager-removeHandler");t&&t()}var n=d.indexOf(e[0]);if(n>=0){var r=e.data("PopUpManager-autoRemove");r&&(e.remove(),d.splice(n,1))}}function i(e){var t,n,i=new $.Event("popUpClose");for(n=d.length-1;n>=0;n--)if(t=$(d[n]),t.find(":visible").length>0){t.trigger(i),i.isDefaultPrevented()||(e&&e.stopImmediatePropagation(),r(t));break}}function o(e){(e.keyCode===u.DOM_VK_ESCAPE||e.keyCode===u.DOM_VK_ALT&&"win"===brackets.platform)&&(e.keyCode===u.DOM_VK_ALT&&e.ctrlKey||i(e))}function a(){i()}function s(e){$(e).on("beforeContextMenuOpen",a)}var l=e("utils/AppInit"),c=e("command/CommandManager"),u=e("utils/KeyEvent"),d=[];l.htmlReady(function(){window.document.body.addEventListener("keydown",o,!0),$(t).on("beforeMenuPopup",a),$(c).on("beforeExecuteCommand",function(){i()})}),t.addPopUp=n,t.removePopUp=r,t.listenToContextMenu=s}),define("command/Menus",["require","exports","module","thirdparty/lodash","command/Commands","command/KeyBindingManager","utils/StringUtils","command/CommandManager","widgets/PopUpManager","utils/ViewUtils","utils/DeprecationWarning","utils/Global"],function(e,t){function n(e){return H[e]}function r(){return H}function i(e){return q[e]}function o(e){return!!i(e)}function a(e){return!brackets.nativeMenus||o(e)}function s(e){return z[e]}function l(e){return $("#"+C.jQueryIdEscape(e)).get(0)}function c(e){return $("#"+C.jQueryIdEscape(e)).get(0)}function u(e,t,n){var r=e.find(".menu-shortcut");0===r.length&&(r=$("<span class='menu-shortcut' />"),e.append(r)),r.data("key",t),r.text(S.formatKeyDescriptor(n))}function d(e){var t=S.getKeyBindings(e.getCommand().getID()),n=null;return t.length>0&&(n=t[t.length-1],u($(c(e.id)),n.key,n.displayKey)),n}function p(){return"brackets-menuDivider-"+G++}function f(e,t,n,r){var i=!1;n&&(n===P?n=L:n===F&&(n=R),n===A?(e.prepend(t),i=!0):r&&r.length>0&&(n===R?(r.after(t),i=!0):n===L&&(r.before(t),i=!0))),i||e.append(t)}function h(e,t){this.id=e,this.isDivider=t===U,this.isNative=!1,this.isDivider||(this._enabledChanged=this._enabledChanged.bind(this),this._checkedChanged=this._checkedChanged.bind(this),this._nameChanged=this._nameChanged.bind(this),this._keyBindingAdded=this._keyBindingAdded.bind(this),this._keyBindingRemoved=this._keyBindingRemoved.bind(this),this._command=t,$(this._command).on("enabledStateChange",this._enabledChanged).on("checkedStateChange",this._checkedChanged).on("nameChange",this._nameChanged).on("keyBindingAdded",this._keyBindingAdded).on("keyBindingRemoved",this._keyBindingRemoved))}function m(e){this.id=e}function g(){$(".dropdown").removeClass("open")}function v(e,t,n,r){e=E.escape(e);var i,o=$("#titlebar .nav");if(!e||!t)return console.error("call to addMenu() is missing required parameters"),null;if(H[t])return console.log("Menu added with same name and id of existing Menu: "+t),null;if(i=new m(t),H[t]=i,!a(t))return brackets.app.addMenu(e,t,n,r,function(n){switch(n){case j:brackets.app.setMenuTitle(t,e,function(e){e&&console.error("setMenuTitle() -- error: "+e)});break;case V:console.error("addMenu(): Unknown Error when adding the menu "+t);break;case B:console.error("addMenu(): Invalid Parameters when adding the menu "+t);break;case W:console.error("addMenu(): Menu with command "+r+" could not be found when adding the menu "+t);break;default:console.error("addMenu(): Unknown Error ("+n+") when adding the menu "+t)}}),i;var s=$("<a href='#' class='dropdown-toggle' data-toggle='dropdown'>"+e+"</a>"),c=$("<ul class='dropdown-menu'></ul>"),u=$("<li class='dropdown' id='"+t+"'></li>").append(s).append(c),d=r&&$(l(r));return f(o,u,n,d),k.addPopUp(c,g,!1),i}function y(e){var t,r="";return e?H[e]?(t=n(e),E.forEach(z,function(n,i){i.substring(0,e.length)===e&&(n.isDivider?t.removeMenuDivider(i):(r=n.getCommand(),t.removeMenuItem(r)))}),a(e)?$(l(e)).remove():brackets.app.removeMenu(e,function(t){t&&console.error("removeMenu() -- id not found: "+e+" (error: "+t+")")}),void delete H[e]):void console.error("removeMenu(): menu id not found: %s",e):void console.error("removeMenu(): missing required parameter: id")}function _(e){m.apply(this,arguments);var t=$("<li class='dropdown context-menu' id='"+C.jQueryIdEscape(e)+"'></li>"),n=$("<ul class='dropdown-menu'></ul>"),r=$("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>").hide();t.append(r).append(n),$("#context-menu-bar > ul").append(t);var i=this;k.addPopUp(n,function(){i.close()},!1),k.listenToContextMenu(this)}function b(e){if(!e)return console.error("call to registerContextMenu() is missing required parameters"),null;if(q[e])return console.log("Context Menu added with same name and id of existing Context Menu: "+e),null;var t=new _(e);return q[e]=t,t}var E=e("thirdparty/lodash"),w=e("command/Commands"),S=e("command/KeyBindingManager"),C=e("utils/StringUtils"),I=e("command/CommandManager"),k=e("widgets/PopUpManager"),x=e("utils/ViewUtils"),T=e("utils/DeprecationWarning");e("utils/Global");var D={FILE_MENU:"file-menu",EDIT_MENU:"edit-menu",FIND_MENU:"find-menu",VIEW_MENU:"view-menu",NAVIGATE_MENU:"navigate-menu",HELP_MENU:"help-menu"},M={EDITOR_MENU:"editor-context-menu",INLINE_EDITOR_MENU:"inline-editor-context-menu",PROJECT_MENU:"project-context-menu",WORKING_SET_CONTEXT_MENU:"workingset-context-menu",WORKING_SET_CONFIG_MENU:"workingset-configuration-menu",SPLITVIEW_MENU:"splitview-menu"},O={FILE_OPEN_CLOSE_COMMANDS:{sectionMarker:w.FILE_NEW},FILE_SAVE_COMMANDS:{sectionMarker:w.FILE_SAVE},FILE_LIVE:{sectionMarker:w.FILE_LIVE_FILE_PREVIEW},FILE_EXTENSION_MANAGER:{sectionMarker:w.FILE_EXTENSION_MANAGER},EDIT_UNDO_REDO_COMMANDS:{sectionMarker:w.EDIT_UNDO},EDIT_TEXT_COMMANDS:{sectionMarker:w.EDIT_CUT},EDIT_SELECTION_COMMANDS:{sectionMarker:w.EDIT_SELECT_ALL},EDIT_MODIFY_SELECTION:{sectionMarker:w.EDIT_INDENT},EDIT_COMMENT_SELECTION:{sectionMarker:w.EDIT_LINE_COMMENT},EDIT_CODE_HINTS_COMMANDS:{sectionMarker:w.SHOW_CODE_HINTS},EDIT_TOGGLE_OPTIONS:{sectionMarker:w.TOGGLE_CLOSE_BRACKETS},EDIT_FIND_COMMANDS:{sectionMarker:w.TOGGLE_CLOSE_BRACKETS},EDIT_REPLACE_COMMANDS:{sectionMarker:w.TOGGLE_CLOSE_BRACKETS},FIND_FIND_COMMANDS:{sectionMarker:w.CMD_FIND},FIND_FIND_IN_COMMANDS:{sectionMarker:w.CMD_FIND_IN_FILES},FIND_REPLACE_COMMANDS:{sectionMarker:w.CMD_REPLACE},VIEW_HIDESHOW_COMMANDS:{sectionMarker:w.VIEW_HIDE_SIDEBAR},VIEW_FONTSIZE_COMMANDS:{sectionMarker:w.VIEW_INCREASE_FONT_SIZE},VIEW_TOGGLE_OPTIONS:{sectionMarker:w.TOGGLE_ACTIVE_LINE},NAVIGATE_GOTO_COMMANDS:{sectionMarker:w.NAVIGATE_QUICK_OPEN},NAVIGATE_DOCUMENTS_COMMANDS:{sectionMarker:w.NAVIGATE_NEXT_DOC},NAVIGATE_OS_COMMANDS:{sectionMarker:w.NAVIGATE_SHOW_IN_FILE_TREE},NAVIGATE_QUICK_EDIT_COMMANDS:{sectionMarker:w.TOGGLE_QUICK_EDIT},NAVIGATE_QUICK_DOCS_COMMANDS:{sectionMarker:w.TOGGLE_QUICK_DOCS}},L="before",R="after",A="first",N="last",P="firstInSection",F="lastInSection",U="---",j=0,V=1,B=2,W=3,H={},q={},z={},G=1;m.prototype._getMenuItemId=function(e){return this.id+"-"+e},m.prototype._getMenuItemForCommand=function(e){if(!e)return null;var t=z[this._getMenuItemId(e.getID())];return t?$(c(t.id)).closest("li"):null},m.prototype._getRelativeMenuItem=function(e,t){var n;if(e){if(t===P||t===F){if(!e.hasOwnProperty("sectionMarker"))return console.error("Bad Parameter in _getRelativeMenuItem(): relativeID must be a MenuSection when position refers to a menu section"),null;var r=this._getMenuItemForCommand(I.get(e.sectionMarker));if(!r)return console.error("_getRelativeMenuItem(): MenuSection "+e.sectionMarker+" not found in Menu "+this.id),null;var i=r;for(n=i;;){if(i=t===P?i.prev():i.next(),0===i.length)break;if(i.find(".divider").length>0)break;n=i}}else{if(e.hasOwnProperty("sectionMarker"))return console.error("Bad Parameter in _getRelativeMenuItem(): if relativeID is a MenuSection, position must be FIRST_IN_SECTION or LAST_IN_SECTION"),null;var o=I.get(e);if(o&&(n=this._getMenuItemForCommand(o)),!n)return console.error("_getRelativeMenuItem(): MenuItem with Command id "+e+" not found in Menu "+this.id),null}return n}return t&&t!==A&&t!==N?(console.error("Bad Parameter in _getRelativeMenuItem(): relative position specified with no relativeID"),null):n},m.prototype.removeMenuItem=function(e){var t,n;if(!e)return void console.error("removeMenuItem(): missing required parameters: command");if("string"==typeof e){var r=I.get(e);if(!r)return void console.error("removeMenuItem(): command not found: "+e);n=e}else n=e.getID();t=this._getMenuItemId(n),a(this.id)?$(c(t)).parent().remove():brackets.app.removeMenuItem(n,function(e){e&&console.error("removeMenuItem() -- command not found: "+n+" (error: "+e+")")}),delete z[t]},m.prototype.removeMenuDivider=function(e){var t,n;if(!e)return void console.error("removeMenuDivider(): missing required parameters: menuItemID");if(t=s(e),!t)return void console.error("removeMenuDivider(): parameter menuItemID: %s is not a valid menu item id",e);if(!t.isDivider)return void console.error("removeMenuDivider(): parameter menuItemID: %s is not a menu divider",e);if(a(this.id)){if(n=$(c(e)).parent(),!n)return void console.error("removeMenuDivider(): HTML menu divider not found: %s",e);n.remove()}else brackets.app.removeMenuItem(t.dividerId,function(t){t&&console.error("removeMenuDivider() -- divider not found: %s (error: %s)",e,t)});return z[e]?void delete z[e]:void console.error("removeMenuDivider(): menu divider not found in menuItemMap: %s",e)},m.prototype.addMenuItem=function(e,t,n,r){var i,o,s,l,c,u=this.id;if(r===O.EDIT_FIND_COMMANDS?(T.deprecationWarning("Add "+e+" Command to the Find Menu instead of the Edit Menu.",!0),T.deprecationWarning("Use MenuSection.FIND_FIND_COMMANDS instead of MenuSection.EDIT_FIND_COMMANDS.",!0)):r===O.EDIT_REPLACE_COMMANDS&&(T.deprecationWarning("Add "+e+" Command to the Find Menu instead of the Edit Menu.",!0),T.deprecationWarning("Use MenuSection.FIND_REPLACE_COMMANDS instead of MenuSection.EDIT_REPLACE_COMMANDS.",!0)),!e)return console.error("addMenuItem(): missing required parameters: command"),null;if("string"==typeof e)if(e===U)l=U,c=p();else{if(c=e,e=I.get(c),!e)return console.error("addMenuItem(): commandID not found: "+c),null;l=e.getName()}else c=e.getID(),l=e.getName();if(i=this._getMenuItemId(c),z[i])return console.log("MenuItem added with same id of existing MenuItem: "+i),null;if(s=new h(i,e),z[i]=s,a(this.id)){l===U?o=$("<li><hr class='divider' id='"+i+"' /></li>"):(o=$("<li><a href='#' id='"+i+"'> <span class='menu-name'></span></a></li>"),o.on("click",function(){s._command.execute()}));var m=this._getRelativeMenuItem(r,n);f($("li#"+C.jQueryIdEscape(this.id)+" > ul.dropdown-menu"),o,n,m)}else{var g,v=S.getKeyBindings(c),y="",_="";if(v&&v.length>0&&(g=v[v.length-1],y=g.displayKey||g.key),y.length>0&&(_=S.formatKeyDescriptor(y)),n===P||n===F){if(!r.hasOwnProperty("sectionMarker"))return console.error("Bad Parameter in _getRelativeMenuItem(): relativeID must be a MenuSection when position refers to a menu section"),null;r=r.sectionMarker}brackets.app.addMenuItem(this.id,l,c,y,_,n,r,function(e){switch(e){case j:break;case B:console.error("addMenuItem(): Invalid Parameters when adding the command "+c);break;case W:console.error("_getRelativeMenuItem(): MenuItem with Command id "+r+" not found in the Menu "+u);break;default:console.error("addMenuItem(); Unknown Error ("+e+") when adding the command "+c)}}),s.isNative=!0}return s.isDivider?s.dividerId=c:(t&&(Array.isArray(t)||(t=[t])),S.addBinding(c,t),d(s,c),s._checkedChanged(),s._enabledChanged(),s._nameChanged()),s},m.prototype.addMenuDivider=function(e,t){return this.addMenuItem(U,"",e,t)},h.prototype.getCommand=function(){return this._command},h.prototype.getParentMenu=function(){var e=$(c(this.id)).parents(".dropdown").get(0);return e?n(e.id):null},h.prototype._checkedChanged=function(){var e=!!this._command.getChecked();if(this.isNative){var t=!!this._command.getEnabled();brackets.app.setMenuItemState(this._command.getID(),t,e,function(e){e&&console.log("Error setting menu item state: "+e)})}else x.toggleClass($(c(this.id)),"checked",e)},h.prototype._enabledChanged=function(){if(this.isNative){var e=!!this._command.getEnabled(),t=!!this._command.getChecked();brackets.app.setMenuItemState(this._command.getID(),e,t,function(e){e&&console.log("Error setting menu item state: "+e)})}else x.toggleClass($(c(this.id)),"disabled",!this._command.getEnabled())},h.prototype._nameChanged=function(){this.isNative?brackets.app.setMenuTitle(this._command.getID(),this._command.getName(),function(e){e&&console.log("Error setting menu title: "+e)}):$(c(this.id)).find(".menu-name").text(this._command.getName())},h.prototype._keyBindingAdded=function(e,t){if(this.isNative){var n=t.displayKey||t.key;brackets.app.setMenuItemShortcut(this._command.getID(),n,S.formatKeyDescriptor(n),function(e){e&&console.error("Error setting menu item shortcut: "+e)})}else u($(c(this.id)),t.key,t.displayKey)},h.prototype._keyBindingRemoved=function(e,t){if(this.isNative)brackets.app.setMenuItemShortcut(this._command.getID(),"","",function(e){e&&console.error("Error setting menu item shortcut: "+e)});else{var n=$(c(this.id)).find(".menu-shortcut");n.length>0&&n.data("key")===t.key&&null===d(this)&&n.empty()}},_.prototype=Object.create(m.prototype),_.prototype.constructor=_,_.prototype.parentClass=m.prototype,_.prototype.open=function(e){if(!e||!e.hasOwnProperty("pageX")||!e.hasOwnProperty("pageY"))return void console.error("ContextMenu open(): missing required parameter");var t=$(window),n=C.jQueryIdEscape(this.id),r=$("#"+n),i=$("#"+n+" > ul"),o=e.pageY,a=e.pageX;if(!(i.children().length<=0)){$(this).triggerHandler("beforeContextMenuOpen"),g();var s={top:o,left:a,height:i.height()+25,width:i.width()},l=x.getElementClipSize(t,s);l.bottom>0&&(o=Math.max(0,o-l.bottom)),o-=30,a+=5,l.right>0&&(a=Math.max(0,a-l.right)),r.addClass("open").css({left:a,top:o})}},_.prototype.close=function(){$(this).triggerHandler("beforeContextMenuClose"),$("#"+C.jQueryIdEscape(this.id)).removeClass("open")},_.prototype.isOpen=function(){return $("#"+C.jQueryIdEscape(this.id)).hasClass("open")},_.assignContextMenuToSelector=function(e,t){$(e).on("click",function(e){var n,r;e.stopPropagation(),t.isOpen()?t.close():(n=$(this).offset(),r=$(this).outerHeight(),t.open({pageX:n.left,pageY:n.top+r}))})},T.deprecateConstant(M,"WORKING_SET_MENU","WORKING_SET_CONTEXT_MENU"),T.deprecateConstant(M,"WORKING_SET_SETTINGS_MENU","WORKING_SET_CONFIG_MENU"),t.AppMenuBar=D,t.ContextMenuIds=M,t.MenuSection=O,t.BEFORE=L,t.AFTER=R,t.LAST=N,t.FIRST=A,t.FIRST_IN_SECTION=P,t.LAST_IN_SECTION=F,t.DIVIDER=U,t.getMenu=n,t.getAllMenus=r,t.getMenuItem=s,t.getContextMenu=i,t.addMenu=v,t.removeMenu=y,t.registerContextMenu=b,t.closeAll=g,t.Menu=m,t.MenuItem=h,t.ContextMenu=_}),define("document/TextRange",["require","exports","module"],function(e,t){function n(e,t,n){this.startLine=t,this.endLine=n,this.document=e,e.addRef(),this._handleDocumentChange=this._handleDocumentChange.bind(this),this._handleDocumentDeleted=this._handleDocumentDeleted.bind(this),$(e).on("change",this._handleDocumentChange),$(e).on("deleted",this._handleDocumentDeleted)}n.prototype.dispose=function(){this.document.releaseRef(),$(this.document).off("change",this._handleDocumentChange),$(this.document).off("deleted",this._handleDocumentDeleted)},n.prototype.document=null,n.prototype.startLine=null,n.prototype.endLine=null,n.prototype._applySingleChangeToRange=function(e){if(e.from&&e.to){if(e.from.line<this.startLine&&e.to.line>=this.startLine||e.from.line<=this.endLine&&e.to.line>this.endLine)return this.startLine=null,this.endLine=null,{hasChanged:!0,hasContentChanged:!0};var t=e.text.length-(e.to.line-e.from.line+1),n={hasChanged:!1,hasContentChanged:!1};return 0!==t&&(e.to.line<this.startLine&&(this.startLine+=t,n.hasChanged=!0),e.to.line<=this.endLine&&(this.endLine+=t,n.hasChanged=!0)),e.from.line>=this.startLine&&e.from.line<=this.endLine&&(n.hasContentChanged=!0),n}return this.startLine=null,this.endLine=null,{hasChanged:!0,hasContentChanged:!0}},n.prototype._applyChangesToRange=function(e){var t,n=!1,r=!1;for(t=0;t<e.length;t++){var i=this._applySingleChangeToRange(e[t]);if(n=n||i.hasChanged,r=r||i.hasContentChanged,null===this.startLine||null===this.endLine){$(this).triggerHandler("lostSync");break}}n&&$(this).triggerHandler("change"),r&&$(this).triggerHandler("contentChange")},n.prototype._handleDocumentChange=function(e,t,n){this._applyChangesToRange(n)},n.prototype._handleDocumentDeleted=function(){$(this).triggerHandler("lostSync")},n.prototype.toString=function(){return"[TextRange "+this.startLine+"-"+this.endLine+" in "+this.document+"]"},t.TextRange=n}),define("utils/TokenUtils",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror"],function(e,t){function n(e,t){return{editor:e,pos:t,token:e.getTokenAt(t,!0)}}function r(e,t){if(void 0===t&&(t=!0),e.pos.ch<=0||e.token.start<=0){if(e.pos.line<=0)return!1;e.pos.line--,e.pos.ch=e.editor.getLine(e.pos.line).length}else e.pos.ch=e.token.start;return e.token=e.editor.getTokenAt(e.pos,t),!0}function i(e){return(e.pos.ch<=0||e.token.start<=0)&&e.pos.line<=0}function o(e,t){var n=e.editor.getLine(e.pos.line).length;if(void 0===t&&(t=!0),e.pos.ch>=n||e.token.end>=n){if(e.pos.line>=e.editor.lineCount()-1)return!1;e.pos.line++,e.pos.ch=0}else e.pos.ch=e.token.end+1;return e.token=e.editor.getTokenAt(e.pos,t),!0}function a(e){var t=e.editor.getLine(e.pos.line).length;return(e.pos.ch>=t||e.token.end>=t)&&e.pos.line>=e.editor.lineCount()-1}function s(e,t){if(!e(t))return!1;for(;!t.token.type&&!/\S/.test(t.token.string);)if(!e(t))return!1;return!0}function l(e){var t=e.pos.ch-e.token.start;return 0>t&&console.log("CodeHintUtils: _offsetInToken - Invalid context: pos not in the current token!"),t}function c(e,t){var n,r=e.getMode(),i=u.innerMode(r,e.getTokenAt(t,!0).state);return n="xml"===i.mode.name?i.mode.configuration:i.mode.name,{mode:i.mode,name:n}}var u=e("thirdparty/CodeMirror2/lib/codemirror");t.movePrevToken=r,t.moveNextToken=o,t.isAtStart=i,t.isAtEnd=a,t.moveSkippingWhitespace=s,t.getInitialContext=n,t.offsetInToken=l,t.getModeAt=c}),define("utils/ValidationUtils",["require","exports","module"],function(e,t){function n(e){return"number"!=typeof e||isNaN(parseInt(e,10))?!1:e>0&&Math.floor(e)!==e?!1:0>e&&Math.ceil(e)!==e?!1:!0}function r(e,t,r){if(!n(e))return!1;var i="number"==typeof t,o="number"==typeof r;return(!i||e>=t)&&(!o||r>=e)}t.isInteger=n,t.isIntegerInRange=r}),define("editor/Editor",["require","exports","module","utils/AnimationUtils","utils/Async","thirdparty/CodeMirror2/lib/codemirror","command/Menus","utils/PerfUtils","widgets/PopUpManager","preferences/PreferencesManager","document/TextRange","utils/TokenUtils","utils/ValidationUtils","utils/ViewUtils","thirdparty/lodash"],function(e,t,n){function r(e){return new d.Pos(e.line,e.ch)}function i(e){return e!==q}function o(){return!0}function a(e,t,n,r){var i=this;z.push(this),this.document=e,e.addRef(),n.jquery&&(n=n.get(0));var o=$(n);r&&(this._visibleRange=new g(e,r.startLine,r.endLine)),this._handleDocumentChange=this._handleDocumentChange.bind(this),this._handleDocumentDeleted=this._handleDocumentDeleted.bind(this),this._handleDocumentLanguageChanged=this._handleDocumentLanguageChanged.bind(this),$(e).on("change",this._handleDocumentChange),$(e).on("deleted",this._handleDocumentDeleted),$(e).on("languageChanged",this._handleDocumentLanguageChanged);var a=this._getModeFromDocument();this._inlineWidgets=[],this._inlineWidgetQueues={},this._hideMarks=[],this._lastEditorWidth=null,this._$messagePopover=null;var s={Tab:function(){i._handleTabKey()},"Shift-Tab":"indentLess",Left:function(){i._handleSoftTabNavigation(-1,"moveH")},Right:function(){i._handleSoftTabNavigation(1,"moveH")},Backspace:function(){i._handleSoftTabNavigation(-1,"deleteH")},Delete:function(){i._handleSoftTabNavigation(1,"deleteH")},Esc:function(e){i.getSelections().length>1?d.commands.singleSelection(e):i.removeAllInlineWidgets()},Home:"goLineLeftSmart","Cmd-Left":"goLineLeftSmart",End:"goLineRight","Cmd-Right":"goLineRight"},l=this._currentOptions=b.zipObject(B,b.map(B,function(e){return i._getOption(e)}));o.toggleClass("show-line-padding",Boolean(!this._getOption("showLineNumbers"))),this._codeMirror=new d(n,{autoCloseBrackets:l[E],autoCloseTags:l[w],coverGutterNextToScrollbar:!0,cursorScrollMargin:3,dragDrop:!1,electricChars:!1,extraKeys:s,highlightSelectionMatches:l[S],indentUnit:l[R]?l[O]:l[D],indentWithTabs:l[R],lineNumbers:l[k],lineWrapping:l[L],matchBrackets:{maxScanLineLength:5e4,maxScanLines:1e3},matchTags:{bothTags:!0},showCursorWhenSelecting:l[I],scrollPastEnd:!r&&l[C],smartIndent:l[x],styleActiveLine:l[M],tabSize:l[O]}),this._focused=!1,this._installEditorListeners(),$(this).on("cursorActivity",function(e){i._handleCursorActivity(e)}),$(this).on("keypress",function(e,t,n){i._handleKeypressEvents(n)}),$(this).on("change",function(e,t,n){i._handleEditorChange(n)}),this._codeMirror.setOption("mode",a),this._duringSync=!0,this._resetText(e.getText()),this._duringSync=!1,r&&(this._updateHiddenLines(),this.setCursorPos(r.startLine,0)),t&&e._makeEditable(this),Object.defineProperty(this,"scrollTop",{get:function(){return this._codeMirror.getScrollInfo().top}}),Object.defineProperty(this,"$el",{get:function(){return $(this.getRootElement())}})}function s(e,t){return t.line<e.line||t.line===e.line&&t.ch<e.ch?{start:r(t),end:r(e),reversed:!0}:{start:r(e),end:r(t),reversed:!1}}function l(){var e={};B.forEach(function(t){e[t]="user"}),m.convertPreferences(n,e)}var c=e("utils/AnimationUtils"),u=e("utils/Async"),d=e("thirdparty/CodeMirror2/lib/codemirror"),p=e("command/Menus"),f=e("utils/PerfUtils"),h=e("widgets/PopUpManager"),m=e("preferences/PreferencesManager"),g=e("document/TextRange").TextRange,v=e("utils/TokenUtils"),y=e("utils/ValidationUtils"),_=e("utils/ViewUtils"),b=e("thirdparty/lodash"),E="closeBrackets",w="closeTags",S="highlightMatches",C="scrollPastEnd",I="showCursorWhenSelecting",k="showLineNumbers",x="smartIndent",T="softTabs",D="spaceUnits",M="styleActiveLine",O="tabSize",L="wordWrap",R="useTabChar",A={},N=0,P=1,F=4,U=4,j=10,V=10;A[E]="autoCloseBrackets",A[w]="autoCloseTags",A[S]="highlightSelectionMatches",A[C]="scrollPastEnd",A[I]="showCursorWhenSelecting",A[k]="lineNumbers",A[x]="smartIndent",A[D]="indentUnit",A[M]="styleActiveLine",A[O]="tabSize",A[R]="indentWithTabs",A[L]="lineWrapping",m.definePreference(E,"boolean",!1),m.definePreference(w,"Object",{whenOpening:!0,whenClosing:!0,indentTags:[]}),m.definePreference(S,"boolean",!1),m.definePreference(C,"boolean",!1),m.definePreference(I,"boolean",!1),m.definePreference(k,"boolean",!0),m.definePreference(x,"boolean",!0),m.definePreference(T,"boolean",!0),m.definePreference(D,"number",F,{validator:b.partialRight(y.isIntegerInRange,N,j)}),m.definePreference(M,"boolean",!1),m.definePreference(O,"number",U,{validator:b.partialRight(y.isIntegerInRange,P,V)}),m.definePreference(R,"boolean",!1),m.definePreference(L,"boolean",!0);var B=Object.keys(A),W=!1,H=0,q=1,z=[];a.prototype.destroy=function(){$(this).triggerHandler("beforeDestroy",[this]),$(this.getRootElement()).remove(),z.splice(z.indexOf(this),1),this.document.releaseRef(),$(this.document).off("change",this._handleDocumentChange),$(this.document).off("deleted",this._handleDocumentDeleted),$(this.document).off("languageChanged",this._handleDocumentLanguageChanged),this._visibleRange&&this._visibleRange.dispose(),this.document._masterEditor===this&&this.document._makeNonEditable();var e=this;this._inlineWidgets.forEach(function(t){e._removeInlineWidgetInternal(t)})},a.prototype._checkElectricChars=function(e){var t=this._codeMirror,n=String.fromCharCode(e.which||e.keyCode);if(/[\]\{\}\)]/.test(n)){var r=this.getCursorPos(),i=t.getLine(r.line),o=i.search(/\S/);(-1===o||o>=r.ch)&&(-1===o&&this.setCursorPos(r.line,this.document.getLine(r.line).length),window.setTimeout(function(){t.indentLine(r.line)},75))}},a.prototype._handleCursorActivity=function(){this._updateStyleActiveLine()},a.prototype._handleKeypressEvents=function(e){this._checkElectricChars(e)},a.prototype._addIndentAtEachSelection=function(e){var t=this._codeMirror,n=t.getOption("indentWithTabs"),r=t.getOption("indentUnit"),i=[];b.each(e,function(e){var t,o,a="";if(n)a=" ";else for(o=r-e.start.ch%r,t=0;o>t;t++)a+=" ";i.push({edit:{text:a,start:e.start}})}),this.document.doMultipleEdits(i)},a.prototype._autoIndentEachSelection=function(e){var t=this._codeMirror,n={};b.each(e,function(e){n[e.start.line]=t.getLine(e.start.line).length}),d.commands.indentAuto(t);var r=!1,i=this.getSelections();i.length===e.length?b.each(e,function(e,o){var a=i[o];return 0!==d.cmpPos(e.start,a.start)||0!==d.cmpPos(e.end,a.end)||t.getLine(e.start.line).length!==n[e.start.line]?(r=!0,!1):void 0}):r=!0,r||d.commands.indentMore(t)},a.prototype._handleTabKey=function(){var e=this._codeMirror,t="indentAuto",n=this.getSelections();switch(b.each(n,function(n){return n.start.line!==n.end.line?(t="indentAtBeginning",!1):void(n.end.ch>0&&n.end.ch>=e.getLine(n.end.line).search(/\S/)&&(t="indentAtSelection"))}),t){case"indentAtBeginning":d.commands.indentMore(e);break;case"indentAtSelection":this._addIndentAtEachSelection(n);break;case"indentAuto":this._autoIndentEachSelection(n)}},a.prototype._handleSoftTabNavigation=function(e,t){var n=this._codeMirror,r=null;if(!n.getOption("indentWithTabs")&&m.get(T)){var i=n.getOption("indentUnit");b.each(this.getSelections(),function(t){if(0===d.cmpPos(t.start,t.end)){var o=t.start,a=o.ch%i,s=n.getLine(o.line);return-1!==s.substr(0,o.ch).search(/\S/)?a=null:1===e?(a=i-a,(o.ch+a>s.length||-1!==s.substr(o.ch,a).search(/\S/))&&(a=null)):(0===a&&(a=i),a=o.ch-a<0?null:-a),null===a||null!==r&&r!==a?(r=null,!1):void(r=a)}})}null===r&&(r=e),n[t](r,"char")},a.prototype._getModeFromDocument=function(){return this.document.getLanguage().getMode()||"text/plain"},a.prototype.selectAllNoScroll=function(){var e=this._codeMirror,t=this._codeMirror.getScrollInfo();e.operation(function(){e.scrollTo(t.left,t.top),e.execCommand("selectAll")})},a.prototype.isTextSubset=function(){return Boolean(this._visibleRange)},a.prototype._updateHiddenLines=function(){if(this._visibleRange){var e=this._codeMirror,t=this;e.operation(function(){t._hideMarks.forEach(function(e){e&&e.clear()}),t._hideMarks=[],t._hideMarks.push(t._hideLines(0,t._visibleRange.startLine)),t._hideMarks.push(t._hideLines(t._visibleRange.endLine+1,t.lineCount()))
17})}},a.prototype._applyChanges=function(e){if(this._visibleRange&&(null===this._visibleRange.startLine||null===this._visibleRange.endLine))return void $(this).triggerHandler("lostContent");var t=this._codeMirror;t.operation(function(){var n,r,i;for(i=0;i<e.length;i++)n=e[i],r=n.text.join("\n"),n.from&&n.to?t.replaceRange(r,n.from,n.to,n.origin):((n.from||n.to)&&console.error("Change record received with only one end undefined--replacing entire text"),t.setValue(r))}),this._updateHiddenLines()},a.prototype._handleEditorChange=function(e){this._duringSync||(this.document._ensureMasterEditor(),this.document._masterEditor!==this&&(this._duringSync=!0,this.document._masterEditor._applyChanges(e),this._duringSync=!1,this._updateHiddenLines()),$(this).triggerHandler("editorChange",[this,e]))},a.prototype._handleDocumentChange=function(e,t,n){this._duringSync||this.document._masterEditor!==this&&(this._duringSync=!0,this._applyChanges(n),this._duringSync=!1)},a.prototype._handleDocumentDeleted=function(e){$(this).triggerHandler("lostContent",[e])},a.prototype._handleDocumentLanguageChanged=function(){this._codeMirror.setOption("mode",this._getModeFromDocument())},a.prototype._installEditorListeners=function(){function e(e,n){return $(t).triggerHandler("keyEvent",[t,n]),$(t).triggerHandler(n.type,[t,n]),n.defaultPrevented}var t=this;this._codeMirror.on("keydown",e),this._codeMirror.on("keypress",e),this._codeMirror.on("keyup",e),this._codeMirror.on("changes",function(e,n){$(t).triggerHandler("change",[t,n])}),this._codeMirror.on("beforeChange",function(e,n){$(t).triggerHandler("beforeChange",[t,n])}),this._codeMirror.on("cursorActivity",function(){$(t).triggerHandler("cursorActivity",[t])}),this._codeMirror.on("scroll",function(){t.isFullyVisible()&&p.closeAll(),$(t).triggerHandler("scroll",[t])}),this._codeMirror.on("focus",function(){t._focused=!0,$(t).triggerHandler("focus",[t])}),this._codeMirror.on("blur",function(){t._focused=!1,$(t).triggerHandler("blur",[t])}),this._codeMirror.on("update",function(){$(t).triggerHandler("update",[t])}),this._codeMirror.on("overwriteToggle",function(e,n){$(t).triggerHandler("overwriteToggle",[t,n])})},a.prototype._resetText=function(e){var t=f.markStart("Editor._resetText() "+(!this.document||this.document.file.fullPath)),n=this.getCursorPos(),r=this.getScrollPos();this._codeMirror.setValue(e),this._codeMirror.clearHistory(),this._codeMirror.markClean(),this.setCursorPos(n),this.setScrollPos(r.x,r.y),f.addMeasurement(t)},a.prototype.getFile=function(){return this.document.file},a.prototype.getCursorPos=function(e,t){"start"===t?t="from":"end"===t&&(t="to");var n=r(this._codeMirror.getCursor(t));return e&&(n.ch=this.getColOffset(n)),n},a.prototype.getColOffset=function(e){var t,n=this._codeMirror.getRange({line:e.line,ch:0},e),r=null,i=0;for(t=0;t<n.length;t++)" "===n[t]?(null===r&&(r=a.getTabSize()),r>0&&(i+=r-i%r)):i++;return i},a.prototype.getCharIndexForColumn=function(e,t){var n,r=this._codeMirror.getLine(e),i=null,o=0;for(n=0;t>o;n++)" "===r[n]?(null===i&&(i=a.getTabSize()),i>0&&(o+=i-o%i)):o++;return n},a.prototype.setCursorPos=function(e,t,n,r){r&&(t=this.getColOffset({line:e,ch:t})),this._codeMirror.setCursor(e,t),n&&this.centerOnCursor()},a.prototype.setSize=function(e,t){this._codeMirror.setSize(e,t)};var G=.15;a.prototype.centerOnCursor=function(e){var t=$(this.getScrollerElement()),n=t.height(),r=t.outerHeight()-n,a=t.offset().top,s=this._codeMirror.cursorCoords(null,"local").bottom,l=this._codeMirror.cursorCoords(null,"page").bottom-a;if(i(e)&&n*G>l||o(e)&&l>n*(1-G)){var c=s-n/2+r,u=this._codeMirror.getScrollInfo();c=Math.min(Math.max(c,0),u.height-u.clientHeight),this.setScrollPos(null,c)}},a.prototype.indexFromPos=function(e){return this._codeMirror.indexFromPos(e)},a.prototype.posWithinRange=function(e,t,n,r){return t.line<=e.line&&n.line>=e.line?r?(t.line<e.line||t.ch<=e.ch)&&(n.line>e.line||n.ch>=e.ch):(t.line<e.line||t.ch<=e.ch)&&(n.line>e.line||n.ch>e.ch):!1},a.prototype.hasSelection=function(){return this._codeMirror.somethingSelected()},a.prototype.getSelection=function(){return s(this.getCursorPos(!1,"anchor"),this.getCursorPos(!1,"head"))},a.prototype.getSelections=function(){var e=this.getSelection();return b.map(this._codeMirror.listSelections(),function(t){var n=s(t.anchor,t.head);return n.primary=n.start.line===e.start.line&&n.start.ch===e.start.ch&&n.end.line===e.end.line&&n.end.ch===e.end.ch?!0:!1,n})},a.prototype.convertToLineSelections=function(e,t){var n=this;t=t||{},b.defaults(t,{expandEndAtStartOfLine:!1,mergeAdjacent:!0});var r,i=[];return b.each(e,function(e){var o=b.cloneDeep(e);o.start.ch=0;var a=o.start.line!==o.end.line||o.start.ch!==o.end.ch;(t.expandEndAtStartOfLine||!a||0!==o.end.ch)&&(o.end={line:o.end.line+1,ch:0}),r&&n.posWithinRange(o.start,r.selectionForEdit.start,r.selectionForEdit.end,t.mergeAdjacent)?(r.selectionForEdit.end.line=o.end.line,r.selectionsToTrack.push(e)):(r={selectionForEdit:o,selectionsToTrack:[e]},i.push(r))}),i},a.prototype.getSelectedText=function(e){if(e)return this._codeMirror.getSelection();var t=this.getSelection();return this.document.getRange(t.start,t.end)},a.prototype.setSelection=function(e,t,n,r,i){this.setSelections([{start:e,end:t||e}],n,r,i)},a.prototype.setSelections=function(e,t,n,r){var i,o=e.length-1;r&&(i={origin:r}),this._codeMirror.setSelections(b.map(e,function(e,t){return e.primary&&(o=t),{anchor:e.reversed?e.end:e.start,head:e.reversed?e.start:e.end}}),o,i),t&&this.centerOnCursor(n)},a.prototype.toggleOverwrite=function(e){this._codeMirror.toggleOverwrite(e)},a.prototype.selectWordAt=function(e){function t(e){return/\w/.test(e)||e.toUpperCase()!==e.toLowerCase()}for(var n=this.document.getLine(e.line),r=e.ch,i=e.ch;r>0&&t(n.charAt(r-1));)--r;for(;i<n.length&&t(n.charAt(i));)++i;this.setSelection({line:e.line,ch:r},{line:e.line,ch:i})},a.prototype.lineCount=function(){return this._codeMirror.lineCount()},a.prototype.isLineVisible=function(e){var t=this._codeMirror.charCoords({line:e,ch:0},"local"),n=this._codeMirror.getScrollInfo(),r=n.top,i=n.top+n.clientHeight;return t.top>=r&&t.bottom<=i},a.prototype.getFirstVisibleLine=function(){return this._visibleRange?this._visibleRange.startLine:0},a.prototype.getLastVisibleLine=function(){return this._visibleRange?this._visibleRange.endLine:this.lineCount()-1},a.prototype._hideLines=function(e,t){if(!(e>=t)){var n=this._codeMirror.markText({line:e,ch:0},{line:t-1,ch:this._codeMirror.getLine(t-1).length},{collapsed:!0,inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1});return n}},a.prototype.totalHeight=function(){return this.getScrollerElement().scrollHeight},a.prototype.getScrollerElement=function(){return this._codeMirror.getScrollerElement()},a.prototype.getRootElement=function(){return this._codeMirror.getWrapperElement()},a.prototype._getLineSpaceElement=function(){return $(".CodeMirror-lines",this.getScrollerElement()).children().get(0)},a.prototype.getScrollPos=function(){var e=this._codeMirror.getScrollInfo();return{x:e.left,y:e.top}},a.prototype.adjustScrollPos=function(e,t){this._codeMirror.scrollTo(e.x,e.y+t)},a.prototype.setScrollPos=function(e,t){this._codeMirror.scrollTo(e,t)},a.prototype.getTextHeight=function(){return this._codeMirror.defaultTextHeight()},a.prototype.addInlineWidget=function(e,t,n){var r=this,i=this._inlineWidgetQueues[e.line],o=new $.Deferred;return i||(i=new u.PromiseQueue,this._inlineWidgetQueues[e.line]=i),i.add(function(){return r._addInlineWidgetInternal(e,t,n,o),o.promise()}),o.promise()},a.prototype._addInlineWidgetInternal=function(e,t,n,r){var i=this;this.removeAllInlineWidgetsForLine(e.line).done(function(){void 0===n&&(n=!0),n&&i._codeMirror.scrollIntoView(e),t.info=i._codeMirror.addLineWidget(e.line,t.htmlContent,{coverGutter:!0,noHScroll:!0}),d.on(t.info.line,"delete",function(){i._removeInlineWidgetInternal(t)}),i._inlineWidgets.push(t),t.$htmlContent.height(0),c.animateUsingClass(t.htmlContent,"animating").done(function(){r.resolve()}),t.onAdded()})},a.prototype.removeAllInlineWidgets=function(){var e=[].concat(this.getInlineWidgets());return u.doInParallel(e,this.removeInlineWidget.bind(this))},a.prototype.removeInlineWidget=function(e){function t(){r._codeMirror.removeLineWidget(e.info),r._removeInlineWidgetInternal(e),n.resolve()}var n=new $.Deferred,r=this;return e.closePromise||(r._removeInlineWidgetFromList(e),r.isFullyVisible()?(c.animateUsingClass(e.htmlContent,"animating").done(t),e.$htmlContent.height(0)):t(),e.closePromise=n.promise()),e.closePromise},a.prototype.removeAllInlineWidgetsForLine=function(e){var t=this._codeMirror.lineInfo(e),n=t&&t.widgets?[].concat(t.widgets):null,r=this;if(n&&n.length){var i,o=this._inlineWidgets.map(function(e){return e.info});return u.doInParallel(n,function(e){return i=r._inlineWidgets[o.indexOf(e)],i?r.removeInlineWidget(i):(new $.Deferred).resolve().promise()})}return(new $.Deferred).resolve().promise()},a.prototype._removeInlineWidgetFromList=function(e){var t,n=this._inlineWidgets.length;for(t=0;n>t;t++)if(this._inlineWidgets[t]===e){this._inlineWidgets.splice(t,1);break}},a.prototype._removeInlineWidgetInternal=function(e){e.isClosed||(this._removeInlineWidgetFromList(e),e.onClosed(),e.isClosed=!0)},a.prototype.getInlineWidgets=function(){return this._inlineWidgets},a.prototype.getFocusedInlineWidget=function(){var e=null;return this.getInlineWidgets().forEach(function(t){t.hasFocus()&&(e=t)}),e},a.prototype.displayErrorMessageAtCursor=function(e){function t(){$(g).off(".msgbox")}function n(){g._$messagePopover&&g._$messagePopover.length>0&&(g._$messagePopover=null),t()}function r(){g._$messagePopover&&h.removePopUp(g._$messagePopover)}function i(){$(g).on("blur.msgbox",r).on("change.msgbox",r).on("cursorActivity.msgbox",r).on("update.msgbox",r)}var o,a,s,l,u,d,p,f,m,g=this,v=10,y=10,b=y+3;this._$messagePopover&&r(),a=this.getCursorPos(),this._codeMirror.scrollIntoView(a),s=this._codeMirror.charCoords(a),o=s.top>100,this._$messagePopover=$("<div/>").addClass("popover-message").appendTo($("body")),o||$("<div/>").addClass("arrowAbove").appendTo(this._$messagePopover),$("<div/>").addClass("text").appendTo(this._$messagePopover).html(e),o&&$("<div/>").addClass("arrowBelow").appendTo(this._$messagePopover),u=o?s.top-this._$messagePopover.height()-v:s.bottom+v,d=s.left-this._$messagePopover.width()/2,l={top:u,left:d,height:this._$messagePopover.height(),width:this._$messagePopover.width()},p=_.getElementClipSize($("#editor-holder"),l),p.left>0?d+=p.left:p.right>0&&(d-=p.right),this._$messagePopover.css({top:u,left:d}),f=s.left-d,f=Math.min(l.width-b,Math.max(f,b)),m=f-y,o?this._$messagePopover.find(".arrowBelow").css({"margin-left":m}):this._$messagePopover.find(".arrowAbove").css({"margin-left":m}),h.addPopUp(this._$messagePopover,n,!0),i(),c.animateUsingClass(this._$messagePopover[0],"animateOpen").done(function(){g._$messagePopover&&g._$messagePopover.length>0&&(g._$messagePopover.addClass("open"),$(g).on("scroll.msgbox",r),c.animateUsingClass(g._$messagePopover[0],"animateClose",6e3).done(r))})},a.prototype.getVirtualScrollAreaTop=function(){var e=this._getLineSpaceElement().offsetTop,t=this.getScrollerElement();return $(t).offset().top-t.scrollTop+e},a.prototype.setInlineWidgetHeight=function(e,t,n){function r(){c&&e.info.changed()}function i(){function e(t){t.target===a&&(r(),$(a).off("webkitTransitionEnd",e))}$(a).height(t),$(a).hasClass("animating")?$(a).on("webkitTransitionEnd",e):r()}var o=this,a=e.htmlContent,s=a&&$(a).height()||0,l=s!==t,c=void 0!==e.info;if((l||!a.style.height)&&($(a).hasClass("animating")?window.setTimeout(i,0):i()),n&&c){var u=$(a).offset(),d=$(a).position(),p=o.getVirtualScrollAreaTop();o._codeMirror.scrollIntoView({left:d.left,top:u.top-p,right:d.left,bottom:u.top+t-p})}},a.prototype._getInlineWidgetLineNumber=function(e){return this._codeMirror.getLineNumber(e.info.line)},a.prototype.focus=function(){if(!W){W=!0;try{this._codeMirror.focus()}finally{W=!1}}},a.prototype.hasFocus=function(){return this._focused},a.prototype.getViewState=function(){return{selections:this.getSelections(),scrollPos:this.getScrollPos()}},a.prototype.restoreViewState=function(e){e.selection&&this.setSelection(e.selection.start,e.selection.end),e.selections&&this.setSelections(e.selections),e.scrollPos&&this.setScrollPos(e.scrollPos.x,e.scrollPos.y)},a.prototype.refresh=function(){var e=window.document.activeElement,t=$.contains(this._codeMirror.getScrollerElement(),e);this._codeMirror.refresh(),t&&e.focus()},a.prototype.refreshAll=function(e){this.refresh(e),this.getInlineWidgets().forEach(function(e){e.refresh()})},a.prototype.undo=function(){this._codeMirror.undo()},a.prototype.redo=function(){this._codeMirror.redo()},a.prototype.notifyVisibilityChange=function(e,t){e&&(t||void 0===t)&&this.refresh(),e&&this._inlineWidgets.forEach(function(e){e.onParentShown()})},a.prototype.setVisible=function(e,t){this.$el.css("display",e?"":"none"),this.notifyVisibilityChange(e,t)},a.prototype.isFullyVisible=function(){return $(this.getRootElement()).is(":visible")},a.prototype.getModeForRange=function(e,t,n){var r=this._codeMirror.getMode(),i=v.getModeAt(this._codeMirror,e),o=v.getModeAt(this._codeMirror,t);return n||r.name!==i.name?i&&o&&i.name===o.name?i:null:this._codeMirror.getOption("mode")},a.prototype.getModeForSelection=function(){var e=this,t=this.getSelections(),n=this.getSelection(),r=this._codeMirror.getMode(),i=v.getModeAt(this._codeMirror,n.start),o=r.name!==i.name;if(o){if(n.start.line!==n.end.line||n.start.ch!==n.end.ch){var a=v.getModeAt(this._codeMirror,n.end);if(i.name!==a.name)return null}var s=b.some(t,function(r){if(t===n)return!1;var o=e.getModeForRange(r.start,r.end,!0);return!o||o.name!==i.name});return s?null:i.name}return this._codeMirror.getOption("mode")},a.prototype.getLanguageForSelection=function(){return this.document.getLanguage().getLanguageForMode(this.getModeForSelection())},a.prototype.getModeForDocument=function(){return this._codeMirror.getOption("mode")},a.prototype.document=null,a.prototype._lastEditorWidth=null,a.prototype._duringSync=!1,a.prototype._codeMirror=null,a.prototype._inlineWidgets=null,a.prototype._visibleRange=null,a.prototype._inlineWidgetQueues=null,a.prototype._hideMarks=null,a.prototype._getOption=function(e){return m.get(e,this.document.file.fullPath)},a.prototype._updateOption=function(e){var t=this._currentOptions[e],n=this._getOption(e);if(t!==n){if(this._currentOptions[e]=n,e===R)this._codeMirror.setOption(A[e],n),this._codeMirror.setOption("indentUnit",n===!0?this._currentOptions[O]:this._currentOptions[D]);else if(e===M)this._updateStyleActiveLine();else{if(e===C&&this._visibleRange)return;e===k?(a._toggleLinePadding(!n),this._codeMirror.setOption(A[k],n),this.refreshAll()):this._codeMirror.setOption(A[e],n)}$(this).triggerHandler("optionChange",[e,n])}},a.prototype._updateStyleActiveLine=function(){this.hasSelection()?this._codeMirror.getOption("styleActiveLine")&&this._codeMirror.setOption("styleActiveLine",!1):this._codeMirror.setOption("styleActiveLine",this._currentOptions[M])},a.prototype.updateLayout=function(e){var t=this.getRootElement(),n=$(t).width(),r=this.$el.parent(),i=r.height();t.style.height&&$(t).height()===i?n!==this._lastEditorWidth&&void 0===e&&(e=!0):(this.setSize(null,i),void 0===e&&(e=!0)),this._lastEditorWidth=n,e&&this.refreshAll(e)},a.setUseTabChar=function(e,t){var n=t&&{context:t};return m.set(R,e,n)},a.getUseTabChar=function(e){return m.get(R,e)},a.setTabSize=function(e,t){var n=t&&{context:t};return m.set(O,e,n)},a.getTabSize=function(e){return m.get(O,e)},a.setSpaceUnits=function(e,t){var n=t&&{context:t};return m.set(D,e,n)},a.getSpaceUnits=function(e){return m.get(D,e)},a.setCloseBrackets=function(e,t){var n=t&&{context:t};return m.set(E,e,n)},a.getCloseBrackets=function(e){return m.get(E,e)},a.setShowLineNumbers=function(e,t){var n=t&&{context:t};return m.set(k,e,n)},a.getShowLineNumbers=function(e){return m.get(k,e)},a.setShowActiveLine=function(e){return m.set(M,e)},a.getShowActiveLine=function(e){return m.get(M,e)},a.setWordWrap=function(e,t){var n=t&&{context:t};return m.set(L,e,n)},a.getWordWrap=function(e){return m.get(L,e)},a._toggleLinePadding=function(e){var t=[];z.forEach(function(e){var n=e.$el.parent();-1===t.indexOf(n)&&t.push(n)}),b.each(t,function(t){t.toggleClass("show-line-padding",Boolean(e))})},B.forEach(function(e){m.on("change",e,function(){z.forEach(function(t){t._updateOption(e)})})}),l(),t.Editor=a,t.BOUNDARY_CHECK_NORMAL=H,t.BOUNDARY_IGNORE_TOP=q}),define("editor/InlineWidget",["require","exports","module","editor/EditorManager","utils/KeyEvent"],function(e,t){function n(){var e=this;this.htmlContent=window.document.createElement("div"),this.$htmlContent=$(this.htmlContent).addClass("inline-widget no-focus").attr("tabindex","-1"),this.$htmlContent.append("<div class='shadow top' />").append("<div class='shadow bottom' />").append("<a href='#' class='close no-focus'>&times;</a>"),this.$closeBtn=this.$htmlContent.find(".close"),this.$closeBtn.click(function(t){e.close(),t.stopImmediatePropagation()}),this.$htmlContent.on("keydown",function(t){t.keyCode===i.DOM_VK_ESCAPE&&(e.close(),t.stopImmediatePropagation())})}var r=e("editor/EditorManager"),i=e("utils/KeyEvent");n.prototype.htmlContent=null,n.prototype.$htmlContent=null,n.prototype.id=null,n.prototype.hostEditor=null,n.prototype.height=0,n.prototype.close=function(){return r.closeInlineWidget(this.hostEditor,this)},n.prototype.hasFocus=function(){var e=window.document.activeElement,t=this.$htmlContent[0];return $.contains(t,e)||t===e},n.prototype.onClosed=function(){$(this).triggerHandler("close")},n.prototype.onAdded=function(){$(this).triggerHandler("add")},n.prototype.load=function(e){this.hostEditor=e},n.prototype.onParentShown=function(){},n.prototype.refresh=function(){},t.InlineWidget=n}),define("editor/InlineTextEditor",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror","document/DocumentManager","editor/EditorManager","command/CommandManager","command/Commands","editor/InlineWidget","utils/KeyEvent"],function(e,t){function n(e,t){e.css("width",t?16:0)}function r(e,t){var r,i=$(".inline-text-editor .dirty-indicator");i.each(function(){r=$(this),r.data("fullPath")===t.file.fullPath&&n(r,t.isDirty)})}function i(){d.call(this),this.editor=null,this.handleKeyDown=this.handleKeyDown.bind(this),this.htmlContent.addEventListener("keydown",this.handleKeyDown,!0)}function o(e){var t=l.getInlineEditors(e);t.push(e);var n=0;return t.forEach(function(e){var t=$(e._codeMirror.getGutterElement()).find(".CodeMirror-linenumbers");t.css("min-width","");var r=t.width();r>n&&(n=r)}),1===t.length?void t[0]._codeMirror.setOption("gutters",t[0]._codeMirror.getOption("gutters")):(n+="px",void t.forEach(function(e){$(e._codeMirror.getGutterElement()).find(".CodeMirror-linenumbers").css("min-width",n),e._codeMirror.setOption("gutters",e._codeMirror.getOption("gutters"))}))}var a=e("thirdparty/CodeMirror2/lib/codemirror"),s=e("document/DocumentManager"),l=e("editor/EditorManager"),c=e("command/CommandManager"),u=e("command/Commands"),d=e("editor/InlineWidget").InlineWidget,p=e("utils/KeyEvent");i.prototype=Object.create(d.prototype),i.prototype.constructor=i,i.prototype.parentClass=d.prototype,i.prototype.$wrapper=null,i.prototype.editor=null,i.prototype.$editorHolder=null,i.prototype.$header=null,i.prototype.$filename=null,i.prototype.onClosed=function(){i.prototype.parentClass.onClosed.apply(this,arguments),o(this.hostEditor),this.setInlineContent(null),this.htmlContent.removeEventListener("keydown",this.handleKeyDown,!0)},i.prototype.sizeInlineWidgetToContents=function(){},i.prototype.onAdded=function(){var e=this;i.prototype.parentClass.onAdded.apply(this,arguments),this.editor&&this.editor.refresh(),a.on(this.info,"redraw",function(){window.setTimeout(function(){e.editor&&e.editor.refresh()},0)}),o(this.hostEditor),this.editor&&this.editor.focus()},i.prototype.getFocusedEditor=function(){return this.editor&&this.editor.hasFocus()?this.editor:null},i.prototype.handleKeyDown=function(e){e.keyCode===p.DOM_VK_ESCAPE&&this.editor&&this.editor.getSelections().length>1&&(a.commands.singleSelection(this.editor._codeMirror),e.stopImmediatePropagation())},i.prototype.setInlineContent=function(e,t,r){var i=this;if(this.editor&&($(this.editor).off(".InlineTextEditor"),this.editor.destroy(),this.editor=null,this.$filename.off(".InlineTextEditor").removeAttr("title"),this.$filename.html("")),e){var o={startLine:t,endLine:r},a=$("<div/>").addClass("dirty-indicator").html("&bull;").width(0);a.data("fullPath",e.file.fullPath),this.$lineNumber=$("<span class='line-number'/>"),this.$filename.append(a).append(e.file.name+" : ").append(this.$lineNumber).attr("title",e.file.fullPath),this.$filename.on("click.InlineTextEditor",function(){c.execute(u.FILE_OPEN,{fullPath:e.file.fullPath}).done(function(){l.getCurrentFullEditor().setCursorPos(t,0,!0)})});var s=l.createInlineEditorForDocument(e,o,this.$editorHolder.get(0));this.editor=s.editor,this._updateLineRange(s.editor),$(this.editor).on("update.InlineTextEditor",function(){i.sizeInlineWidgetToContents(!0)}),$(this.editor).on("change.InlineTextEditor",function(e,t){i.hostEditor.isFullyVisible()&&(i.sizeInlineWidgetToContents(!0),i._updateLineRange(t))}),$(this.editor).on("lostContent.InlineTextEditor",function(){i._onLostContent.apply(i,arguments)}),n(a,e.isDirty)}},i.prototype._updateLineRange=function(e){this._startLine=e.getFirstVisibleLine(),this._endLine=e.getLastVisibleLine(),this._lineCount=this._endLine-this._startLine,this.$lineNumber.text(this._startLine+1)},i.prototype.load=function(){i.prototype.parentClass.load.apply(this,arguments),this.$wrapper=$("<div/>").addClass("inline-text-editor").appendTo(this.$htmlContent),this.$header=$("<div/>").addClass("inline-editor-header").appendTo(this.$wrapper),this.$filename=$("<a/>").addClass("filename").appendTo(this.$header),this.$editorHolder=$("<div/>").addClass("inline-editor-holder").appendTo(this.$wrapper)},i.prototype.onParentShown=function(){i.prototype.parentClass.onParentShown.apply(this,arguments),this.editor&&(this._updateLineRange(this.editor),this.editor.refresh()),this.sizeInlineWidgetToContents(!0)},i.prototype._onLostContent=function(){this.close()},$(s).on("dirtyFlagChange",r),t.InlineTextEditor=i}),define("editor/EditorManager",["require","exports","module","command/Commands","view/WorkspaceManager","preferences/PreferencesManager","command/CommandManager","document/DocumentManager","view/MainViewManager","view/ViewStateManager","utils/PerfUtils","editor/Editor","editor/InlineTextEditor","strings","language/LanguageManager","utils/DeprecationWarning"],function(e,t){function n(){var e=j.getCurrentlyViewedPath(j.ACTIVE_PANE),t=e&&U.getOpenDocumentForPath(e);return t&&t._masterEditor}function r(e){V.updateViewState(e)}function i(e){var t=V.getViewState(e.document.file);t&&e.restoreViewState(t)}function o(e){if(K!==e){var n=K;K=e,$(t).triggerHandler("activeEditorChange",[e,n])}}function a(e,t){var n=t&&U.getOpenDocumentForPath(t.fullPath);o(n&&n._masterEditor)}function s(e,t,n,i){var a=new W(e,t,n,i);return $(a).on("focus",function(){o(this)}),$(a).on("beforeDestroy",function(){a.$el.is(":visible")&&r(a)}),a}function l(e,t,n){B.markStart(B.INLINE_WIDGET_OPEN);var r,i,o,a,s=e.getCursorPos(),l=new $.Deferred;for(i=0;i<t.length&&!r;i++){var c=t[i].provider;a=c(e,s),a&&(a.hasOwnProperty("done")?r=a:o||"string"!=typeof a||(o=a))}return o=o||n,r?r.done(function(t){e.addInlineWidget(s,t).done(function(){B.addMeasurement(B.INLINE_WIDGET_OPEN),l.resolve()})}).fail(function(){B.finalizeMeasurement(B.INLINE_WIDGET_OPEN),e.displayErrorMessageAtCursor(o),l.reject()}):(B.finalizeMeasurement(B.INLINE_WIDGET_OPEN),e.displayErrorMessageAtCursor(o),l.reject()),l.promise()}function c(e,t){var r=new $.Deferred,i=n();if(i){var o=i.getFocusedInlineWidget();o?(B.markStart(B.INLINE_WIDGET_CLOSE),o.close().done(function(){B.addMeasurement(B.INLINE_WIDGET_CLOSE),r.resolve(!1)})):l(i,e,t).done(function(){r.resolve(!0)}).fail(function(){r.reject()})}else r.reject();return r.promise()}function u(e,t,n){var r,i={priority:n,provider:t};for(r=0;r<e.length&&!(e[r].priority<n);r++);e.splice(r,0,i)}function d(e){R||(R=$("#hidden-editors"));var t=s(e,!0,R);t.setVisible(!1)}function p(e,t){if(t.hasFocus()){var n=e._codeMirror.getLineNumber(t.info.line),r=e.getCursorPos().line;r!==n&&e.setCursorPos({line:n,pos:0}),e.focus()}return e.removeInlineWidget(t)}function f(e,t){void 0===t&&(t=0),u(X,e,t)}function h(e,t){void 0===t&&(t=0),u(Y,e,t)}function m(e){Q.push(e)}function g(e){var t=[];return e&&e.getInlineWidgets().forEach(function(e){e instanceof H&&e.editor&&t.push(e.editor)}),t}function v(e,n){var r=s(e,!0,n.$content);r.setVisible(!1),n.addView(r),$(t).triggerHandler("_fullEditorCreatedForDocument",[e,r,n.id])}function y(e,t,n){$(n).hide();var r=s(e,!1,n,t);return $(n).show(),{content:n,editor:r}}function _(){G.deprecationWarning("Use MainViewManager.focusActivePane() instead of EditorManager.focusEditor().",!0),j.focusActivePane()}function b(){G.deprecationWarning("Use WorkspaceManager.recomputeLayout() instead of EditorManager.resizeEditor().",!0),N.recomputeLayout()}function E(e,t){var n=!1,r=e._masterEditor;r?r.$el.parent()!==t.$el&&t.addView(r):(n=!0,window.getSelection&&window.getSelection().empty&&window.getSelection().empty(),v(e,t)),t.showView(e._masterEditor),j.getActivePaneId()===t.id&&e._masterEditor.focus(),n&&i(e._masterEditor)}function w(){G.deprecationWarning("Use MainViewManager.getCurrentlyViewedFile() instead of EditorManager.getCurrentlyViewedPath().",!0);var e,t=j.getCurrentlyViewedPath(j.ACTIVE_PANE);return t&&(e=U.getOpenDocumentForPath(t)),e?t:null}function S(){throw new Error("EditorManager.setEditorHolder() has been removed.")}function C(){throw new Error("EditorManager.registerCustomViewer() has been removed.")}function I(e){return!z.getLanguageForPath(e).isBinary()}function k(e,t){var n=B.markStart("EditorManager.openDocument(): "+(!e||e.file.fullPath));e&&t&&E(e,t),B.addMeasurement(n)}function x(){var e=n();return e?e.getFocusedInlineWidget():null}function T(){var e=x();return e instanceof H?e.getFocusedEditor():null}function D(){var e=n();if(e){var t=T();if(t)return t;if(e.hasFocus())return e}return null}function M(){return K}function O(){var e,t,n=Q,r=new $.Deferred,i=M();if(i){var o=i.getCursorPos();for(B.markStart(B.JUMP_TO_DEFINITION),t=0;t<n.length&&!e;t++){var a=n[t];e=a(i,o)}e?e.done(function(){B.addMeasurement(B.JUMP_TO_DEFINITION),r.resolve()}).fail(function(){B.finalizeMeasurement(B.JUMP_TO_DEFINITION),r.reject()}):(B.finalizeMeasurement(B.JUMP_TO_DEFINITION),r.reject())}else r.reject();return r.promise()}function L(e,t){var n=function(e){var t=U.getOpenDocumentForPath(e.fullPath);t&&j._destroyEditorIfNotNeeded(t)};$.isArray(t)?t.forEach(function(e){n(e)}):n(t)}var R,A=e("command/Commands"),N=e("view/WorkspaceManager"),P=e("preferences/PreferencesManager"),F=e("command/CommandManager"),U=e("document/DocumentManager"),j=e("view/MainViewManager"),V=e("view/ViewStateManager"),B=e("utils/PerfUtils"),W=e("editor/Editor").Editor,H=e("editor/InlineTextEditor").InlineTextEditor,q=e("strings"),z=e("language/LanguageManager"),G=e("utils/DeprecationWarning"),K=null,X=[],Y=[],Q=[];$(t).on("activeEditorChange",function(e,t){t&&t.document&&t.document.file&&P._setCurrentEditingFile(t.document.file.fullPath)}),F.register(q.CMD_TOGGLE_QUICK_EDIT,A.TOGGLE_QUICK_EDIT,function(){return c(X,q.ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND)}),F.register(q.CMD_TOGGLE_QUICK_DOCS,A.TOGGLE_QUICK_DOCS,function(){return c(Y,q.ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND)}),F.register(q.CMD_JUMPTO_DEFINITION,A.NAVIGATE_JUMPTO_DEFINITION,O),B.createPerfMeasurement("JUMP_TO_DEFINITION","Jump-To-Definiiton"),$(j).on("currentFileChange",a),$(j).on("workingSetRemove workingSetRemoveList",L),t._createFullEditorForDocument=v,t._notifyActiveEditorChanged=o,t._saveEditorViewState=r,t._createUnattachedMasterEditor=d,t.createInlineEditorForDocument=y,t.getFocusedInlineWidget=x,t.getInlineEditors=g,t.closeInlineWidget=p,t.openDocument=k,t.canOpenPath=I,t.getActiveEditor=M,t.getCurrentFullEditor=n,t.getFocusedEditor=D,t.registerInlineEditProvider=f,t.registerInlineDocsProvider=h,t.registerJumpToDefProvider=m,t.registerCustomViewer=C,t.resizeEditor=b,t.focusEditor=_,t.getCurrentlyViewedPath=w,t.setEditorHolder=S}),define("document/Document",["require","exports","module","editor/EditorManager","file/FileUtils","document/InMemoryFile","utils/PerfUtils","language/LanguageManager","thirdparty/CodeMirror2/lib/codemirror","thirdparty/lodash"],function(e,t){function n(e,t,r){if(!(this instanceof n))throw new Error("Document constructor must be called with 'new'");this.file=e,this._updateLanguage(),this.refreshText(r,t,!0)}function r(e,t){Array.isArray(e)?u.each(e,t):t(e,0)}var i=e("editor/EditorManager"),o=e("file/FileUtils"),a=e("document/InMemoryFile"),s=e("utils/PerfUtils"),l=e("language/LanguageManager"),c=e("thirdparty/CodeMirror2/lib/codemirror"),u=e("thirdparty/lodash");n.prototype._refCount=0,n.prototype.file=null,n.prototype.language=null,n.prototype.isDirty=!1,n.prototype.isSaving=!1,n.prototype.diskTimestamp=null,n.prototype.keepChangesTime=null,n.prototype._refreshInProgress=!1,n.prototype._text=null,n.prototype._masterEditor=null,n.prototype._lineEndings=null,n.prototype.addRef=function(){0===this._refCount&&$(t).triggerHandler("_afterDocumentCreate",this)||this._refCount++},n.prototype.releaseRef=function(){return this._refCount--,this._refCount<0?void console.error("Document ref count has fallen below zero!"):void(0===this._refCount&&$(t).triggerHandler("_beforeDocumentDelete",this))},n.prototype._makeEditable=function(e){this._masterEditor?console.error("Document is already editable"):(this._text=null,this._masterEditor=e,$(e).on("change",this._handleEditorChange.bind(this)))},n.prototype._makeNonEditable=function(){this._masterEditor?(this._text=this.getText(!0),this._masterEditor=null):console.error("Document is already non-editable")},n.prototype._ensureMasterEditor=function(){this._masterEditor||i._createUnattachedMasterEditor(this)},n.prototype.getText=function(e){if(this._masterEditor){var t=this._masterEditor._codeMirror.getValue();return e&&this._lineEndings===o.LINE_ENDINGS_CRLF?t.replace(/\n/g,"\r\n"):t}return e?this._text:n.normalizeText(this._text)},n.normalizeText=function(e){return e.replace(/\r\n/g,"\n")},n.prototype.setText=function(e){this._ensureMasterEditor(),this._masterEditor._codeMirror.setValue(e)},n.prototype._notifyDocumentChange=function(e){$(this).triggerHandler("change",[this,e]),$(t).triggerHandler("documentChange",[this,e])},n.prototype.refreshText=function(e,n,r){var i=s.markStart("refreshText: "+(!this.file||this.file.fullPath));this._refreshInProgress=!0,this._masterEditor?this._masterEditor._resetText(e):(this._text=e,r||this._notifyDocumentChange([{text:e.split(/\r?\n/)}])),this._updateTimestamp(n),this.isDirty&&this._markClean(),this._refreshInProgress=!1,this._lineEndings=o.sniffLineEndings(e),this._lineEndings||(this._lineEndings=o.getPlatformLineEndings()),$(t).triggerHandler("_documentRefreshed",this),s.addMeasurement(i)},n.prototype.replaceRange=function(e,t,n,r){this._ensureMasterEditor(),this._masterEditor._codeMirror.replaceRange(e,t,n,r)},n.prototype.getRange=function(e,t){return this._ensureMasterEditor(),this._masterEditor._codeMirror.getRange(e,t)},n.prototype.getLine=function(e){return this._ensureMasterEditor(),this._masterEditor._codeMirror.getLine(e)},n.prototype.batchOperation=function(e){this._ensureMasterEditor();var t=this;t._masterEditor._codeMirror.operation(e)},n.prototype._handleEditorChange=function(e,n,r){if(!this._refreshInProgress){var i=this.isDirty;this.isDirty=!n._codeMirror.isClean(),i!==this.isDirty&&$(t).triggerHandler("_dirtyFlagChange",[this])}this._notifyDocumentChange(r)},n.prototype._markClean=function(){this.isDirty=!1,this._masterEditor&&this._masterEditor._codeMirror.markClean(),$(t).triggerHandler("_dirtyFlagChange",this)
18},n.prototype._updateTimestamp=function(e){this.diskTimestamp=e,this.keepChangesTime=null},n.prototype.notifySaved=function(){this._masterEditor||console.log("### Warning: saving a Document that is not modifiable!"),this._markClean();var e=this;this.file.stat(function(n,r){n?console.log("Error updating timestamp after saving file: "+e.file.fullPath):e._updateTimestamp(r.mtime),$(t).triggerHandler("_documentSaved",e)})},n.prototype.adjustPosForChange=function(e,t,n,r){var i={text:t,from:n,to:r};if(c.cmpPos(e,n)<0)return e;if(c.cmpPos(e,r)<=0)return c.changeEnd(i);var o=e.line+i.text.length-(i.to.line-i.from.line)-1,a=e.ch;return e.line===i.to.line&&(a+=c.changeEnd(i).ch-i.to.ch),{line:o,ch:a}},n.prototype.doMultipleEdits=function(e,t){var n=this;e.sort(function(e,t){var n=Array.isArray(e.edit)?e.edit[0]:e.edit,r=Array.isArray(t.edit)?t.edit[0]:t.edit;return n?r?c.cmpPos(r.start,n.start):1:-1});var i=u.cloneDeep(u.pluck(e,"selection"));return u.each(e,function(t,n){r(t.edit,function(t){if(t&&(t.end||(t.end=t.start),n>0)){var i=e[n-1].edit;r(i,function(e){if(c.cmpPos(t.end,e.start)>0)throw new Error("Document.doMultipleEdits(): Overlapping edits specified")})}})}),this.batchOperation(function(){u.each(e,function(e,o){r(e.edit,function(e){if(e){n.replaceRange(e.text,e.start,e.end,t);var a=e.text.split("\n");u.each(i,function(t,i){t&&r(t,function(t){(t.isBeforeEdit||i!==o)&&(t.start=n.adjustPosForChange(t.start,a,e.start,e.end),t.end=n.adjustPosForChange(t.end,a,e.start,e.end))})})}})})}),i=u.chain(i).filter(function(e){return void 0!==e}).flatten().sort(function(e,t){return c.cmpPos(e.start,t.start)}).value(),u.each(i,function(e){delete e.isBeforeEdit}),i},n.prototype.toString=function(){var e=this.isDirty?" (dirty!)":" (clean)",t=this._masterEditor?" (Editable)":" (Non-editable)",n=" refs:"+this._refCount;return"[Document "+this.file.fullPath+e+t+n+"]"},n.prototype.getLanguage=function(){return this.language},n.prototype._updateLanguage=function(){var e=this.language;this.language=l.getLanguageForPath(this.file.fullPath),e&&e!==this.language&&$(this).triggerHandler("languageChanged",[e,this.language])},n.prototype._notifyFilePathChanged=function(){this._updateLanguage()},n.prototype.isUntitled=function(){return this.file instanceof a},t.Document=n}),define("project/FileSyncManager",["require","exports","module","project/ProjectManager","document/DocumentManager","view/MainViewManager","utils/Async","widgets/Dialogs","widgets/DefaultDialogs","strings","utils/StringUtils","file/FileUtils","filesystem/FileSystemError"],function(e,t){function n(e){function t(e){var t=new $.Deferred;return e.isUntitled()?t.resolve():e.file.stat(function(n,r){if(n)n===S.NOT_FOUND?(-1!==e.keepChangesTime&&(e.isDirty?f.push({doc:e,fileTime:-1}):d.push(e)),t.resolve()):(console.log("Error checking modification status of "+e.file.fullPath,n),t.reject());else{var i=r.mtime.getTime();i!==e.diskTimestamp.getTime()&&e.keepChangesTime!==i&&(e.isDirty?p.push({doc:e,fileTime:i}):u.push(e)),t.resolve()}}),t.promise()}return u=[],d=[],p=[],f=[],v.doInParallel(e,t,!0)}function r(){function e(e){var t=new $.Deferred;return e.stat(function(n){n?n===S.NOT_FOUND?(m.notifyFileDeleted(e),t.resolve()):(console.log("Error checking for deletion of "+e.fullPath,n),t.reject()):t.resolve()}),t.promise()}var t=g.getWorkingSet(g.ALL_PANES).filter(function(e){return!m.getOpenDocumentForPath(e.fullPath)});return v.doInParallel(t,e,!1)}function i(e){var t=w.readAsText(e.file);return t.done(function(t,n){e.refreshText(t,n)}),t.fail(function(t){console.log("Error reloading contents of "+e.file.fullPath,t)}),t}function o(){return v.doInParallel(u,i,!1)}function a(e,t){return y.showModalDialog(_.DIALOG_ID_ERROR,b.ERROR_RELOADING_FILE_TITLE,E.format(b.ERROR_RELOADING_FILE,E.breakableUrl(t.file.fullPath),w.getFileErrorString(e)))}function s(){d.forEach(function(e){m.notifyFileDeleted(e.file)})}function l(e){function t(t,n){var r=new $.Deferred,o=r.promise(),s=t.doc,l=t.fileTime;if(I)return r.resolve(),o;var c,u,d,f;return n<p.length?(c=!1,u=_.DIALOG_ID_EXT_CHANGED,d=E.format(b.EXT_MODIFIED_MESSAGE,E.breakableUrl(h.makeProjectRelativeIfPossible(s.file.fullPath))),f=[{className:y.DIALOG_BTN_CLASS_LEFT,id:y.DIALOG_BTN_DONTSAVE,text:b.RELOAD_FROM_DISK},{className:y.DIALOG_BTN_CLASS_PRIMARY,id:y.DIALOG_BTN_CANCEL,text:b.KEEP_CHANGES_IN_EDITOR}]):(c=!0,u=_.DIALOG_ID_EXT_DELETED,d=E.format(b.EXT_DELETED_MESSAGE,E.breakableUrl(h.makeProjectRelativeIfPossible(s.file.fullPath))),f=[{className:y.DIALOG_BTN_CLASS_LEFT,id:y.DIALOG_BTN_DONTSAVE,text:b.CLOSE_DONT_SAVE},{className:y.DIALOG_BTN_CLASS_PRIMARY,id:y.DIALOG_BTN_CANCEL,text:b.KEEP_CHANGES_IN_EDITOR}]),y.showModalDialog(u,e,d,f).done(function(e){e===y.DIALOG_BTN_DONTSAVE?c?(m.notifyFileDeleted(s.file),r.resolve()):i(s).done(function(){r.resolve()}).fail(function(e){a(e,s).done(function(){r.reject()})}):(I||(s.keepChangesTime=l),r.resolve())}),o}var n=p.concat(f);return v.doSequentially(n,t,!1)}function c(e){if(e=e||b.EXT_MODIFIED_TITLE,C)return I=!0,y.cancelModalDialogIfOpen(_.DIALOG_ID_EXT_CHANGED),void y.cancelModalDialogIfOpen(_.DIALOG_ID_EXT_DELETED);C=!0;var t=m.getAllOpenDocuments();n(t).done(function(){r().always(function(){o().always(function(){s(),l(e).always(function(){I?(I=!1,C=!1,c()):(C=!1,(p.length>0||f.length>0)&&g.focusActivePane())})})})}).fail(function(){C=!1})}var u,d,p,f,h=e("project/ProjectManager"),m=e("document/DocumentManager"),g=e("view/MainViewManager"),v=e("utils/Async"),y=e("widgets/Dialogs"),_=e("widgets/DefaultDialogs"),b=e("strings"),E=e("utils/StringUtils"),w=e("file/FileUtils"),S=e("filesystem/FileSystemError"),C=!1,I=!1;t.syncOpenDocuments=c}),define("document/DocumentManager",["require","exports","module","thirdparty/lodash","utils/AppInit","document/Document","utils/DeprecationWarning","view/MainViewManager","view/MainViewFactory","project/FileSyncManager","filesystem/FileSystem","preferences/PreferencesManager","file/FileUtils","document/InMemoryFile","command/CommandManager","command/Commands","utils/PerfUtils","language/LanguageManager","strings"],function(e,t,n){function r(e){var t;for(t in z)if(z.hasOwnProperty(t)&&z[t].file.fullPath===e)return z[t];return null}function i(){var e=L.getCurrentlyViewedFile(L.ACTIVE_PANE);return e?r(e.fullPath):null}function o(){return O.deprecationWarning("Use MainViewManager.getViews() instead of DocumentManager.getWorkingSet()",!0),L.getWorkingSet(L.ALL_PANES).filter(function(e){return!R.findSuitableFactoryForPath(e.fullPath)})}function a(e){return O.deprecationWarning("Use MainViewManager.findInWorkingSet() instead of DocumentManager.findInWorkingSet()",!0),L.findInWorkingSet(L.ACTIVE_PANE,e)}function s(){var e,t=[];for(e in z)z.hasOwnProperty(e)&&t.push(z[e]);return t}function l(e,t,n){O.deprecationWarning("Use MainViewManager.addToWorkingSet() instead of DocumentManager.addToWorkingSet()",!0),L.addToWorkingSet(L.ACTIVE_PANE,e,t,n)}function c(e){O.deprecationWarning("Use MainViewManager.addListToWorkingSet() instead of DocumentManager.addListToWorkingSet()",!0),L.addListToWorkingSet(L.ACTIVE_PANE,e)}function u(e){O.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()",!0),j.execute(V.FILE_CLOSE_LIST,{PaneId:L.ALL_PANES,fileList:e})}function d(){O.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_ALL,{PaneId: MainViewManager.ALL_PANES}) instead of DocumentManager.closeAll()",!0),j.execute(V.FILE_CLOSE_ALL,{PaneId:L.ALL_PANES})}function p(e){O.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()",!0),j.execute(V.FILE_CLOSE,{File:e})}function f(e){O.deprecationWarning("Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()",!0),j.execute(V.CMD_OPEN,{fullPath:e.file.fullPath})}function h(){O.deprecationWarning("Use MainViewManager.beginTraversal() instead of DocumentManager.beginDocumentNavigation()",!0),L.beginTraversal()}function m(){O.deprecationWarning("Use MainViewManager.endTraversal() instead of DocumentManager.finalizeDocumentNavigation()",!0),L.endTraversal()}function g(e){O.deprecationWarning("Use MainViewManager.traverseToNextViewByMRU() instead of DocumentManager.getNextPrevFile()",!0);var t=L.traverseToNextViewByMRU(e);return t?t.file:null}function v(){s().forEach(function(e){1===e._refCount&&e._masterEditor&&L._destroyEditorIfNotNeeded(e)})}function y(e){var t=r(e);if(t)return(new $.Deferred).resolve(t).promise();if(0===e.indexOf(q))return console.error("getDocumentForPath called for non-open untitled document: "+e),(new $.Deferred).reject().promise();var n=N.getFileForPath(e),i=y._pendingDocumentPromises[n.id];if(i)return i;var o=new $.Deferred,a=o.promise();y._pendingDocumentPromises[n.id]=a;var s=B.markStart("getDocumentForPath: "+e);return o.done(function(){B.addMeasurement(s)}).fail(function(){B.finalizeMeasurement(s)}),F.readAsText(n).always(function(){delete y._pendingDocumentPromises[n.id]}).done(function(e,r){t=new M.Document(n,r,e),v(),o.resolve(t)}).fail(function(e){o.reject(e)}),a}function _(e,t){var n=new $.Deferred,i=r(e.fullPath);return i?n.resolve(i.getText(),i.diskTimestamp,t?i._lineEndings:null):e.read(function(e,r,i){if(e)n.reject(e);else{var o=t?F.sniffLineEndings(r):null;r=M.Document.normalizeText(r),n.resolve(r,i.mtime,o)}}),n.promise()}function b(e,t){var n=H.UNTITLED+"-"+e+t,r=q+"/"+n,i=new Date,o=new U(r,N);return new M.Document(o,i,"")}function E(e){$(t).triggerHandler("pathDeleted",e.fullPath);var n=r(e.fullPath);n&&$(n).triggerHandler("deleted"),n&&n._refCount>0&&console.warn("Deleted "+e.fullPath+" Document still has "+n._refCount+" references. Did someone addRef() without listening for 'deleted'?")}function w(e){A.syncOpenDocuments(H.FILE_DELETED_TITLE),r(e)||L.findInAllWorkingSets(e).length||$(t).triggerHandler("pathDeleted",e)}function S(e,n){T.forEach(z,function(e){e._notifyFilePathChanged()}),$(t).triggerHandler("fileNameChange",[e,n])}function C(){T.forEach(z,function(e){e.getLanguage().isFallbackLanguage()&&e._updateLanguage()})}function I(e,t){T.forEach(z,function(e){var n=e.getLanguage();(n===t||n.isFallbackLanguage())&&e._updateLanguage()})}function k(e){var t="files_";if(0===e.indexOf(t)){var n=e.substr(t.length);return"user project.files "+n}return null}function x(e){O.deprecateEvent(t,L,e,e,"DocumentManager."+e,"MainViewManager."+e)}var T=e("thirdparty/lodash"),D=e("utils/AppInit"),M=e("document/Document"),O=e("utils/DeprecationWarning"),L=e("view/MainViewManager"),R=e("view/MainViewFactory"),A=e("project/FileSyncManager"),N=e("filesystem/FileSystem"),P=e("preferences/PreferencesManager"),F=e("file/FileUtils"),U=e("document/InMemoryFile"),j=e("command/CommandManager"),V=e("command/Commands"),B=e("utils/PerfUtils"),W=e("language/LanguageManager"),H=e("strings"),q="/_brackets_"+T.random(1e7,99999999),z={};y._pendingDocumentPromises={},$(M).on("_afterDocumentCreate",function(e,n){return z[n.file.id]?(console.error("Document for this path already in _openDocuments!"),!0):(z[n.file.id]=n,void $(t).triggerHandler("afterDocumentCreate",n))}).on("_beforeDocumentDelete",function(e,n){return z[n.file.id]?($(t).triggerHandler("beforeDocumentDelete",n),void delete z[n.file.id]):(console.error("Document with references was not in _openDocuments!"),!0)}).on("_documentRefreshed",function(e,n){$(t).triggerHandler("documentRefreshed",n)}).on("_dirtyFlagChange",function(e,n){$(t).triggerHandler("dirtyFlagChange",n),n.isDirty&&L.addToWorkingSet(L.ACTIVE_PANE,n.file)}).on("_documentSaved",function(e,n){$(t).triggerHandler("documentSaved",n)}),D.extensionsLoaded(function(){x("workingSetAdd"),x("workingSetAddList"),x("workingSetRemove"),x("workingSetRemoveList"),x("workingSetSort")}),P.convertPreferences(n,{files_:"user"},!0,k),$(t).on("documentSaved",function(e,t){P.fileChanged(t.file.fullPath)}),$(L).on("currentFileChange",function(e,n,i,o){var a=null,s=null;if(n&&(a=r(n.fullPath)),o&&(s=r(o.fullPath)),s&&$(s).off("languageChanged.DocumentManager"),a!==s){var l=O.getEventHandlerCount(t,"currentDocumentChange");l>0&&O.deprecationWarning("The Event 'DocumentManager.currentDocumentChange' has been deprecated. Please use 'MainViewManager.currentFileChange' instead.",!0),$(t).triggerHandler("currentDocumentChange",[a,s])}a&&$(a).on("languageChanged.DocumentManager",function(e){$(t).trigger("currentDocumentLanguageChanged",e)})}),t.getWorkingSet=o,t.findInWorkingSet=a,t.addToWorkingSet=l,t.addListToWorkingSet=c,t.removeListFromWorkingSet=u,t.getCurrentDocument=i,t.beginDocumentNavigation=h,t.finalizeDocumentNavigation=m,t.getNextPrevFile=g,t.setCurrentDocument=f,t.closeFullEditor=p,t.closeAll=d,t.Document=M.Document,t.getDocumentForPath=y,t.getOpenDocumentForPath=r,t.getDocumentText=_,t.createUntitledDocument=b,t.getAllOpenDocuments=s,t.notifyPathNameChanged=S,t.notifyPathDeleted=w,t.notifyFileDeleted=E,B.createPerfMeasurement("DOCUMENT_MANAGER_GET_DOCUMENT_FOR_PATH","DocumentManager.getDocumentForPath()"),$(W).on("languageAdded",C),$(W).on("languageModified",I)}),define("project/FileViewController",["require","exports","module","document/DocumentManager","view/MainViewManager","command/CommandManager","utils/PerfUtils","command/Commands","utils/DeprecationWarning"],function(e,t){function n(e){e?c.setActivePaneId(e):c.focusActivePane(),$(t).triggerHandler("documentSelectionFocusChange")}function r(e){return e!==g&&e!==m?void console.error("Bad parameter passed to FileViewController.setFileViewFocus"):(v=e,void $(t).triggerHandler("fileViewFocusChange"))}function i(e,t,r){var i,o=h;if(t!==g&&t!==m)return void console.error("Bad parameter passed to FileViewController.openAndSelectDocument");h=!0,v=t,r=r||c.ACTIVE_PANE;var a=c.getCurrentlyViewedPath(r);return a===e?(n(r),i=(new $.Deferred).resolve().promise()):i=u.execute(p.FILE_OPEN,{fullPath:e,paneId:r}),i.always(function(){h=o}),i}function o(e,t){var r=new $.Deferred,i=u.execute(p.CMD_ADD_TO_WORKINGSET_AND_OPEN,{fullPath:e,paneId:t});return i.done(function(e){v=m,n(t),r.resolve(e)}).fail(function(e){r.reject(e)}),r.promise()}function a(e){f.deprecationWarning("Use FileViewController.openFileAndAddToWorkingSet() instead of FileViewController.addToWorkingSetAndSelect().",!0);var t=new $.Deferred;return o(e).done(function(e){var n;e&&(n=l.getOpenDocumentForPath(e.fullPath)),t.resolve(n)}).fail(function(e){t.reject(e)}),t.promise()}function s(){return v}var l=e("document/DocumentManager"),c=e("view/MainViewManager"),u=e("command/CommandManager"),d=e("utils/PerfUtils"),p=e("command/Commands"),f=e("utils/DeprecationWarning"),h=!1,m="WorkingSetView",g="ProjectManager",v=g;$(c).on("workingSetAdd",function(){v=m,$(t).triggerHandler("documentSelectionFocusChange")}),$(c).on("currentFileChange",function(e,n,r){var i;h||(i=d.markStart("FileViewController._oncurrentFileChange(): "+(n?n.fullPath:"(no open file)")),v=n&&-1!==c.findInWorkingSet(r,n.fullPath)?m:g),$(t).triggerHandler("documentSelectionFocusChange"),h||d.addMeasurement(i)}),t.addToWorkingSetAndSelect=a,t.getFileSelectionFocus=s,t.openAndSelectDocument=i,t.openFileAndAddToWorkingSet=o,t.setFileViewFocus=r,t.WORKING_SET_VIEW=m,t.PROJECT_MANAGER=g}),"object"==typeof exports?module.exports=universalModule():"function"==typeof define&&define.amd?define("thirdparty/immutable",universalModule):Immutable=universalModule(),define("project/FileTreeViewModel",["require","exports","module","thirdparty/immutable","thirdparty/lodash","file/FileUtils"],function(e,t){function n(e){return void 0===e.get("children")}function r(){this._commit=this._commit.bind(this)}function i(e,t){if(null===t)return null;if(""===t)return[];for(var n,r=t.split("/"),i=r.shift(),o=[];i;){if(!e)return null;if(n=e.get(i),void 0===n)return null;o.push(i),i=r.shift(),i&&(e=n.get("children"),e&&o.push("children"))}return o}function o(e,t){if(null===t)return null;if(""===t)return!0;for(var n,r=t.split("/"),i=r.shift(),o=[];i;){if(null===e)return!1;if(n=e.get(i),void 0===n)return null;if(o.push(i),i=r.shift()){if(!n.get("open"))return!1;e=n.get("children"),e&&o.push("children")}}return!0}function a(e,t){function r(e,t,o){e&&e.forEach(function(e,a){if(!n(e)){var s=t+a+"/";if(e.get("open")){var l=i[o];l||(l=i[o]=[]),l.push(s),r(e.get("children"),s,o+1)}}})}var i=[];return r(e,t,0),i}function s(e,t){function r(e){e&&e.forEach(function(e,t){if(!n(e)){var r=t+"/";i.push(r)}})}var i=[];return r(e,t,0),i}function l(e,t,n){return e.updateIn(t,function(){return n})}function c(e,t,n,r){var o;r&&(o=i(e,r));var a=e;if(n&&n!==r){var s=i(e,n);s&&(a=a.updateIn(s,function(e){return e.delete(t)}))}return r&&o&&0!==o.length&&(a=a.updateIn(o,function(e){return e.set(t,!0)})),a}function u(e,t,r){var o=i(e,t),a=e.getIn(o);if(!o)return{needsLoading:!0,treeData:e};if(!n(a)){var s=a.get("open")===!0;if(!(s&&r||!s&&!r))return e=e.updateIn(o,function(e){return r?e.set("open",!0):e.delete("open")}),r&&(null===a.get("children")||a.get("notFullyLoaded"))?{needsLoading:!0,treeData:e}:{needsLoading:!1,treeData:e}}}function d(e){e=e.delete("open");var t=e.get("children");return t&&t.keySeq().forEach(function(e){var r=t.get(e);n(r)||(r=d(r),t=t.set(e,r))}),e=e.set("children",t)}function p(e,t){var r=[];return e=e.withMutations(function(e){t.forEach(function(t){r.push(t.name);var i=e.get(t.name);if(i){var o=n(i);o!==t.isFile&&(i=void 0)}i||(t.isFile?e.set(t.name,E.Map()):e.set(t.name,E.Map({children:null})))});var i=e.keySeq().toJS(),o=w.difference(i,r);o.forEach(function(t){e.delete(t)})})}function f(e){return e?e.merge({notFullyLoaded:!0,children:E.Map()}):E.Map({notFullyLoaded:!0,children:E.Map()})}function h(e,t){var n=[],r={objectPath:n,treeData:e},i=e;if(""===t)return r;for(var o,a=t.split("/"),s=a.shift();s;){if(null===i)return null;o=i.get(s),n.push(s),void 0===o&&(e=e.updateIn(n,f),o=e.getIn(n)),s=a.shift(),s&&(i=o.get("children"),i?n.push("children"):(e=e.updateIn(n,f),n.push("children"),i=e.getIn(n)))}return r.treeData=e,r}function m(e,t){function r(e){return e.set("open",!0)}for(var o=i(e,t);o&&o.length;){var a=e.getIn(o);n(a)?o.pop():(a.get("open")||(e=e.updateIn(o,r)),o.pop(),o.length&&o.pop())}return e}function g(e,t,n,r,o){o=o||{};var a=i(e,t);if(a){var s={};o.notInCreateMode||(s.creating=!0),r&&(s.children=o.notInCreateMode?null:E.Map());var l=E.Map(s);if(o.doNotOpen||(e=m(e,t)),a.length>0){var c=w.clone(a);c.push("children"),e=e.updateIn(c,function(e){return e.set(n,l)})}else e=e.set(n,l);return e}}function v(e,t){var n=i(e,t);if(n){var r=w.last(n);return n.pop(),e=e.updateIn(n,function(e){return e=e.delete(r)})}}function y(e){return e.set("_timestamp",(new Date).getTime())}function _(e,t){return t.forEach(function(t){var n=i(e,t);n&&(e=e.updateIn(n,y))}),e}function b(e,t){return t.forEach(function(t){var n="/"===w.last(t);t=n?t.substr(0,t.length-1):t;var r=S.getDirectoryPath(t),o=i(e,r),a=S.getBaseName(t);if(o){var s=w.clone(o);if(s.push("children"),null===e.getIn(s))return;e=g(e,r,a,n,{notInCreateMode:!0,doNotOpen:!0})}}),e}var E=e("thirdparty/immutable"),w=e("thirdparty/lodash"),S=e("file/FileUtils"),C="change";r.prototype.sortDirectoriesFirst=!1,r.prototype._treeData=E.Map(),Object.defineProperty(r.prototype,"treeData",{get:function(){return this._treeData}}),r.prototype._selectionViewInfo=E.Map({width:0,scrollTop:0,scrollLeft:0,offsetTop:0,hasContext:!1,hasSelection:!1}),Object.defineProperty(r.prototype,"selectionViewInfo",{get:function(){return this._selectionViewInfo}}),r.prototype._rootChanged=function(){this._treeData=E.Map()},r.prototype._commit=function(e,t){var n=!1;e&&e!==this._treeData&&(this._treeData=e,n=!0),t&&t!==this._selectionViewInfo&&(this._selectionViewInfo=t,n=!0),n&&$(this).trigger(C)},r.prototype.isFilePathVisible=function(e){return o(this._treeData,e)},r.prototype.isPathLoaded=function(e){var t=i(this._treeData,e);return t&&("/"!==w.last(e)||(t.push("children"),this._treeData.getIn(t)))?!0:!1},r.prototype.getOpenNodes=function(e){return a(this._treeData,e)},r.prototype.getChildDirectories=function(e){var t=this._treeData,n=i(t,e);if(n){var r;return 0===n.length?r=this._treeData:(n.push("children"),r=this._treeData.getIn(n)),s(r,e)}},r.prototype.moveMarker=function(e,t,n){var r=c(this._treeData,e,t,n),i=this._selectionViewInfo;"selected"===e?i=i.set("hasSelection",!!n):"context"===e&&(i=i.set("hasContext",!!n)),this._commit(r,i)},r.prototype.renameItem=function(e,t){var n=this._treeData,r=i(n,e);if(r){var o=w.last(r),a=n.getIn(r);r.pop(),n=n.updateIn(r,function(e){return e=e.delete(o),e=e.set(t,a)}),this._commit(n)}},r.prototype.setDirectoryOpen=function(e,t){var n=u(this._treeData,e,t);return n&&n.treeData&&this._commit(n.treeData),n?n.needsLoading:!1},r.prototype._getObject=function(e){var t=i(this._treeData,e);return t?this._treeData.getIn(t):null},r.prototype.closeSubtree=function(e){var t=this._treeData,n=i(t,e);if(n){var r=t.getIn(n);r=d(r),t=l(t,n,r),this._commit(t)}},r.prototype.setDirectoryContents=function(e,t){e=S.stripTrailingSlash(e);var r=h(this._treeData,e),i=r.objectPath,o=r.treeData;if(null!==i){var a=o.getIn(i),s=a;if(""!==e){if(n(a))return;a.get("notFullyLoaded")&&(a=a.delete("notFullyLoaded")),a.get("children")||(a=a.set("children",E.Map())),o=l(o,i,a),i.push("children"),s=a.get("children")}s=p(s,t),o=l(o,i,s),this._commit(o)}},r.prototype.openPath=function(e){this._commit(m(this._treeData,e))},r.prototype.createPlaceholder=function(e,t,n){var r=g(this._treeData,e,t,n);this._commit(r)},r.prototype.deleteAtPath=function(e){var t=v(this._treeData,e);t&&this._commit(t)},r.prototype.processChanges=function(e){var t=this._treeData;e.changed&&(t=_(t,e.changed)),e.added&&(t=b(t,e.added)),e.removed&&e.removed.forEach(function(e){t=v(t,e)}),this._commit(t)},r.prototype.ensureDirectoryExists=function(e){var t=this._treeData,n=S.stripTrailingSlash(e),r=S.getDirectoryPath(n),o=n.substr(r.length),a=[];if(r){if(a=i(t,r),!a)return;if(a.push("children"),!t.getIn(a))return}a.push(o),t.getIn(a)||(t=l(t,a,E.Map({children:null})),this._commit(t))},r.prototype.setSortDirectoriesFirst=function(e){e!==this.sortDirectoriesFirst&&(this.sortDirectoriesFirst=e,$(this).trigger(C))},r.prototype.setSelectionWidth=function(e){var t=this._selectionViewInfo;t=t.set("width",e),this._commit(null,t)},r.prototype.setSelectionScrollerInfo=function(e,t,n,r){this._selectionViewInfo=this._selectionViewInfo.set("scrollWidth",e),this._selectionViewInfo=this._selectionViewInfo.set("scrollTop",t),void 0!==n&&(this._selectionViewInfo=this._selectionViewInfo.set("scrollLeft",n)),void 0!==r&&(this._selectionViewInfo=this._selectionViewInfo.set("offsetTop",r))},r.prototype.on=function(e,t){$(this).on(e,t)},r.prototype.off=function(e,t){$(this).off(e,t)},t.EVENT_CHANGE=C,t._filePathToObjectPath=i,t._isFilePathVisible=o,t._createPlaceholder=g,t.isFile=n,t.FileTreeViewModel=r}),define("project/ProjectModel",["require","exports","module","document/InMemoryFile","file/FileUtils","thirdparty/lodash","filesystem/FileSystem","filesystem/FileSystemError","project/FileTreeViewModel","utils/Async"],function(e,t){function n(e,t){return!(-1!==e.search(new RegExp("["+t+"]+"))||e.match(D))}function r(e){return!e.match(T)}function i(e){return r(e.name)}function o(e){return"/"!==y.last(e)}function a(e){return e?o(e)?_.getFileForPath(e):_.getDirectoryForPath(e):e}function s(e){return e&&e.fullPath?e.fullPath:e}function l(e,t){var r=new $.Deferred,i=v.getBaseName(e);return n(i,m)?(_.resolve(e,function(n){if(n)if(t){var i=_.getDirectoryForPath(e);i.create(function(e){e?r.reject(e):r.resolve(i)})}else{var o=_.getFileForPath(e);v.writeText(o,"").then(function(){r.resolve(o)},r.reject)}else r.reject(b.ALREADY_EXISTS)}),r.promise()):r.reject(x).promise()}function c(e){e=e||{},e.projectRoot&&(this.projectRoot=e.projectRoot),void 0!==e.focused&&(this._focused=e.focused),this._viewModel=new E.FileTreeViewModel,this._viewModel.on(E.EVENT_CHANGE,function(){$(this).trigger(S)}.bind(this)),this._selections={}}function u(e,t,r){var i=new $.Deferred;if(e===t)i.resolve();else if(n(v.getBaseName(t),m)){var o=r?_.getDirectoryForPath(e):_.getFileForPath(e);o.rename(t,function(e){e?i.reject(e):i.resolve()})}else i.reject(x);return i.promise()}function d(e){return o(e)?e+"/":e}function p(e,t){return e&&(t=t.substr(0,t.lastIndexOf("/"))+"/samples/"+e),d(t)}function f(e,t){var n,r=v.stripTrailingSlash(e);return n=t?y.clone(t):[],-1===n.indexOf(r)&&n.push(r),n}function h(e,t,n){if(e===t)return!0;if(!n)return!1;var r=v.stripTrailingSlash(e);return-1!==n.indexOf(r)}var m,g=e("document/InMemoryFile"),v=e("file/FileUtils"),y=e("thirdparty/lodash"),_=e("filesystem/FileSystem"),b=e("filesystem/FileSystemError"),E=e("project/FileTreeViewModel"),w=e("utils/Async"),S="change",C="select",I="focus",k="creationError",x="invalidFilename",T=/\.pyc$|^\.git$|^\.gitmodules$|^\.svn$|^\.DS_Store$|^Thumbs\.db$|^\.hg$|^CVS$|^\.hgtags$|^\.idea$|^\.c9revisions$|^\.SyncArchive$|^\.SyncID$|^\.SyncIgnore$|\~$/,D=/^(\.+|com[1-9]|lpt[1-9]|nul|con|prn|aux|)$|\.+$/i,M=0,O=1,L=2;c.prototype.projectRoot=null,c.prototype._viewModel=null,c.prototype._projectBaseUrl="",c.prototype._selections=null,c.prototype._focused=!0,c.prototype._currentPath=null,c.prototype._allFilesCachePromise=null,c.prototype.setFocused=function(e){this._focused=e,e||this.setSelected(null)},c.prototype.setSelectionWidth=function(e){this._viewModel.setSelectionWidth(e)},c.prototype.setScrollerInfo=function(e,t,n,r){this._viewModel.setSelectionScrollerInfo(e,t,n,r)},c.prototype.getBaseUrl=function(){return this._projectBaseUrl},c.prototype.setBaseUrl=function(e){return e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this._projectBaseUrl=e,e},c.prototype.isWithinProject=function(e){var t=e.fullPath||e;return this.projectRoot&&0===t.indexOf(this.projectRoot.fullPath)},c.prototype.makeProjectRelativeIfPossible=function(e){return e&&this.isWithinProject(e)?e.slice(this.projectRoot.fullPath.length):e},c.prototype._getAllFilesCache=function(){if(!this._allFilesCachePromise){var e=new $.Deferred,t=[],n=function(e){return i(e)?(e.isFile&&t.push(e),!0):!1};this._allFilesCachePromise=e.promise(),this.projectRoot.visit(n,function(n){n?e.reject(n):e.resolve(t)}.bind(this))}return this._allFilesCachePromise},c.prototype.getAllFiles=function(e,t){void 0===t&&"function"!=typeof e&&(t=e,e=null);var n=new $.Deferred;return this._getAllFilesCache().done(function(r){t&&t.forEach(function(e){-1!==r.indexOf(e)||e instanceof g||r.push(e)}),e&&(r=r.filter(e));try{n.resolve(r)}catch(i){console.warn("Unhandled exception in getAllFiles handler: ",i)}}).fail(function(e){try{n.reject(e)}catch(t){console.warn("Unhandled exception in getAllFiles handler: ",t)}}),n.promise()},c.prototype._resetCache=function(){this._allFilesCachePromise=null},c.prototype.on=function(e,t){$(this).on(e,t)},c.prototype.off=function(e,t){$(this).off(e,t)},c.prototype.setProjectRoot=function(e){this.projectRoot=e,this._resetCache(),this._viewModel._rootChanged();var t=new $.Deferred,n=this;return e.getContents(function(e,r){e?t.reject(e):(n._viewModel.setDirectoryContents("",r),t.resolve())}),t.promise()},c.prototype._getDirectoryContents=function(e){var t=new $.Deferred;return _.getDirectoryForPath(e).getContents(function(e,n){e?t.reject(e):t.resolve(n)}),t.promise()},c.prototype.setDirectoryOpen=function(e,t){function n(e){if(e&&a._viewModel.setDirectoryContents(r,e),t){if(a._viewModel.openPath(r),a._focused){var n=a.makeProjectRelativeIfPossible(a._currentPath);a._viewModel.isFilePathVisible(n)?a.setSelected(a._currentPath,!0):a.setSelected(null)}}else{a._viewModel.setDirectoryOpen(r,!1);var i=a._selections.selected;if(i){var s=a.makeProjectRelativeIfPossible(i);a._viewModel.isFilePathVisible(s)||a.setSelected(null)}}o.resolve()}var r=this.makeProjectRelativeIfPossible(e),i=!this._viewModel.isPathLoaded(r),o=new $.Deferred,a=this;if(t&&i){var s=v.getDirectoryPath(v.stripTrailingSlash(e));this.setDirectoryOpen(s,!0).then(function(){a._getDirectoryContents(e).then(n).fail(function(e){o.reject(e)})},function(e){o.reject(e)})}else n();return o.promise()},c.prototype.showInTree=function(e){var t=new $.Deferred;e=s(e);var n=this.makeProjectRelativeIfPossible(e);if("/"===n[0])t.resolve();else{var r=v.getDirectoryPath(e),i=this;this.setDirectoryOpen(r,!0).then(function(){o(e)&&i.setSelected(e),t.resolve()},function(e){t.reject(e)})}return t.promise()},c.prototype.setSelected=function(e,t){if(e=s(e),o(e)){var n=this.makeProjectRelativeIfPossible(this._selections.selected),r=this.makeProjectRelativeIfPossible(e);e&&!this._viewModel.isFilePathVisible(r)&&(e=null,r=null),this.performRename(),this._viewModel.moveMarker("selected",n,r),this._selections.context&&(this._viewModel.moveMarker("context",this.makeProjectRelativeIfPossible(this._selections.context),null),delete this._selections.context);var i=this._selections.selected;this._selections.selected=e,e&&(t||$(this).trigger(C,{path:e,previousPath:i,hadFocus:this._focused}),$(this).trigger(I))}},c.prototype.getSelected=function(){return a(this._selections.selected)},c.prototype.setCurrentFile=function(e){this._currentPath=s(e)},c.prototype.selectInWorkingSet=function(e){this.performRename(),$(this).trigger(C,{path:e,add:!0})},c.prototype.setContext=function(e,t,n){n?this._selections.previousContext=e?e:this._selections.context:delete this._selections.previousContext,e=s(e),t||this.performRename();var r=this._selections.context;this._selections.context=e,this._viewModel.moveMarker("context",this.makeProjectRelativeIfPossible(r),this.makeProjectRelativeIfPossible(e))},c.prototype.restoreContext=function(){this._selections.previousContext&&this.setContext(this._selections.previousContext)},c.prototype.getContext=function(){return a(this._selections.context)},c.prototype.startRename=function(e){if(e=s(e),!e&&(e=this._selections.context,!e))return(new $.Deferred).resolve().promise();if(!this._selections.rename||this._selections.rename.path!==e){e!==this._selections.context?this.setContext(e):this.performRename(),this._viewModel.moveMarker("rename",null,this.makeProjectRelativeIfPossible(e));var t=new $.Deferred;return this._selections.rename={deferred:t,type:M,path:e,newName:v.getBaseName(e)},t.promise()}},c.prototype.setRenameValue=function(e){this._selections.rename&&(this._selections.rename.newName=e)},c.prototype.cancelRename=function(){var e=this._selections.rename;if(e){if(e.type===O)return void this._cancelCreating();this._viewModel.moveMarker("rename",this.makeProjectRelativeIfPossible(e.path),null),e.deferred.resolve(L),delete this._selections.rename,this.setContext(null)}},c.prototype._renameItem=function(e,t){return u(e,t,!o(e))},c.prototype.performRename=function(){var e=this._selections.rename;if(e){var t=e.path,n=e.isFolder||!o(t),r=this.makeProjectRelativeIfPossible(t),i=v.getDirectoryPath(n?v.stripTrailingSlash(t):t),a=v.getBaseName(t),s=e.newName,l=i+s,c=this._viewModel,u=this;if(e.type!==O&&a===s)return void this.cancelRename();n&&(l+="/"),delete this._selections.rename,delete this._selections.context,this._selections.selected===t&&(this._selections.selected=l),c.moveMarker("rename",r,null),c.moveMarker("context",r,null),c.moveMarker("creating",r,null),e.type===O?this.createAtPath(l).done(function(t){c.renameItem(r,s),e.deferred.resolve(t)}).fail(function(t){u._viewModel.deleteAtPath(u.makeProjectRelativeIfPossible(e.path)),e.deferred.reject(t)}):this._renameItem(t,l).then(function(){c.renameItem(r,s),e.deferred.resolve({newPath:l})}).fail(function(r){var i={type:r,isFolder:n,fullPath:t};e.deferred.reject(i)})}},c.prototype.createAtPath=function(e){var t=!o(e),n=v.getBaseName(e),r=this;return l(e,t).done(function(e){t||r.selectInWorkingSet(e.fullPath)}).fail(function(e){$(r).trigger(k,{type:e,name:n,isFolder:t})})},c.prototype.startCreating=function(e,t,n){this.performRename();var r=new $.Deferred,i=this;return this.setDirectoryOpen(e,!0).then(function(){i._viewModel.createPlaceholder(i.makeProjectRelativeIfPossible(e),t,n);
19var o=i.startRename(e+t);i._selections.rename.type=O,n&&(i._selections.rename.isFolder=n),o.then(r.resolve).fail(r.reject)}).fail(function(e){r.reject(e)}),r.promise()},c.prototype._cancelCreating=function(){var e=this._selections.rename;e&&e.type===O&&(this._viewModel.deleteAtPath(this.makeProjectRelativeIfPossible(e.path)),e.deferred.resolve(L),delete this._selections.rename,this.setContext(null))},c.prototype.setSortDirectoriesFirst=function(e){this._viewModel.setSortDirectoriesFirst(e)},c.prototype.getOpenNodes=function(){return this._viewModel.getOpenNodes(this.projectRoot.fullPath)},c.prototype.reopenNodes=function(e){var t=new $.Deferred;if(e&&0!==e.length){var n=this;return w.doSequentially(e,function(e){return w.doInParallel(e,function(e){return n._getDirectoryContents(e).then(function(t){var r=n.makeProjectRelativeIfPossible(e);n._viewModel.setDirectoryContents(r,t),n._viewModel.setDirectoryOpen(r,!0)})},!1)})}return t.resolve().promise()},c.prototype.refresh=function(){var e=this.projectRoot,t=this.getOpenNodes(),n=this,r=this._selections,i=this._viewModel,o=new $.Deferred;return this.setProjectRoot(e).then(function(){n.reopenNodes(t).then(function(){r.selected&&i.moveMarker("selected",null,n.makeProjectRelativeIfPossible(r.selected)),r.context&&i.moveMarker("context",null,n.makeProjectRelativeIfPossible(r.context)),r.rename&&i.moveMarker("rename",null,n.makeProjectRelativeIfPossible(r.rename)),o.resolve()})}),o.promise()},c.prototype.handleFSEvent=function(e,t,n){if(this._resetCache(),!e)return void this.refresh();if(this.isWithinProject(e)){var r={},i=this;e.isFile?r.changed=[this.makeProjectRelativeIfPossible(e.fullPath)]:t||n||this._viewModel.ensureDirectoryExists(this.makeProjectRelativeIfPossible(e.fullPath)),t&&(r.added=t.map(function(e){return i.makeProjectRelativeIfPossible(e.fullPath)})),n&&(this._selections.selected&&y.find(n,{fullPath:this._selections.selected})&&this.setSelected(null),this._selections.rename&&y.find(n,{fullPath:this._selections.rename.path})&&this.cancelRename(),this._selections.context&&y.find(n,{fullPath:this._selections.context})&&this.setContext(null),r.removed=n.map(function(e){return i.makeProjectRelativeIfPossible(e.fullPath)})),this._viewModel.processChanges(r)}},c.prototype.closeSubtree=function(e){this._viewModel.closeSubtree(this.makeProjectRelativeIfPossible(e))},c.prototype.toggleSubdirectories=function(e,t){var n=this,r=new $.Deferred;return this.setDirectoryOpen(e,!0).then(function(){var i=n.makeProjectRelativeIfPossible(e),o=n._viewModel.getChildDirectories(i);w.doInParallel(o,function(r){return n.setDirectoryOpen(e+r,t)},!0).then(function(){r.resolve()},function(e){r.reject(e)})}),r.promise()},m="mac"===brackets.platform?"?*|:":"linux"===brackets.platform?"?*|/":'/?*:<>\\|"',t._getWelcomeProjectPath=p,t._addWelcomeProjectPath=f,t._isWelcomeProjectPath=h,t._ensureTrailingSlash=d,t._shouldShowName=r,t._invalidChars=m,t.shouldShow=i,t.isValidFilename=n,t.EVENT_CHANGE=S,t.EVENT_SHOULD_SELECT=C,t.EVENT_SHOULD_FOCUS=I,t.ERROR_CREATION=k,t.ERROR_INVALID_FILENAME=x,t.FILE_RENAMING=M,t.FILE_CREATING=O,t.RENAME_CANCELLED=L,t.doCreate=l,t.ProjectModel=c}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("thirdparty/react",[],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.React=e()}}(function(){return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t){var n=e("./focusNode"),r={componentDidMount:function(){this.props.autoFocus&&n(this.getDOMNode())}};t.exports=r},{"./focusNode":120}],2:[function(e,t){function n(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}var i=e("./EventConstants"),o=e("./EventPropagators"),a=e("./ExecutionEnvironment"),s=e("./SyntheticInputEvent"),l=e("./keyOf"),c=a.canUseDOM&&"TextEvent"in window&&!("documentMode"in document||n()),u=32,d=String.fromCharCode(u),p=i.topLevelTypes,f={beforeInput:{phasedRegistrationNames:{bubbled:l({onBeforeInput:null}),captured:l({onBeforeInputCapture:null})},dependencies:[p.topCompositionEnd,p.topKeyPress,p.topTextInput,p.topPaste]}},h=null,m={eventTypes:f,extractEvents:function(e,t,n,i){var a;if(c)switch(e){case p.topKeyPress:var l=i.which;if(l!==u)return;a=String.fromCharCode(l);break;case p.topTextInput:if(a=i.data,a===d)return;break;default:return}else{switch(e){case p.topPaste:h=null;break;case p.topKeyPress:i.which&&!r(i)&&(h=String.fromCharCode(i.which));break;case p.topCompositionEnd:h=i.data}if(null===h)return;a=h}if(a){var m=s.getPooled(f.beforeInput,n,i);return m.data=a,h=null,o.accumulateTwoPhaseDispatches(m),m}}};t.exports=m},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./SyntheticInputEvent":98,"./keyOf":141}],3:[function(e,t){var n=e("./invariant"),r={addClass:function(e,t){return n(!/\s/.test(t),'CSSCore.addClass takes only a single class name. "%s" contains multiple classes.',t),t&&(e.classList?e.classList.add(t):r.hasClass(e,t)||(e.className=e.className+" "+t)),e},removeClass:function(e,t){return n(!/\s/.test(t),'CSSCore.removeClass takes only a single class name. "%s" contains multiple classes.',t),t&&(e.classList?e.classList.remove(t):r.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),e},conditionClass:function(e,t,n){return(n?r.addClass:r.removeClass)(e,t)},hasClass:function(e,t){return n(!/\s/.test(t),"CSS.hasClass takes only a single class name."),e.classList?!!t&&e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}};t.exports=r},{"./invariant":134}],4:[function(e,t){function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={columnCount:!0,fillOpacity:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},i=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){i.forEach(function(t){r[n(t,e)]=r[e]})});var o={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},a={isUnitlessNumber:r,shorthandPropertyExpansions:o};t.exports=a},{}],5:[function(e,t){var n=e("./CSSProperty"),r=e("./dangerousStyleValue"),i=e("./hyphenateStyleName"),o=e("./memoizeStringOnly"),a=o(function(e){return i(e)}),s={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];null!=i&&(t+=a(n)+":",t+=r(n,i)+";")}return t||null},setValueForStyles:function(e,t){var i=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=r(o,t[o]);if(a)i[o]=a;else{var s=n.shorthandPropertyExpansions[o];if(s)for(var l in s)i[l]="";else i[o]=""}}}};t.exports=s},{"./CSSProperty":4,"./dangerousStyleValue":115,"./hyphenateStyleName":132,"./memoizeStringOnly":143}],6:[function(e,t){function n(){this._callbacks=null,this._contexts=null}var r=e("./PooledClass"),i=e("./invariant"),o=e("./mixInto");o(n,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){i(e.length===t.length,"Mismatched list of contexts in callback queue"),this._callbacks=null,this._contexts=null;for(var n=0,r=e.length;r>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./PooledClass":28,"./invariant":134,"./mixInto":147}],7:[function(e,t){function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=w.getPooled(x.change,D,e);_.accumulateTwoPhaseDispatches(t),E.batchedUpdates(i,t)}function i(e){y.enqueueEvents(e),y.processEventQueue()}function o(e,t){T=e,D=t,T.attachEvent("onchange",r)}function a(){T&&(T.detachEvent("onchange",r),T=null,D=null)}function s(e,t,n){return e===k.topChange?n:void 0}function l(e,t,n){e===k.topFocus?(a(),o(t,n)):e===k.topBlur&&a()}function c(e,t){T=e,D=t,M=e.value,O=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(T,"value",A),T.attachEvent("onpropertychange",d)}function u(){T&&(delete T.value,T.detachEvent("onpropertychange",d),T=null,D=null,M=null,O=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==M&&(M=t,r(e))}}function p(e,t,n){return e===k.topInput?n:void 0}function f(e,t,n){e===k.topFocus?(u(),c(t,n)):e===k.topBlur&&u()}function h(e){return e!==k.topSelectionChange&&e!==k.topKeyUp&&e!==k.topKeyDown||!T||T.value===M?void 0:(M=T.value,D)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function g(e,t,n){return e===k.topClick?n:void 0}var v=e("./EventConstants"),y=e("./EventPluginHub"),_=e("./EventPropagators"),b=e("./ExecutionEnvironment"),E=e("./ReactUpdates"),w=e("./SyntheticEvent"),S=e("./isEventSupported"),C=e("./isTextInputElement"),I=e("./keyOf"),k=v.topLevelTypes,x={change:{phasedRegistrationNames:{bubbled:I({onChange:null}),captured:I({onChangeCapture:null})},dependencies:[k.topBlur,k.topChange,k.topClick,k.topFocus,k.topInput,k.topKeyDown,k.topKeyUp,k.topSelectionChange]}},T=null,D=null,M=null,O=null,L=!1;b.canUseDOM&&(L=S("change")&&(!("documentMode"in document)||document.documentMode>8));var R=!1;b.canUseDOM&&(R=S("input")&&(!("documentMode"in document)||document.documentMode>9));var A={get:function(){return O.get.call(this)},set:function(e){M=""+e,O.set.call(this,e)}},N={eventTypes:x,extractEvents:function(e,t,r,i){var o,a;if(n(t)?L?o=s:a=l:C(t)?R?o=p:(o=h,a=f):m(t)&&(o=g),o){var c=o(e,t,r);if(c){var u=w.getPooled(x.change,c,i);return _.accumulateTwoPhaseDispatches(u),u}}a&&a(e,t,r)}};t.exports=N},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactUpdates":87,"./SyntheticEvent":96,"./isEventSupported":135,"./isTextInputElement":137,"./keyOf":141}],8:[function(e,t){var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],9:[function(e,t){function n(e){switch(e){case v.topCompositionStart:return _.compositionStart;case v.topCompositionEnd:return _.compositionEnd;case v.topCompositionUpdate:return _.compositionUpdate}}function r(e,t){return e===v.topKeyDown&&t.keyCode===h}function i(e,t){switch(e){case v.topKeyUp:return-1!==f.indexOf(t.keyCode);case v.topKeyDown:return t.keyCode!==h;case v.topKeyPress:case v.topMouseDown:case v.topBlur:return!0;default:return!1}}function o(e){this.root=e,this.startSelection=c.getSelection(e),this.startValue=this.getText()}var a=e("./EventConstants"),s=e("./EventPropagators"),l=e("./ExecutionEnvironment"),c=e("./ReactInputSelection"),u=e("./SyntheticCompositionEvent"),d=e("./getTextContentAccessor"),p=e("./keyOf"),f=[9,13,27,32],h=229,m=l.canUseDOM&&"CompositionEvent"in window,g=!m||"documentMode"in document&&document.documentMode>8&&document.documentMode<=11,v=a.topLevelTypes,y=null,_={compositionEnd:{phasedRegistrationNames:{bubbled:p({onCompositionEnd:null}),captured:p({onCompositionEndCapture:null})},dependencies:[v.topBlur,v.topCompositionEnd,v.topKeyDown,v.topKeyPress,v.topKeyUp,v.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:p({onCompositionStart:null}),captured:p({onCompositionStartCapture:null})},dependencies:[v.topBlur,v.topCompositionStart,v.topKeyDown,v.topKeyPress,v.topKeyUp,v.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:p({onCompositionUpdate:null}),captured:p({onCompositionUpdateCapture:null})},dependencies:[v.topBlur,v.topCompositionUpdate,v.topKeyDown,v.topKeyPress,v.topKeyUp,v.topMouseDown]}};o.prototype.getText=function(){return this.root.value||this.root[d()]},o.prototype.getData=function(){var e=this.getText(),t=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return e.substr(t,e.length-n-t)};var b={eventTypes:_,extractEvents:function(e,t,a,l){var c,d;if(m?c=n(e):y?i(e,l)&&(c=_.compositionEnd):r(e,l)&&(c=_.compositionStart),g&&(y||c!==_.compositionStart?c===_.compositionEnd&&y&&(d=y.getData(),y=null):y=new o(t)),c){var p=u.getPooled(c,a,l);return d&&(p.data=d),s.accumulateTwoPhaseDispatches(p),p}}};t.exports=b},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactInputSelection":63,"./SyntheticCompositionEvent":94,"./getTextContentAccessor":129,"./keyOf":141}],10:[function(e,t){function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r,i=e("./Danger"),o=e("./ReactMultiChildUpdateTypes"),a=e("./getTextContentAccessor"),s=e("./invariant"),l=a();r="textContent"===l?function(e,t){e.textContent=t}:function(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){var n=e.ownerDocument||document;e.appendChild(n.createTextNode(t))}};var c={dangerouslyReplaceNodeWithMarkup:i.dangerouslyReplaceNodeWithMarkup,updateTextContent:r,processUpdates:function(e,t){for(var a,l=null,c=null,u=0;a=e[u];u++)if(a.type===o.MOVE_EXISTING||a.type===o.REMOVE_NODE){var d=a.fromIndex,p=a.parentNode.childNodes[d],f=a.parentID;s(p,"processUpdates(): Unable to find child %s of element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting <p> or <a> tags, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",d,f),l=l||{},l[f]=l[f]||[],l[f][d]=p,c=c||[],c.push(p)}var h=i.dangerouslyRenderMarkup(t);if(c)for(var m=0;m<c.length;m++)c[m].parentNode.removeChild(c[m]);for(var g=0;a=e[g];g++)switch(a.type){case o.INSERT_MARKUP:n(a.parentNode,h[a.markupIndex],a.toIndex);break;case o.MOVE_EXISTING:n(a.parentNode,l[a.parentID][a.fromIndex],a.toIndex);break;case o.TEXT_CONTENT:r(a.parentNode,a.textContent);break;case o.REMOVE_NODE:}}};t.exports=c},{"./Danger":13,"./ReactMultiChildUpdateTypes":69,"./getTextContentAccessor":129,"./invariant":134}],11:[function(e,t){var n=e("./invariant"),r={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=e.Properties||{},i=e.DOMAttributeNames||{},a=e.DOMPropertyNames||{},s=e.DOMMutationMethods||{};e.isCustomAttribute&&o._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var l in t){n(!o.isStandardName.hasOwnProperty(l),"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",l),o.isStandardName[l]=!0;var c=l.toLowerCase();if(o.getPossibleStandardName[c]=l,i.hasOwnProperty(l)){var u=i[l];o.getPossibleStandardName[u]=l,o.getAttributeName[l]=u}else o.getAttributeName[l]=c;o.getPropertyName[l]=a.hasOwnProperty(l)?a[l]:l,o.getMutationMethod[l]=s.hasOwnProperty(l)?s[l]:null;var d=t[l];o.mustUseAttribute[l]=d&r.MUST_USE_ATTRIBUTE,o.mustUseProperty[l]=d&r.MUST_USE_PROPERTY,o.hasSideEffects[l]=d&r.HAS_SIDE_EFFECTS,o.hasBooleanValue[l]=d&r.HAS_BOOLEAN_VALUE,o.hasNumericValue[l]=d&r.HAS_NUMERIC_VALUE,o.hasPositiveNumericValue[l]=d&r.HAS_POSITIVE_NUMERIC_VALUE,o.hasOverloadedBooleanValue[l]=d&r.HAS_OVERLOADED_BOOLEAN_VALUE,n(!o.mustUseAttribute[l]||!o.mustUseProperty[l],"DOMProperty: Cannot require using both attribute and property: %s",l),n(o.mustUseProperty[l]||!o.hasSideEffects[l],"DOMProperty: Properties that have side effects must use property: %s",l),n(!!o.hasBooleanValue[l]+!!o.hasNumericValue[l]+!!o.hasOverloadedBooleanValue[l]<=1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",l)}}},i={},o={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<o._isCustomAttributeFunctions.length;t++){var n=o._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=i[e];return r||(i[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:r};t.exports=o},{"./invariant":134}],12:[function(e,t){function n(e,t){return null==t||r.hasBooleanValue[e]&&!t||r.hasNumericValue[e]&&isNaN(t)||r.hasPositiveNumericValue[e]&&1>t||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e("./DOMProperty"),i=e("./escapeTextForBrowser"),o=e("./memoizeStringOnly"),a=e("./warning"),s=o(function(e){return i(e)+'="'}),l={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},c={},u=function(e){if(!(l.hasOwnProperty(e)&&l[e]||c.hasOwnProperty(e)&&c[e])){c[e]=!0;var t=e.toLowerCase(),n=r.isCustomAttribute(t)?t:r.getPossibleStandardName.hasOwnProperty(t)?r.getPossibleStandardName[t]:null;a(null==n,"Unknown DOM property "+e+". Did you mean "+n+"?")}},d={createMarkupForID:function(e){return s(r.ID_ATTRIBUTE_NAME)+i(e)+'"'},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var o=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?i(o):s(o)+i(t)+'"'}return r.isCustomAttribute(e)?null==t?"":s(e)+i(t)+'"':(u(e),null)},setValueForProperty:function(e,t,i){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var o=r.getMutationMethod[t];if(o)o(e,i);else if(n(t,i))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+i);else{var a=r.getPropertyName[t];r.hasSideEffects[t]&&e[a]===i||(e[a]=i)}}else r.isCustomAttribute(t)?null==i?e.removeAttribute(t):e.setAttribute(t,""+i):u(t)},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var i=r.getPropertyName[t],o=r.getDefaultValueForProperty(e.nodeName,i);r.hasSideEffects[t]&&e[i]===o||(e[i]=o)}}else r.isCustomAttribute(t)?e.removeAttribute(t):u(t)}};t.exports=d},{"./DOMProperty":11,"./escapeTextForBrowser":118,"./memoizeStringOnly":143,"./warning":158}],13:[function(e,t){function n(e){return e.substring(1,e.indexOf(" "))}var r=e("./ExecutionEnvironment"),i=e("./createNodesFromMarkup"),o=e("./emptyFunction"),a=e("./getMarkupWrap"),s=e("./invariant"),l=/^(<[^ \/>]+)/,c="data-danger-index",u={dangerouslyRenderMarkup:function(e){s(r.canUseDOM,"dangerouslyRenderMarkup(...): Cannot render markup in a Worker thread. This is likely a bug in the framework. Please report immediately.");for(var t,u={},d=0;d<e.length;d++)s(e[d],"dangerouslyRenderMarkup(...): Missing markup."),t=n(e[d]),t=a(t)?t:"*",u[t]=u[t]||[],u[t][d]=e[d];var p=[],f=0;for(t in u)if(u.hasOwnProperty(t)){var h=u[t];for(var m in h)if(h.hasOwnProperty(m)){var g=h[m];h[m]=g.replace(l,"$1 "+c+'="'+m+'" ')}var v=i(h.join(""),o);for(d=0;d<v.length;++d){var y=v[d];y.hasAttribute&&y.hasAttribute(c)?(m=+y.getAttribute(c),y.removeAttribute(c),s(!p.hasOwnProperty(m),"Danger: Assigning to an already-occupied result index."),p[m]=y,f+=1):console.error("Danger: Discarding unexpected node:",y)}}return s(f===p.length,"Danger: Did not assign to every index of resultList."),s(p.length===e.length,"Danger: Expected markup to render %s nodes, but rendered %s.",e.length,p.length),p},dangerouslyReplaceNodeWithMarkup:function(e,t){s(r.canUseDOM,"dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. This is likely a bug in the framework. Please report immediately."),s(t,"dangerouslyReplaceNodeWithMarkup(...): Missing markup."),s("html"!==e.tagName.toLowerCase(),"dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See renderComponentToString().");var n=i(t,o)[0];e.parentNode.replaceChild(n,e)}};t.exports=u},{"./ExecutionEnvironment":22,"./createNodesFromMarkup":113,"./emptyFunction":116,"./getMarkupWrap":126,"./invariant":134}],14:[function(e,t){var n=e("./keyOf"),r=[n({ResponderEventPlugin:null}),n({SimpleEventPlugin:null}),n({TapEventPlugin:null}),n({EnterLeaveEventPlugin:null}),n({ChangeEventPlugin:null}),n({SelectEventPlugin:null}),n({CompositionEventPlugin:null}),n({BeforeInputEventPlugin:null}),n({AnalyticsEventPlugin:null}),n({MobileSafariClickEventPlugin:null})];t.exports=r},{"./keyOf":141}],15:[function(e,t){var n=e("./EventConstants"),r=e("./EventPropagators"),i=e("./SyntheticMouseEvent"),o=e("./ReactMount"),a=e("./keyOf"),s=n.topLevelTypes,l=o.getFirstReactDOM,c={mouseEnter:{registrationName:a({onMouseEnter:null}),dependencies:[s.topMouseOut,s.topMouseOver]},mouseLeave:{registrationName:a({onMouseLeave:null}),dependencies:[s.topMouseOut,s.topMouseOver]}},u=[null,null],d={eventTypes:c,extractEvents:function(e,t,n,a){if(e===s.topMouseOver&&(a.relatedTarget||a.fromElement))return null;if(e!==s.topMouseOut&&e!==s.topMouseOver)return null;var d;if(t.window===t)d=t;else{var p=t.ownerDocument;d=p?p.defaultView||p.parentWindow:window}var f,h;if(e===s.topMouseOut?(f=t,h=l(a.relatedTarget||a.toElement)||d):(f=d,h=t),f===h)return null;var m=f?o.getID(f):"",g=h?o.getID(h):"",v=i.getPooled(c.mouseLeave,m,a);v.type="mouseleave",v.target=f,v.relatedTarget=h;var y=i.getPooled(c.mouseEnter,g,a);return y.type="mouseenter",y.target=h,y.relatedTarget=f,r.accumulateEnterLeaveDispatches(v,y,m,g),u[0]=v,u[1]=y,u}};t.exports=d},{"./EventConstants":16,"./EventPropagators":21,"./ReactMount":67,"./SyntheticMouseEvent":100,"./keyOf":141}],16:[function(e,t){var n=e("./keyMirror"),r=n({bubbled:null,captured:null}),i=n({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),o={topLevelTypes:i,PropagationPhases:r};t.exports=o},{"./keyMirror":140}],17:[function(e,t){var n=e("./emptyFunction"),r={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,r){return e.addEventListener?(e.addEventListener(t,r,!0),{remove:function(){e.removeEventListener(t,r,!0)}}):(console.error("Attempted to listen to events during the capture phase on a browser that does not support the capture phase. Your application will not receive some events."),{remove:n})},registerDefault:function(){}};t.exports=r},{"./emptyFunction":116}],18:[function(e,t){function n(){var e=!f||!f.traverseTwoPhase||!f.traverseEnterLeave;if(e)throw new Error("InstanceHandle not injected before use!")}var r=e("./EventPluginRegistry"),i=e("./EventPluginUtils"),o=e("./accumulate"),a=e("./forEachAccumulated"),s=e("./invariant"),l=e("./isEventSupported"),c=e("./monitorCodeUse"),u={},d=null,p=function(e){if(e){var t=i.executeDispatch,n=r.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},f=null,h={injection:{injectMount:i.injection.injectMount,injectInstanceHandle:function(e){f=e,n()},getInstanceHandle:function(){return n(),f},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){s(!n||"function"==typeof n,"Expected %s listener to be a function, instead got type %s",t,typeof n),"onScroll"!==t||l("scroll",!0)||(c("react_no_scroll_event"),console.warn("This browser doesn't support the `onScroll` event"));var r=u[t]||(u[t]={});r[e]=n},getListener:function(e,t){var n=u[t];return n&&n[e]},deleteListener:function(e,t){var n=u[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in u)delete u[t][e]},extractEvents:function(e,t,n,i){for(var a,s=r.plugins,l=0,c=s.length;c>l;l++){var u=s[l];if(u){var d=u.extractEvents(e,t,n,i);d&&(a=o(a,d))}}return a},enqueueEvents:function(e){e&&(d=o(d,e))},processEventQueue:function(){var e=d;d=null,a(e,p),s(!d,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.")},__purge:function(){u={}},__getListenerBank:function(){return u}};t.exports=h},{"./EventPluginRegistry":19,"./EventPluginUtils":20,"./accumulate":106,"./forEachAccumulated":121,"./invariant":134,"./isEventSupported":135,"./monitorCodeUse":148}],19:[function(e,t){function n(){if(a)for(var e in s){var t=s[e],n=a.indexOf(e);if(o(n>-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e),!l.plugins[n]){o(t.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e),l.plugins[n]=t;var i=t.eventTypes;for(var c in i)o(r(i[c],t,c),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",c,e)}}}function r(e,t,n){o(!l.eventNameDispatchConfigs.hasOwnProperty(n),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",n),l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){o(!l.registrationNameModules[e],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var o=e("./invariant"),a=null,s={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){o(!a,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."),a=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];s.hasOwnProperty(r)&&s[r]===i||(o(!s[r],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",r),s[r]=i,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};t.exports=l},{"./invariant":134}],20:[function(e,t){function n(e){return e===g.topMouseUp||e===g.topTouchEnd||e===g.topTouchCancel}function r(e){return e===g.topMouseMove||e===g.topTouchMove}function i(e){return e===g.topMouseDown||e===g.topTouchStart}function o(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(p(e),Array.isArray(n))for(var i=0;i<n.length&&!e.isPropagationStopped();i++)t(e,n[i],r[i]);else n&&t(e,n,r)}function a(e,t,n){e.currentTarget=m.Mount.getNode(n);var r=t(e,n);return e.currentTarget=null,r}function s(e,t){o(e,t),e._dispatchListeners=null,e._dispatchIDs=null}function l(e){var t=e._dispatchListeners,n=e._dispatchIDs;if(p(e),Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function c(e){var t=l(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function u(e){p(e);var t=e._dispatchListeners,n=e._dispatchIDs;h(!Array.isArray(t),"executeDirectDispatch(...): Invalid `event`.");var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function d(e){return!!e._dispatchListeners}var p,f=e("./EventConstants"),h=e("./invariant"),m={Mount:null,injectMount:function(e){m.Mount=e,h(e&&e.getNode,"EventPluginUtils.injection.injectMount(...): Injected Mount module is missing getNode.")}},g=f.topLevelTypes;p=function(e){var t=e._dispatchListeners,n=e._dispatchIDs,r=Array.isArray(t),i=Array.isArray(n),o=i?n.length:n?1:0,a=r?t.length:t?1:0;h(i===r&&o===a,"EventPluginUtils: Invalid `event`.")};var v={isEndish:n,isMoveish:r,isStartish:i,executeDirectDispatch:u,executeDispatch:a,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:c,hasDispatches:d,injection:m,useTouchEvents:!1};t.exports=v},{"./EventConstants":16,"./invariant":134}],21:[function(e,t){function n(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return m(e,r)}function r(e,t,r){if(!e)throw new Error("Dispatching id must not be null");var i=t?h.bubbled:h.captured,o=n(e,r,i);o&&(r._dispatchListeners=p(r._dispatchListeners,o),r._dispatchIDs=p(r._dispatchIDs,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,r,e)}function o(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,i=m(e,r);i&&(n._dispatchListeners=p(n._dispatchListeners,i),n._dispatchIDs=p(n._dispatchIDs,e))}}function a(e){e&&e.dispatchConfig.registrationName&&o(e.dispatchMarker,null,e)}function s(e){f(e,i)}function l(e,t,n,r){d.injection.getInstanceHandle().traverseEnterLeave(n,r,o,e,t)}function c(e){f(e,a)}var u=e("./EventConstants"),d=e("./EventPluginHub"),p=e("./accumulate"),f=e("./forEachAccumulated"),h=u.PropagationPhases,m=d.getListener,g={accumulateTwoPhaseDispatches:s,accumulateDirectDispatches:c,accumulateEnterLeaveDispatches:l};t.exports=g},{"./EventConstants":16,"./EventPluginHub":18,"./accumulate":106,"./forEachAccumulated":121}],22:[function(e,t){var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};t.exports=r},{}],23:[function(e,t){var n,r=e("./DOMProperty"),i=e("./ExecutionEnvironment"),o=r.injection.MUST_USE_ATTRIBUTE,a=r.injection.MUST_USE_PROPERTY,s=r.injection.HAS_BOOLEAN_VALUE,l=r.injection.HAS_SIDE_EFFECTS,c=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,d=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(i.canUseDOM){var p=document.implementation;n=p&&p.hasFeature&&p.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")
20}var f={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,accessKey:null,action:null,allowFullScreen:o|s,allowTransparency:o,alt:null,async:s,autoComplete:null,autoPlay:s,cellPadding:null,cellSpacing:null,charSet:o,checked:a|s,className:n?o:a,cols:o|u,colSpan:null,content:null,contentEditable:null,contextMenu:o,controls:a|s,coords:null,crossOrigin:null,data:null,dateTime:o,defer:s,dir:null,disabled:o|s,download:d,draggable:null,encType:null,form:o,formNoValidate:s,frameBorder:o,height:o,hidden:o|s,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:a,label:null,lang:null,list:null,loop:a|s,max:null,maxLength:o,media:o,mediaGroup:null,method:null,min:null,multiple:a|s,muted:a|s,name:null,noValidate:s,open:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:a|s,rel:null,required:s,role:o,rows:o|u,rowSpan:null,sandbox:null,scope:null,scrollLeft:a,scrolling:null,scrollTop:a,seamless:o|s,selected:a|s,shape:null,size:o|u,sizes:o,span:u,spellCheck:null,src:null,srcDoc:a,srcSet:o,start:c,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:a|l,width:o,wmode:o,autoCapitalize:null,autoCorrect:null,itemProp:o,itemScope:o|s,itemType:o,property:null},DOMAttributeNames:{className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"enctype",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=f},{"./DOMProperty":11,"./ExecutionEnvironment":22}],24:[function(e,t){var n=e("./ReactLink"),r=e("./ReactStateSetters"),i={linkState:function(e){return new n(this.state[e],r.createStateKeySetter(this,e))}};t.exports=i},{"./ReactLink":65,"./ReactStateSetters":81}],25:[function(e,t){function n(e){l(null==e.props.checkedLink||null==e.props.valueLink,"Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don't want to use valueLink and vice versa.")}function r(e){n(e),l(null==e.props.value&&null==e.props.onChange,"Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don't want to use valueLink.")}function i(e){n(e),l(null==e.props.checked&&null==e.props.onChange,"Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don't want to use checkedLink")}function o(e){this.props.valueLink.requestChange(e.target.value)}function a(e){this.props.checkedLink.requestChange(e.target.checked)}var s=e("./ReactPropTypes"),l=e("./invariant"),c={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},u={Mixin:{propTypes:{value:function(e,t){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?void 0:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t){return!e[t]||e.onChange||e.readOnly||e.disabled?void 0:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func}},getValue:function(e){return e.props.valueLink?(r(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(i(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(r(e),o):e.props.checkedLink?(i(e),a):e.props.onChange}};t.exports=u},{"./ReactPropTypes":75,"./invariant":134}],26:[function(e,t){function n(e){e.remove()}var r=e("./ReactBrowserEventEmitter"),i=e("./accumulate"),o=e("./forEachAccumulated"),a=e("./invariant"),s={trapBubbledEvent:function(e,t){a(this.isMounted(),"Must be mounted to trap events");var n=r.trapBubbledEvent(e,t,this.getDOMNode());this._localEventListeners=i(this._localEventListeners,n)},componentWillUnmount:function(){this._localEventListeners&&o(this._localEventListeners,n)}};t.exports=s},{"./ReactBrowserEventEmitter":31,"./accumulate":106,"./forEachAccumulated":121,"./invariant":134}],27:[function(e,t){var n=e("./EventConstants"),r=e("./emptyFunction"),i=n.topLevelTypes,o={eventTypes:null,extractEvents:function(e,t,n,o){if(e===i.topTouchStart){var a=o.target;a&&!a.onclick&&(a.onclick=r)}}};t.exports=o},{"./EventConstants":16,"./emptyFunction":116}],28:[function(e,t){var n=e("./invariant"),r=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},o=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},a=function(e,t,n,r,i){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r,i),a}return new o(e,t,n,r,i)},s=function(e){var t=this;n(e instanceof t,"Trying to release an instance into a pool of a different type."),e.destructor&&e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=10,c=r,u=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||c,n.poolSize||(n.poolSize=l),n.release=s,n},d={addPoolingTo:u,oneArgumentPooler:r,twoArgumentPooler:i,threeArgumentPooler:o,fiveArgumentPooler:a};t.exports=d},{"./invariant":134}],29:[function(e,t){function n(e){var t=Array.prototype.slice.call(arguments,1);return e.apply(null,t)}var r=e("./DOMPropertyOperations"),i=e("./EventPluginUtils"),o=e("./ReactChildren"),a=e("./ReactComponent"),s=e("./ReactCompositeComponent"),l=e("./ReactContext"),c=e("./ReactCurrentOwner"),u=e("./ReactDescriptor"),d=e("./ReactDOM"),p=e("./ReactDOMComponent"),f=e("./ReactDefaultInjection"),h=e("./ReactInstanceHandles"),m=e("./ReactMount"),g=e("./ReactMultiChild"),v=e("./ReactPerf"),y=e("./ReactPropTypes"),_=e("./ReactServerRendering"),b=e("./ReactTextComponent"),E=e("./onlyChild"),w=e("./warning");f.inject();var S=!1,C={Children:{map:o.map,forEach:o.forEach,count:o.count,only:E},DOM:d,PropTypes:y,initializeTouchEvents:function(e){i.useTouchEvents=e},createClass:s.createClass,createDescriptor:function(){return w(S,"React.createDescriptor is deprecated and will be removed in the next version of React. Use React.createElement instead."),S=!0,n.apply(this,arguments)},createElement:n,constructAndRenderComponent:m.constructAndRenderComponent,constructAndRenderComponentByID:m.constructAndRenderComponentByID,renderComponent:v.measure("React","renderComponent",m.renderComponent),renderComponentToString:_.renderComponentToString,renderComponentToStaticMarkup:_.renderComponentToStaticMarkup,unmountComponentAtNode:m.unmountComponentAtNode,isValidClass:u.isValidFactory,isValidComponent:u.isValidDescriptor,withContext:l.withContext,__internals:{Component:a,CurrentOwner:c,DOMComponent:p,DOMPropertyOperations:r,InstanceHandles:h,Mount:m,MultiChild:g,TextComponent:b}},I=e("./ExecutionEnvironment");if(I.canUseDOM&&window.top===window.self&&navigator.userAgent.indexOf("Chrome")>-1){console.debug("Download the React DevTools for a better development experience: http://fb.me/react-devtools");var k=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze];for(var x in k)if(!k[x]){console.error("One or more ES5 shim/shams expected by React are not available: http://fb.me/react-warning-polyfills");break}}C.version="0.11.2",t.exports=C},{"./DOMPropertyOperations":12,"./EventPluginUtils":20,"./ExecutionEnvironment":22,"./ReactChildren":34,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDOM":41,"./ReactDOMComponent":43,"./ReactDefaultInjection":53,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./ReactPropTypes":75,"./ReactServerRendering":79,"./ReactTextComponent":83,"./onlyChild":149,"./warning":158}],30:[function(e,t){var n=e("./ReactEmptyComponent"),r=e("./ReactMount"),i=e("./invariant"),o={getDOMNode:function(){return i(this.isMounted(),"getDOMNode(): A component must be mounted to have a DOM node."),n.isNullComponentID(this._rootNodeID)?null:r.getNode(this._rootNodeID)}};t.exports=o},{"./ReactEmptyComponent":58,"./ReactMount":67,"./invariant":134}],31:[function(e,t){function n(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=p++,u[e[h]]={}),u[e[h]]}var r=e("./EventConstants"),i=e("./EventPluginHub"),o=e("./EventPluginRegistry"),a=e("./ReactEventEmitterMixin"),s=e("./ViewportMetrics"),l=e("./isEventSupported"),c=e("./merge"),u={},d=!1,p=0,f={topBlur:"blur",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2),m=c(a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var i=t,a=n(i),s=o.registrationNameDependencies[e],c=r.topLevelTypes,u=0,d=s.length;d>u;u++){var p=s[u];a.hasOwnProperty(p)&&a[p]||(p===c.topWheel?l("wheel")?m.ReactEventListener.trapBubbledEvent(c.topWheel,"wheel",i):l("mousewheel")?m.ReactEventListener.trapBubbledEvent(c.topWheel,"mousewheel",i):m.ReactEventListener.trapBubbledEvent(c.topWheel,"DOMMouseScroll",i):p===c.topScroll?l("scroll",!0)?m.ReactEventListener.trapCapturedEvent(c.topScroll,"scroll",i):m.ReactEventListener.trapBubbledEvent(c.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):p===c.topFocus||p===c.topBlur?(l("focus",!0)?(m.ReactEventListener.trapCapturedEvent(c.topFocus,"focus",i),m.ReactEventListener.trapCapturedEvent(c.topBlur,"blur",i)):l("focusin")&&(m.ReactEventListener.trapBubbledEvent(c.topFocus,"focusin",i),m.ReactEventListener.trapBubbledEvent(c.topBlur,"focusout",i)),a[c.topBlur]=!0,a[c.topFocus]=!0):f.hasOwnProperty(p)&&m.ReactEventListener.trapBubbledEvent(p,f[p],i),a[p]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:i.eventNameDispatchConfigs,registrationNameModules:i.registrationNameModules,putListener:i.putListener,getListener:i.getListener,deleteListener:i.deleteListener,deleteAllListeners:i.deleteAllListeners});t.exports=m},{"./EventConstants":16,"./EventPluginHub":18,"./EventPluginRegistry":19,"./ReactEventEmitterMixin":60,"./ViewportMetrics":105,"./isEventSupported":135,"./merge":144}],32:[function(e,t){var n=e("./React"),r=e("./ReactTransitionGroup"),i=e("./ReactCSSTransitionGroupChild"),o=n.createClass({displayName:"ReactCSSTransitionGroup",propTypes:{transitionName:n.PropTypes.string.isRequired,transitionEnter:n.PropTypes.bool,transitionLeave:n.PropTypes.bool},getDefaultProps:function(){return{transitionEnter:!0,transitionLeave:!0}},_wrapChild:function(e){return i({name:this.props.transitionName,enter:this.props.transitionEnter,leave:this.props.transitionLeave},e)},render:function(){return this.transferPropsTo(r({childFactory:this._wrapChild},this.props.children))}});t.exports=o},{"./React":29,"./ReactCSSTransitionGroupChild":33,"./ReactTransitionGroup":86}],33:[function(e,t){var n=e("./React"),r=e("./CSSCore"),i=e("./ReactTransitionEvents"),o=e("./onlyChild"),a=17,s=5e3,l=null;l=function(){console.warn("transition(): tried to perform an animation without an animationend or transitionend event after timeout ("+s+"ms). You should either disable this transition in JS or add a CSS animation/transition.")};var c=n.createClass({displayName:"ReactCSSTransitionGroupChild",transition:function(e,t){var n=this.getDOMNode(),o=this.props.name+"-"+e,a=o+"-active",c=null,u=function(){clearTimeout(c),r.removeClass(n,o),r.removeClass(n,a),i.removeEndEventListener(n,u),t&&t()};i.addEndEventListener(n,u),r.addClass(n,o),this.queueClass(a),c=setTimeout(l,s)},queueClass:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,a))},flushClassNameQueue:function(){this.isMounted()&&this.classNameQueue.forEach(r.addClass.bind(r,this.getDOMNode())),this.classNameQueue.length=0,this.timeout=null},componentWillMount:function(){this.classNameQueue=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout)},componentWillEnter:function(e){this.props.enter?this.transition("enter",e):e()},componentWillLeave:function(e){this.props.leave?this.transition("leave",e):e()},render:function(){return o(this.props.children)}});t.exports=c},{"./CSSCore":3,"./React":29,"./ReactTransitionEvents":85,"./onlyChild":149}],34:[function(e,t){function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var i=e;i.forEachFunction.call(i.forEachContext,t,r)}function i(e,t,i){if(null==e)return e;var o=n.getPooled(t,i);d(e,r,o),n.release(o)}function o(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function a(e,t,n,r){var i=e,o=i.mapResult,a=!o.hasOwnProperty(n);if(p(a,"ReactChildren.map(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n),a){var s=i.mapFunction.call(i.mapContext,t,r);o[n]=s}}function s(e,t,n){if(null==e)return e;var r={},i=o.getPooled(r,t,n);return d(e,a,i),o.release(i),r}function l(){return null}function c(e){return d(e,l,null)}var u=e("./PooledClass"),d=e("./traverseAllChildren"),p=e("./warning"),f=u.twoArgumentPooler,h=u.threeArgumentPooler;u.addPoolingTo(n,f),u.addPoolingTo(o,h);var m={forEach:i,map:s,count:c};t.exports=m},{"./PooledClass":28,"./traverseAllChildren":156,"./warning":158}],35:[function(e,t){var n=e("./ReactDescriptor"),r=e("./ReactOwner"),i=e("./ReactUpdates"),o=e("./invariant"),a=e("./keyMirror"),s=e("./merge"),l=a({MOUNTED:null,UNMOUNTED:null}),c=!1,u=null,d=null,p={injection:{injectEnvironment:function(e){o(!c,"ReactComponent: injectEnvironment() can only be called once."),d=e.mountImageIntoNode,u=e.unmountIDFromEnvironment,p.BackendIDOperations=e.BackendIDOperations,c=!0}},LifeCycle:l,BackendIDOperations:null,Mixin:{isMounted:function(){return this._lifeCycleState===l.MOUNTED},setProps:function(e,t){var n=this._pendingDescriptor||this._descriptor;this.replaceProps(s(n.props,e),t)},replaceProps:function(e,t){o(this.isMounted(),"replaceProps(...): Can only update a mounted component."),o(0===this._mountDepth,"replaceProps(...): You called `setProps` or `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."),this._pendingDescriptor=n.cloneAndReplaceProps(this._pendingDescriptor||this._descriptor,e),i.enqueueUpdate(this,t)},_setPropsInternal:function(e,t){var r=this._pendingDescriptor||this._descriptor;this._pendingDescriptor=n.cloneAndReplaceProps(r,s(r.props,e)),i.enqueueUpdate(this,t)},construct:function(e){this.props=e.props,this._owner=e._owner,this._lifeCycleState=l.UNMOUNTED,this._pendingCallbacks=null,this._descriptor=e,this._pendingDescriptor=null},mountComponent:function(e,t,n){o(!this.isMounted(),"mountComponent(%s, ...): Can only mount an unmounted component. Make sure to avoid storing components between renders or reusing a single component instance in multiple places.",e);var i=this._descriptor.props;if(null!=i.ref){var a=this._descriptor._owner;r.addComponentAsRefTo(this,i.ref,a)}this._rootNodeID=e,this._lifeCycleState=l.MOUNTED,this._mountDepth=n},unmountComponent:function(){o(this.isMounted(),"unmountComponent(): Can only unmount a mounted component.");var e=this.props;null!=e.ref&&r.removeComponentAsRefFrom(this,e.ref,this._owner),u(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=l.UNMOUNTED},receiveComponent:function(e,t){o(this.isMounted(),"receiveComponent(...): Can only update a mounted component."),this._pendingDescriptor=e,this.performUpdateIfNecessary(t)},performUpdateIfNecessary:function(e){if(null!=this._pendingDescriptor){var t=this._descriptor,n=this._pendingDescriptor;this._descriptor=n,this.props=n.props,this._owner=n._owner,this._pendingDescriptor=null,this.updateComponent(e,t)}},updateComponent:function(e,t){var n=this._descriptor;(n._owner!==t._owner||n.props.ref!==t.props.ref)&&(null!=t.props.ref&&r.removeComponentAsRefFrom(this,t.props.ref,t._owner),null!=n.props.ref&&r.addComponentAsRefTo(this,n.props.ref,n._owner))},mountComponentIntoNode:function(e,t,n){var r=i.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,e,t,r,n),i.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(e,t,n,r){var i=this.mountComponent(e,n,0);d(i,t,r)},isOwnedBy:function(e){return this._owner===e},getSiblingByRef:function(e){var t=this._owner;return t&&t.refs?t.refs[e]:null}}};t.exports=p},{"./ReactDescriptor":56,"./ReactOwner":70,"./ReactUpdates":87,"./invariant":134,"./keyMirror":140,"./merge":144}],36:[function(e,t){var n=e("./ReactDOMIDOperations"),r=e("./ReactMarkupChecksum"),i=e("./ReactMount"),o=e("./ReactPerf"),a=e("./ReactReconcileTransaction"),s=e("./getReactRootElementInContainer"),l=e("./invariant"),c=e("./setInnerHTML"),u=1,d=9,p={ReactReconcileTransaction:a,BackendIDOperations:n,unmountIDFromEnvironment:function(e){i.purgeID(e)},mountImageIntoNode:o.measure("ReactComponentBrowserEnvironment","mountImageIntoNode",function(e,t,n){if(l(t&&(t.nodeType===u||t.nodeType===d),"mountComponentIntoNode(...): Target container is not valid."),n){if(r.canReuseMarkup(e,s(t)))return;l(t.nodeType!==d,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side."),console.warn("React attempted to use reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server.")}l(t.nodeType!==d,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See renderComponentToString() for server rendering."),c(t,e)})};t.exports=p},{"./ReactDOMIDOperations":45,"./ReactMarkupChecksum":66,"./ReactMount":67,"./ReactPerf":71,"./ReactReconcileTransaction":77,"./getReactRootElementInContainer":128,"./invariant":134,"./setInnerHTML":152}],37:[function(e,t){var n=e("./shallowEqual"),r={shouldComponentUpdate:function(e,t){return!n(this.props,e)||!n(this.state,t)}};t.exports=r},{"./shallowEqual":153}],38:[function(e,t){function n(e){var t=e._owner||null;return t&&t.constructor&&t.constructor.displayName?" Check the render method of `"+t.constructor.displayName+"`.":""}function r(e,t,n){for(var r in t)t.hasOwnProperty(r)&&I("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactCompositeComponent",w[n],r)}function i(e,t){var n=N.hasOwnProperty(t)?N[t]:null;$.hasOwnProperty(t)&&I(n===R.OVERRIDE_BASE,"ReactCompositeComponentInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e.hasOwnProperty(t)&&I(n===R.DEFINE_MANY||n===R.DEFINE_MANY_MERGED,"ReactCompositeComponentInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function o(e){var t=e._compositeLifeCycleState;I(e.isMounted()||t===F.MOUNTING,"replaceState(...): Can only update a mounted or mounting component."),I(t!==F.RECEIVING_STATE,"replaceState(...): Cannot update during an existing state transition (such as within `render`). This could potentially cause an infinite loop so it is forbidden."),I(t!==F.UNMOUNTING,"replaceState(...): Cannot update while unmounting component. This usually means you called setState() on an unmounted component.")}function a(e,t){I(!h.isValidFactory(t),"ReactCompositeComponent: You're attempting to use a component class as a mixin. Instead, just use a regular object."),I(!h.isValidDescriptor(t),"ReactCompositeComponent: You're attempting to use a component as a mixin. Instead, just use a regular object.");var n=e.prototype;for(var r in t){var o=t[r];if(t.hasOwnProperty(r))if(i(n,r),P.hasOwnProperty(r))P[r](e,o);else{var a=N.hasOwnProperty(r),s=n.hasOwnProperty(r),l=o&&o.__reactDontBind,d="function"==typeof o,p=d&&!a&&!s&&!l;if(p)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=o,n[r]=o;else if(s){var f=N[r];I(a&&(f===R.DEFINE_MANY_MERGED||f===R.DEFINE_MANY),"ReactCompositeComponent: Unexpected spec policy %s for key %s when mixing in component specs.",f,r),f===R.DEFINE_MANY_MERGED?n[r]=c(n[r],o):f===R.DEFINE_MANY&&(n[r]=u(n[r],o))}else n[r]=o,"function"==typeof o&&t.displayName&&(n[r].displayName=t.displayName+"_"+r)}}}function s(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var i=n in e,o=r;if(i){var a=e[n],s=typeof a,l=typeof r;I("function"===s&&"function"===l,"ReactCompositeComponent: You are attempting to define `%s` on your component more than once, but that is only supported for functions, which are chained together. This conflict may be due to a mixin.",n),o=u(a,r)}e[n]=o}}}function l(e,t){return I(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects"),M(t,function(t,n){I(void 0===e[n],"mergeObjectsWithNoDuplicateKeys(): Tried to merge two objects with the same key: %s",n),e[n]=t}),e}function c(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);return null==n?r:null==r?n:l(n,r)}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}var d=e("./ReactComponent"),p=e("./ReactContext"),f=e("./ReactCurrentOwner"),h=e("./ReactDescriptor"),m=e("./ReactDescriptorValidator"),g=e("./ReactEmptyComponent"),v=e("./ReactErrorUtils"),y=e("./ReactOwner"),_=e("./ReactPerf"),b=e("./ReactPropTransferer"),E=e("./ReactPropTypeLocations"),w=e("./ReactPropTypeLocationNames"),S=e("./ReactUpdates"),C=e("./instantiateReactComponent"),I=e("./invariant"),k=e("./keyMirror"),x=e("./merge"),T=e("./mixInto"),D=e("./monitorCodeUse"),M=e("./mapObject"),O=e("./shouldUpdateReactComponent"),L=e("./warning"),R=k({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),A=[],N={mixins:R.DEFINE_MANY,statics:R.DEFINE_MANY,propTypes:R.DEFINE_MANY,contextTypes:R.DEFINE_MANY,childContextTypes:R.DEFINE_MANY,getDefaultProps:R.DEFINE_MANY_MERGED,getInitialState:R.DEFINE_MANY_MERGED,getChildContext:R.DEFINE_MANY_MERGED,render:R.DEFINE_ONCE,componentWillMount:R.DEFINE_MANY,componentDidMount:R.DEFINE_MANY,componentWillReceiveProps:R.DEFINE_MANY,shouldComponentUpdate:R.DEFINE_ONCE,componentWillUpdate:R.DEFINE_MANY,componentDidUpdate:R.DEFINE_MANY,componentWillUnmount:R.DEFINE_MANY,updateComponent:R.OVERRIDE_BASE},P={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){r(e,t,E.childContext),e.childContextTypes=x(e.childContextTypes,t)},contextTypes:function(e,t){r(e,t,E.context),e.contextTypes=x(e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?c(e.getDefaultProps,t):t},propTypes:function(e,t){r(e,t,E.prop),e.propTypes=x(e.propTypes,t)},statics:function(e,t){s(e,t)}},F=k({MOUNTING:null,UNMOUNTING:null,RECEIVING_PROPS:null,RECEIVING_STATE:null}),$={construct:function(){d.Mixin.construct.apply(this,arguments),y.Mixin.construct.apply(this,arguments),this.state=null,this._pendingState=null,this.context=null,this._compositeLifeCycleState=null},isMounted:function(){return d.Mixin.isMounted.call(this)&&this._compositeLifeCycleState!==F.MOUNTING},mountComponent:_.measure("ReactCompositeComponent","mountComponent",function(e,t,n){d.Mixin.mountComponent.call(this,e,t,n),this._compositeLifeCycleState=F.MOUNTING,this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.context=this._processContext(this._descriptor._context),this.props=this._processProps(this.props),this.state=this.getInitialState?this.getInitialState():null,I("object"==typeof this.state&&!Array.isArray(this.state),"%s.getInitialState(): must return an object or null",this.constructor.displayName||"ReactCompositeComponent"),this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=C(this._renderValidatedComponent()),this._compositeLifeCycleState=null;var r=this._renderedComponent.mountComponent(e,t,n+1);return this.componentDidMount&&t.getReactMountReady().enqueue(this.componentDidMount,this),r}),unmountComponent:function(){this._compositeLifeCycleState=F.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._renderedComponent.unmountComponent(),this._renderedComponent=null,d.Mixin.unmountComponent.call(this)},setState:function(e,t){I("object"==typeof e||null==e,"setState(...): takes an object of state variables to update."),L(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."),this.replaceState(x(this._pendingState||this.state,e),t)},replaceState:function(e,t){o(this),this._pendingState=e,this._compositeLifeCycleState!==F.MOUNTING&&S.enqueueUpdate(this,t)},_processContext:function(e){var t=null,n=this.constructor.contextTypes;if(n){t={};for(var r in n)t[r]=e[r];this._checkPropTypes(n,t,E.context)}return t},_processChildContext:function(e){var t=this.getChildContext&&this.getChildContext(),n=this.constructor.displayName||"ReactCompositeComponent";if(t){I("object"==typeof this.constructor.childContextTypes,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",n),this._checkPropTypes(this.constructor.childContextTypes,t,E.childContext);for(var r in t)I(r in this.constructor.childContextTypes,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',n,r);return x(e,t)}return e},_processProps:function(e){var t,n=this.constructor.defaultProps;if(n){t=x(e);for(var r in n)"undefined"==typeof t[r]&&(t[r]=n[r])}else t=e;var i=this.constructor.propTypes;return i&&this._checkPropTypes(i,t,E.prop),t},_checkPropTypes:function(e,t,r){var i=this.constructor.displayName;for(var o in e)if(e.hasOwnProperty(o)){var a=e[o](t,o,i,r);if(a instanceof Error){var s=n(this);L(!1,a.message+s)}}},performUpdateIfNecessary:function(e){var t=this._compositeLifeCycleState;if(t!==F.MOUNTING&&t!==F.RECEIVING_PROPS&&(null!=this._pendingDescriptor||null!=this._pendingState||this._pendingForceUpdate)){var n=this.context,r=this.props,i=this._descriptor;null!=this._pendingDescriptor&&(i=this._pendingDescriptor,n=this._processContext(i._context),r=this._processProps(i.props),this._pendingDescriptor=null,this._compositeLifeCycleState=F.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(r,n)),this._compositeLifeCycleState=F.RECEIVING_STATE;var o=this._pendingState||this.state;this._pendingState=null;try{var a=this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(r,o,n);"undefined"==typeof a&&console.warn((this.constructor.displayName||"ReactCompositeComponent")+".shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false."),a?(this._pendingForceUpdate=!1,this._performComponentUpdate(i,r,o,n,e)):(this._descriptor=i,this.props=r,this.state=o,this.context=n,this._owner=i._owner)}finally{this._compositeLifeCycleState=null}}},_performComponentUpdate:function(e,t,n,r,i){var o=this._descriptor,a=this.props,s=this.state,l=this.context;this.componentWillUpdate&&this.componentWillUpdate(t,n,r),this._descriptor=e,this.props=t,this.state=n,this.context=r,this._owner=e._owner,this.updateComponent(i,o),this.componentDidUpdate&&i.getReactMountReady().enqueue(this.componentDidUpdate.bind(this,a,s,l),this)},receiveComponent:function(e,t){(e!==this._descriptor||null==e._owner)&&d.Mixin.receiveComponent.call(this,e,t)},updateComponent:_.measure("ReactCompositeComponent","updateComponent",function(e,t){d.Mixin.updateComponent.call(this,e,t);var n=this._renderedComponent,r=n._descriptor,i=this._renderValidatedComponent();if(O(r,i))n.receiveComponent(i,e);else{var o=this._rootNodeID,a=n._rootNodeID;n.unmountComponent(),this._renderedComponent=C(i);var s=this._renderedComponent.mountComponent(o,e,this._mountDepth+1);d.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID(a,s)}}),forceUpdate:function(e){var t=this._compositeLifeCycleState;I(this.isMounted()||t===F.MOUNTING,"forceUpdate(...): Can only force an update on mounted or mounting components."),I(t!==F.RECEIVING_STATE&&t!==F.UNMOUNTING,"forceUpdate(...): Cannot force an update while unmounting component or during an existing state transition (such as within `render`)."),this._pendingForceUpdate=!0,S.enqueueUpdate(this,e)},_renderValidatedComponent:_.measure("ReactCompositeComponent","_renderValidatedComponent",function(){var e,t=p.current;p.current=this._processChildContext(this._descriptor._context),f.current=this;try{e=this.render(),null===e||e===!1?(e=g.getEmptyComponent(),g.registerNullComponentID(this._rootNodeID)):g.deregisterNullComponentID(this._rootNodeID)}finally{p.current=t,f.current=null}return I(h.isValidDescriptor(e),"%s.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.",this.constructor.displayName||"ReactCompositeComponent"),e}),_bindAutoBindMethods:function(){for(var e in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(e)){var t=this.__reactAutoBindMap[e];this[e]=this._bindAutoBindMethod(v.guard(t,this.constructor.displayName+"."+e))}},_bindAutoBindMethod:function(e){var t=this,n=function(){return e.apply(t,arguments)};n.__reactBoundContext=t,n.__reactBoundMethod=e,n.__reactBoundArguments=null;var r=t.constructor.displayName,i=n.bind;
21return n.bind=function(o){var a=Array.prototype.slice.call(arguments,1);if(o!==t&&null!==o)D("react_bind_warning",{component:r}),console.warn("bind(): React component methods may only be bound to the component instance. See "+r);else if(!a.length)return D("react_bind_warning",{component:r}),console.warn("bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See "+r),n;var s=i.apply(n,arguments);return s.__reactBoundContext=t,s.__reactBoundMethod=e,s.__reactBoundArguments=a,s},n}},U=function(){};T(U,d.Mixin),T(U,y.Mixin),T(U,b.Mixin),T(U,$);var j={LifeCycle:F,Base:U,createClass:function(e){var t=function(e,t){this.construct(e,t)};t.prototype=new U,t.prototype.constructor=t,A.forEach(a.bind(null,t)),a(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),I(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),t.prototype.componentShouldUpdate&&(D("react_component_should_update_warning",{component:e.displayName}),console.warn((e.displayName||"A component")+" has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value."));for(var n in N)t.prototype[n]||(t.prototype[n]=null);var r=h.createFactory(t);return m.createFactory(r,t.propTypes,t.contextTypes)},injection:{injectMixin:function(e){A.push(e)}}};t.exports=j},{"./ReactComponent":35,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactDescriptorValidator":57,"./ReactEmptyComponent":58,"./ReactErrorUtils":59,"./ReactOwner":70,"./ReactPerf":71,"./ReactPropTransferer":72,"./ReactPropTypeLocationNames":73,"./ReactPropTypeLocations":74,"./ReactUpdates":87,"./instantiateReactComponent":133,"./invariant":134,"./keyMirror":140,"./mapObject":142,"./merge":144,"./mixInto":147,"./monitorCodeUse":148,"./shouldUpdateReactComponent":154,"./warning":158}],39:[function(e,t){var n=e("./merge"),r={current:{},withContext:function(e,t){var i,o=r.current;r.current=n(o,e);try{i=t()}finally{r.current=o}return i}};t.exports=r},{"./merge":144}],40:[function(e,t){var n={current:null};t.exports=n},{}],41:[function(e,t){function n(e,t){var n=function(e){this.construct(e)};n.prototype=new o(t,e),n.prototype.constructor=n,n.displayName=t;var a=r.createFactory(n);return i.createFactory(a)}var r=e("./ReactDescriptor"),i=e("./ReactDescriptorValidator"),o=e("./ReactDOMComponent"),a=e("./mergeInto"),s=e("./mapObject"),l=s({a:!1,abbr:!1,address:!1,area:!0,article:!1,aside:!1,audio:!1,b:!1,base:!0,bdi:!1,bdo:!1,big:!1,blockquote:!1,body:!1,br:!0,button:!1,canvas:!1,caption:!1,cite:!1,code:!1,col:!0,colgroup:!1,data:!1,datalist:!1,dd:!1,del:!1,details:!1,dfn:!1,dialog:!1,div:!1,dl:!1,dt:!1,em:!1,embed:!0,fieldset:!1,figcaption:!1,figure:!1,footer:!1,form:!1,h1:!1,h2:!1,h3:!1,h4:!1,h5:!1,h6:!1,head:!1,header:!1,hr:!0,html:!1,i:!1,iframe:!1,img:!0,input:!0,ins:!1,kbd:!1,keygen:!0,label:!1,legend:!1,li:!1,link:!0,main:!1,map:!1,mark:!1,menu:!1,menuitem:!1,meta:!0,meter:!1,nav:!1,noscript:!1,object:!1,ol:!1,optgroup:!1,option:!1,output:!1,p:!1,param:!0,picture:!1,pre:!1,progress:!1,q:!1,rp:!1,rt:!1,ruby:!1,s:!1,samp:!1,script:!1,section:!1,select:!1,small:!1,source:!0,span:!1,strong:!1,style:!1,sub:!1,summary:!1,sup:!1,table:!1,tbody:!1,td:!1,textarea:!1,tfoot:!1,th:!1,thead:!1,time:!1,title:!1,tr:!1,track:!0,u:!1,ul:!1,"var":!1,video:!1,wbr:!0,circle:!1,defs:!1,ellipse:!1,g:!1,line:!1,linearGradient:!1,mask:!1,path:!1,pattern:!1,polygon:!1,polyline:!1,radialGradient:!1,rect:!1,stop:!1,svg:!1,text:!1,tspan:!1},n),c={injectComponentClasses:function(e){a(l,e)}};l.injection=c,t.exports=l},{"./ReactDOMComponent":43,"./ReactDescriptor":56,"./ReactDescriptorValidator":57,"./mapObject":142,"./mergeInto":146}],42:[function(e,t){var n=e("./AutoFocusMixin"),r=e("./ReactBrowserComponentMixin"),i=e("./ReactCompositeComponent"),o=e("./ReactDOM"),a=e("./keyMirror"),s=o.button,l=a({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),c=i.createClass({displayName:"ReactDOMButton",mixins:[n,r],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&l[t]||(e[t]=this.props[t]);return s(e,this.props.children)}});t.exports=c},{"./AutoFocusMixin":1,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./keyMirror":140}],43:[function(e,t){function n(e){e&&(m(null==e.children||null==e.dangerouslySetInnerHTML,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."),m(null==e.style||"object"==typeof e.style,"The `style` prop expects a mapping from style properties to values, not a string."))}function r(e,t,n,r){var i=d.findReactContainerForID(e);if(i){var o=i.nodeType===C?i.ownerDocument:i;b(t,o)}r.getPutListenerQueue().enqueuePutListener(e,t,n)}function i(e,t){this._tagOpen="<"+e,this._tagClose=t?"":"</"+e+">",this.tagName=e.toUpperCase()}var o=e("./CSSPropertyOperations"),a=e("./DOMProperty"),s=e("./DOMPropertyOperations"),l=e("./ReactBrowserComponentMixin"),c=e("./ReactComponent"),u=e("./ReactBrowserEventEmitter"),d=e("./ReactMount"),p=e("./ReactMultiChild"),f=e("./ReactPerf"),h=e("./escapeTextForBrowser"),m=e("./invariant"),g=e("./keyOf"),v=e("./merge"),y=e("./mixInto"),_=u.deleteListener,b=u.listenTo,E=u.registrationNameModules,w={string:!0,number:!0},S=g({style:null}),C=1;i.Mixin={mountComponent:f.measure("ReactDOMComponent","mountComponent",function(e,t,r){return c.Mixin.mountComponent.call(this,e,t,r),n(this.props),this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t)+this._tagClose}),_createOpenTagMarkupAndPutListeners:function(e){var t=this.props,n=this._tagOpen;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];if(null!=a)if(E.hasOwnProperty(i))r(this._rootNodeID,i,a,e);else{i===S&&(a&&(a=t.style=v(t.style)),a=o.createMarkupForStyles(a));var l=s.createMarkupForProperty(i,a);l&&(n+=" "+l)}}if(e.renderToStaticMarkup)return n+">";var c=s.createMarkupForID(this._rootNodeID);return n+" "+c+">"},_createContentMarkup:function(e){var t=this.props.dangerouslySetInnerHTML;if(null!=t){if(null!=t.__html)return t.__html}else{var n=w[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return h(n);if(null!=r){var i=this.mountChildren(r,e);return i.join("")}}return""},receiveComponent:function(e,t){(e!==this._descriptor||null==e._owner)&&c.Mixin.receiveComponent.call(this,e,t)},updateComponent:f.measure("ReactDOMComponent","updateComponent",function(e,t){n(this._descriptor.props),c.Mixin.updateComponent.call(this,e,t),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e)}),_updateDOMProperties:function(e,t){var n,i,o,s=this.props;for(n in e)if(!s.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===S){var l=e[n];for(i in l)l.hasOwnProperty(i)&&(o=o||{},o[i]="")}else E.hasOwnProperty(n)?_(this._rootNodeID,n):(a.isStandardName[n]||a.isCustomAttribute(n))&&c.BackendIDOperations.deletePropertyByID(this._rootNodeID,n);for(n in s){var u=s[n],d=e[n];if(s.hasOwnProperty(n)&&u!==d)if(n===S)if(u&&(u=s.style=v(u)),d){for(i in d)!d.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(o=o||{},o[i]="");for(i in u)u.hasOwnProperty(i)&&d[i]!==u[i]&&(o=o||{},o[i]=u[i])}else o=u;else E.hasOwnProperty(n)?r(this._rootNodeID,n,u,t):(a.isStandardName[n]||a.isCustomAttribute(n))&&c.BackendIDOperations.updatePropertyByID(this._rootNodeID,n,u)}o&&c.BackendIDOperations.updateStylesByID(this._rootNodeID,o)},_updateDOMChildren:function(e,t){var n=this.props,r=w[typeof e.children]?e.children:null,i=w[typeof n.children]?n.children:null,o=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,a=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,s=null!=r?null:e.children,l=null!=i?null:n.children,u=null!=r||null!=o,d=null!=i||null!=a;null!=s&&null==l?this.updateChildren(null,t):u&&!d&&this.updateTextContent(""),null!=i?r!==i&&this.updateTextContent(""+i):null!=a?o!==a&&c.BackendIDOperations.updateInnerHTMLByID(this._rootNodeID,a):null!=l&&this.updateChildren(l,t)},unmountComponent:function(){this.unmountChildren(),u.deleteAllListeners(this._rootNodeID),c.Mixin.unmountComponent.call(this)}},y(i,c.Mixin),y(i,i.Mixin),y(i,p.Mixin),y(i,l),t.exports=i},{"./CSSPropertyOperations":5,"./DOMProperty":11,"./DOMPropertyOperations":12,"./ReactBrowserComponentMixin":30,"./ReactBrowserEventEmitter":31,"./ReactComponent":35,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./escapeTextForBrowser":118,"./invariant":134,"./keyOf":141,"./merge":144,"./mixInto":147}],44:[function(e,t){var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),i=e("./ReactBrowserComponentMixin"),o=e("./ReactCompositeComponent"),a=e("./ReactDOM"),s=a.form,l=o.createClass({displayName:"ReactDOMForm",mixins:[i,r],render:function(){return this.transferPropsTo(s(null,this.props.children))},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=l},{"./EventConstants":16,"./LocalEventTrapMixin":26,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41}],45:[function(e,t){var n=e("./CSSPropertyOperations"),r=e("./DOMChildrenOperations"),i=e("./DOMPropertyOperations"),o=e("./ReactMount"),a=e("./ReactPerf"),s=e("./invariant"),l=e("./setInnerHTML"),c={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},u={updatePropertyByID:a.measure("ReactDOMIDOperations","updatePropertyByID",function(e,t,n){var r=o.getNode(e);s(!c.hasOwnProperty(t),"updatePropertyByID(...): %s",c[t]),null!=n?i.setValueForProperty(r,t,n):i.deleteValueForProperty(r,t)}),deletePropertyByID:a.measure("ReactDOMIDOperations","deletePropertyByID",function(e,t,n){var r=o.getNode(e);s(!c.hasOwnProperty(t),"updatePropertyByID(...): %s",c[t]),i.deleteValueForProperty(r,t,n)}),updateStylesByID:a.measure("ReactDOMIDOperations","updateStylesByID",function(e,t){var r=o.getNode(e);n.setValueForStyles(r,t)}),updateInnerHTMLByID:a.measure("ReactDOMIDOperations","updateInnerHTMLByID",function(e,t){var n=o.getNode(e);l(n,t)}),updateTextContentByID:a.measure("ReactDOMIDOperations","updateTextContentByID",function(e,t){var n=o.getNode(e);r.updateTextContent(n,t)}),dangerouslyReplaceNodeWithMarkupByID:a.measure("ReactDOMIDOperations","dangerouslyReplaceNodeWithMarkupByID",function(e,t){var n=o.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)}),dangerouslyProcessChildrenUpdates:a.measure("ReactDOMIDOperations","dangerouslyProcessChildrenUpdates",function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=o.getNode(e[n].parentID);r.processUpdates(e,t)})};t.exports=u},{"./CSSPropertyOperations":5,"./DOMChildrenOperations":10,"./DOMPropertyOperations":12,"./ReactMount":67,"./ReactPerf":71,"./invariant":134,"./setInnerHTML":152}],46:[function(e,t){var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),i=e("./ReactBrowserComponentMixin"),o=e("./ReactCompositeComponent"),a=e("./ReactDOM"),s=a.img,l=o.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[i,r],render:function(){return s(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(n.topLevelTypes.topError,"error")}});t.exports=l},{"./EventConstants":16,"./LocalEventTrapMixin":26,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41}],47:[function(e,t){var n=e("./AutoFocusMixin"),r=e("./DOMPropertyOperations"),i=e("./LinkedValueUtils"),o=e("./ReactBrowserComponentMixin"),a=e("./ReactCompositeComponent"),s=e("./ReactDOM"),l=e("./ReactMount"),c=e("./invariant"),u=e("./merge"),d=s.input,p={},f=a.createClass({displayName:"ReactDOMInput",mixins:[n,i.Mixin,o],getInitialState:function(){var e=this.props.defaultValue;return{checked:this.props.defaultChecked||!1,value:null!=e?e:null}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var e=u(this.props);e.defaultChecked=null,e.defaultValue=null;var t=i.getValue(this);e.value=null!=t?t:this.state.value;var n=i.getChecked(this);return e.checked=null!=n?n:this.state.checked,e.onChange=this._handleChange,d(e,this.props.children)},componentDidMount:function(){var e=l.getID(this.getDOMNode());p[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=l.getID(e);delete p[t]},componentDidUpdate:function(){var e=this.getDOMNode();null!=this.props.checked&&r.setValueForProperty(e,"checked",this.props.checked||!1);var t=i.getValue(this);null!=t&&r.setValueForProperty(e,"value",""+t)},_handleChange:function(e){var t,n=i.getOnChange(this);n&&(this._isChanging=!0,t=n.call(this,e),this._isChanging=!1),this.setState({checked:e.target.checked,value:e.target.value});var r=this.props.name;if("radio"===this.props.type&&null!=r){for(var o=this.getDOMNode(),a=o;a.parentNode;)a=a.parentNode;for(var s=a.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),u=0,d=s.length;d>u;u++){var f=s[u];if(f!==o&&f.form===o.form){var h=l.getID(f);c(h,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");var m=p[h];c(m,"ReactDOMInput: Unknown radio button ID %s.",h),m.setState({checked:!1})}}}return t}});t.exports=f},{"./AutoFocusMixin":1,"./DOMPropertyOperations":12,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./ReactMount":67,"./invariant":134,"./merge":144}],48:[function(e,t){var n=e("./ReactBrowserComponentMixin"),r=e("./ReactCompositeComponent"),i=e("./ReactDOM"),o=e("./warning"),a=i.option,s=r.createClass({displayName:"ReactDOMOption",mixins:[n],componentWillMount:function(){o(null==this.props.selected,"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.")},render:function(){return a(this.props,this.props.children)}});t.exports=s},{"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./warning":158}],49:[function(e,t){function n(e,t){if(null!=e[t])if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be an array if `multiple` is true.")}else if(Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be a scalar value if `multiple` is false.")}function r(e,t){var n,r,i,o=e.props.multiple,a=null!=t?t:e.state.value,s=e.getDOMNode().options;if(o)for(n={},r=0,i=a.length;i>r;++r)n[""+a[r]]=!0;else n=""+a;for(r=0,i=s.length;i>r;r++){var l=o?n.hasOwnProperty(s[r].value):s[r].value===n;l!==s[r].selected&&(s[r].selected=l)}}var i=e("./AutoFocusMixin"),o=e("./LinkedValueUtils"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactCompositeComponent"),l=e("./ReactDOM"),c=e("./merge"),u=l.select,d=s.createClass({displayName:"ReactDOMSelect",mixins:[i,o.Mixin,a],propTypes:{defaultValue:n,value:n},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillReceiveProps:function(e){!this.props.multiple&&e.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!e.multiple&&this.setState({value:this.state.value[0]})},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var e=c(this.props);return e.onChange=this._handleChange,e.value=null,u(e,this.props.children)},componentDidMount:function(){r(this,o.getValue(this))},componentDidUpdate:function(e){var t=o.getValue(this),n=!!e.multiple,i=!!this.props.multiple;(null!=t||n!==i)&&r(this,t)},_handleChange:function(e){var t,n=o.getOnChange(this);n&&(this._isChanging=!0,t=n.call(this,e),this._isChanging=!1);var r;if(this.props.multiple){r=[];for(var i=e.target.options,a=0,s=i.length;s>a;a++)i[a].selected&&r.push(i[a].value)}else r=e.target.value;return this.setState({value:r}),t}});t.exports=d},{"./AutoFocusMixin":1,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./merge":144}],50:[function(e,t){function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(e),i.setEndPoint("EndToStart",n);var o=i.text.length,a=o+r;return{start:o,end:a}}function i(e){var t=window.getSelection();if(0===t.rangeCount)return null;var r=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0),l=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=l?0:s.toString().length,u=s.cloneRange();u.selectNodeContents(e),u.setEnd(s.startContainer,s.startOffset);var d=n(u.startContainer,u.startOffset,u.endContainer,u.endOffset),p=d?0:u.toString().length,f=p+c,h=document.createRange();h.setStart(r,i),h.setEnd(o,a);var m=h.collapsed;return h.detach(),{start:m?f:p,end:m?p:f}}function o(e,t){var n,r,i=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function a(e,t){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o="undefined"==typeof t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var d=document.createRange();d.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(d),n.extend(u.node,u.offset)):(d.setEnd(u.node,u.offset),n.addRange(d)),d.detach()}}var s=e("./ExecutionEnvironment"),l=e("./getNodeForCharacterOffset"),c=e("./getTextContentAccessor"),u=s.canUseDOM&&document.selection,d={getOffsets:u?r:i,setOffsets:u?o:a};t.exports=d},{"./ExecutionEnvironment":22,"./getNodeForCharacterOffset":127,"./getTextContentAccessor":129}],51:[function(e,t){var n=e("./AutoFocusMixin"),r=e("./DOMPropertyOperations"),i=e("./LinkedValueUtils"),o=e("./ReactBrowserComponentMixin"),a=e("./ReactCompositeComponent"),s=e("./ReactDOM"),l=e("./invariant"),c=e("./merge"),u=e("./warning"),d=s.textarea,p=a.createClass({displayName:"ReactDOMTextarea",mixins:[n,i.Mixin,o],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(u(!1,"Use the `defaultValue` or `value` props instead of setting children on <textarea>."),l(null==e,"If you supply `defaultValue` on a <textarea>, do not pass children."),Array.isArray(t)&&(l(t.length<=1,"<textarea> can only have at most one child."),t=t[0]),e=""+t),null==e&&(e="");var n=i.getValue(this);return{initialValue:""+(null!=n?n:e)}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var e=c(this.props);return l(null==e.dangerouslySetInnerHTML,"`dangerouslySetInnerHTML` does not make sense on <textarea>."),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,d(e,this.state.initialValue)},componentDidUpdate:function(){var e=i.getValue(this);if(null!=e){var t=this.getDOMNode();r.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,n=i.getOnChange(this);return n&&(this._isChanging=!0,t=n.call(this,e),this._isChanging=!1),this.setState({value:e.target.value}),t}});t.exports=p},{"./AutoFocusMixin":1,"./DOMPropertyOperations":12,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./invariant":134,"./merge":144,"./warning":158}],52:[function(e,t){function n(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),i=e("./Transaction"),o=e("./emptyFunction"),a=e("./mixInto"),s={initialize:o,close:function(){d.isBatchingUpdates=!1}},l={initialize:o,close:r.flushBatchedUpdates.bind(r)},c=[l,s];a(n,i.Mixin),a(n,{getTransactionWrappers:function(){return c}});var u=new n,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n){var r=d.isBatchingUpdates;d.isBatchingUpdates=!0,r?e(t,n):u.perform(e,null,t,n)}};t.exports=d},{"./ReactUpdates":87,"./Transaction":104,"./emptyFunction":116,"./mixInto":147}],53:[function(e,t){function n(){C.EventEmitter.injectReactEventListener(S),C.EventPluginHub.injectEventPluginOrder(s),C.EventPluginHub.injectInstanceHandle(I),C.EventPluginHub.injectMount(k),C.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:D,EnterLeaveEventPlugin:l,ChangeEventPlugin:i,CompositionEventPlugin:a,MobileSafariClickEventPlugin:d,SelectEventPlugin:x,BeforeInputEventPlugin:r}),C.DOM.injectComponentClasses({button:g,form:v,img:y,input:_,option:b,select:E,textarea:w,html:O(m.html),head:O(m.head),body:O(m.body)}),C.CompositeComponent.injectMixin(p),C.DOMProperty.injectDOMPropertyConfig(u),C.DOMProperty.injectDOMPropertyConfig(M),C.EmptyComponent.injectEmptyComponent(m.noscript),C.Updates.injectReconcileTransaction(f.ReactReconcileTransaction),C.Updates.injectBatchingStrategy(h),C.RootIndex.injectCreateReactRootIndex(c.canUseDOM?o.createReactRootIndex:T.createReactRootIndex),C.Component.injectEnvironment(f);var t=c.canUseDOM&&window.location.href||"";if(/[?&]react_perf\b/.test(t)){var n=e("./ReactDefaultPerf");n.start()}}var r=e("./BeforeInputEventPlugin"),i=e("./ChangeEventPlugin"),o=e("./ClientReactRootIndex"),a=e("./CompositionEventPlugin"),s=e("./DefaultEventPluginOrder"),l=e("./EnterLeaveEventPlugin"),c=e("./ExecutionEnvironment"),u=e("./HTMLDOMPropertyConfig"),d=e("./MobileSafariClickEventPlugin"),p=e("./ReactBrowserComponentMixin"),f=e("./ReactComponentBrowserEnvironment"),h=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOM"),g=e("./ReactDOMButton"),v=e("./ReactDOMForm"),y=e("./ReactDOMImg"),_=e("./ReactDOMInput"),b=e("./ReactDOMOption"),E=e("./ReactDOMSelect"),w=e("./ReactDOMTextarea"),S=e("./ReactEventListener"),C=e("./ReactInjection"),I=e("./ReactInstanceHandles"),k=e("./ReactMount"),x=e("./SelectEventPlugin"),T=e("./ServerReactRootIndex"),D=e("./SimpleEventPlugin"),M=e("./SVGDOMPropertyConfig"),O=e("./createFullPageComponent");t.exports={inject:n}},{"./BeforeInputEventPlugin":2,"./ChangeEventPlugin":7,"./ClientReactRootIndex":8,"./CompositionEventPlugin":9,"./DefaultEventPluginOrder":14,"./EnterLeaveEventPlugin":15,"./ExecutionEnvironment":22,"./HTMLDOMPropertyConfig":23,"./MobileSafariClickEventPlugin":27,"./ReactBrowserComponentMixin":30,"./ReactComponentBrowserEnvironment":36,"./ReactDOM":41,"./ReactDOMButton":42,"./ReactDOMForm":44,"./ReactDOMImg":46,"./ReactDOMInput":47,"./ReactDOMOption":48,"./ReactDOMSelect":49,"./ReactDOMTextarea":51,"./ReactDefaultBatchingStrategy":52,"./ReactDefaultPerf":54,"./ReactEventListener":61,"./ReactInjection":62,"./ReactInstanceHandles":64,"./ReactMount":67,"./SVGDOMPropertyConfig":89,"./SelectEventPlugin":90,"./ServerReactRootIndex":91,"./SimpleEventPlugin":92,"./createFullPageComponent":112}],54:[function(e,t){function n(e){return Math.floor(100*e)/100}function r(e,t,n){e[t]=(e[t]||0)+n}var i=e("./DOMProperty"),o=e("./ReactDefaultPerfAnalysis"),a=e("./ReactMount"),s=e("./ReactPerf"),l=e("./performanceNow"),c={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){c._injected||s.injection.injectMeasure(c.measure),c._allMeasurements.length=0,s.enableMeasure=!0},stop:function(){s.enableMeasure=!1},getLastMeasurements:function(){return c._allMeasurements},printExclusive:function(e){e=e||c._allMeasurements;var t=o.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":n(e.inclusive),"Exclusive mount time (ms)":n(e.exclusive),"Exclusive render time (ms)":n(e.render),"Mount time per instance (ms)":n(e.exclusive/e.count),"Render time per instance (ms)":n(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||c._allMeasurements;var t=o.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":n(e.time),Instances:e.count}})),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},printWasted:function(e){e=e||c._allMeasurements;var t=o.getInclusiveSummary(e,!0);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||c._allMeasurements;var t=o.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[i.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,r){var i=c._allMeasurements[c._allMeasurements.length-1].writes;i[e]=i[e]||[],i[e].push({type:t,time:n,args:r})},measure:function(e,t,n){return function(){var i,o,s,u=Array.prototype.slice.call(arguments,0);if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return c._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0}),s=l(),o=n.apply(this,u),c._allMeasurements[c._allMeasurements.length-1].totalTime=l()-s,o;if("ReactDOMIDOperations"===e||"ReactComponentBrowserEnvironment"===e){if(s=l(),o=n.apply(this,u),i=l()-s,"mountImageIntoNode"===t){var d=a.getID(u[1]);c._recordWrite(d,t,i,u[0])}else"dangerouslyProcessChildrenUpdates"===t?u[0].forEach(function(e){var t={};null!==e.fromIndex&&(t.fromIndex=e.fromIndex),null!==e.toIndex&&(t.toIndex=e.toIndex),null!==e.textContent&&(t.textContent=e.textContent),null!==e.markupIndex&&(t.markup=u[1][e.markupIndex]),c._recordWrite(e.parentID,e.type,i,t)}):c._recordWrite(u[0],t,i,Array.prototype.slice.call(u,1));return o}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return n.apply(this,u);var p="mountComponent"===t?u[0]:this._rootNodeID,f="_renderValidatedComponent"===t,h="mountComponent"===t,m=c._mountStack,g=c._allMeasurements[c._allMeasurements.length-1];if(f?r(g.counts,p,1):h&&m.push(0),s=l(),o=n.apply(this,u),i=l()-s,f)r(g.render,p,i);else if(h){var v=m.pop();m[m.length-1]+=i,r(g.exclusive,p,i-v),r(g.inclusive,p,i)}else r(g.inclusive,p,i);return g.displayNames[p]={current:this.constructor.displayName,owner:this._owner?this._owner.constructor.displayName:"<root>"},o}}};t.exports=c},{"./DOMProperty":11,"./ReactDefaultPerfAnalysis":55,"./ReactMount":67,"./ReactPerf":71,"./performanceNow":151}],55:[function(e,t){function n(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];t+=r.totalTime}return t}function r(e){for(var t=[],n=0;n<e.length;n++){var r,i=e[n];for(r in i.writes)i.writes[r].forEach(function(e){t.push({id:r,type:c[e.type]||e.type,args:e.args})})}return t}function i(e){for(var t,n={},r=0;r<e.length;r++){var i=e[r],o=s(i.exclusive,i.inclusive);for(var a in o)t=i.displayNames[a].current,n[t]=n[t]||{componentName:t,inclusive:0,exclusive:0,render:0,count:0},i.render[a]&&(n[t].render+=i.render[a]),i.exclusive[a]&&(n[t].exclusive+=i.exclusive[a]),i.inclusive[a]&&(n[t].inclusive+=i.inclusive[a]),i.counts[a]&&(n[t].count+=i.counts[a])}var c=[];for(t in n)n[t].exclusive>=l&&c.push(n[t]);return c.sort(function(e,t){return t.exclusive-e.exclusive}),c}function o(e,t){for(var n,r={},i=0;i<e.length;i++){var o,c=e[i],u=s(c.exclusive,c.inclusive);t&&(o=a(c));for(var d in u)if(!t||o[d]){var p=c.displayNames[d];n=p.owner+" > "+p.current,r[n]=r[n]||{componentName:n,time:0,count:0},c.inclusive[d]&&(r[n].time+=c.inclusive[d]),c.counts[d]&&(r[n].count+=c.counts[d])}}var f=[];for(n in r)r[n].time>=l&&f.push(r[n]);return f.sort(function(e,t){return t.time-e.time}),f}function a(e){var t={},n=Object.keys(e.writes),r=s(e.exclusive,e.inclusive);for(var i in r){for(var o=!1,a=0;a<n.length;a++)if(0===n[a].indexOf(i)){o=!0;break}!o&&e.counts[i]>0&&(t[i]=!0)}return t}var s=e("./merge"),l=1.2,c={mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",TEXT_CONTENT:"set textContent",updatePropertyByID:"update attribute",deletePropertyByID:"delete attribute",updateStylesByID:"update styles",updateInnerHTMLByID:"set innerHTML",dangerouslyReplaceNodeWithMarkupByID:"replace"},u={getExclusiveSummary:i,getInclusiveSummary:o,getDOMSummary:r,getTotalTime:n};t.exports=u},{"./merge":144}],56:[function(e,t){function n(e,t){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[t]:null},set:function(e){l(!1,"Don't set the "+t+" property of the component. Mutate the existing props object instead."),this._store[t]=e}})}function r(e){try{var t={props:!0};for(var r in t)n(e,r);c=!0}catch(i){}}function i(e,t){if("function"==typeof t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if("function"==typeof r){var i=r.bind(t);for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);e[n]=i}else e[n]=r}}var o=e("./ReactContext"),a=e("./ReactCurrentOwner"),s=e("./merge"),l=e("./warning"),c=!1,u=function(){};r(u.prototype),u.createFactory=function(e){var t=Object.create(u.prototype),n=function(e,n){null==e?e={}:"object"==typeof e&&(e=s(e));var r=arguments.length-1;if(1===r)e.children=n;else if(r>1){for(var i=Array(r),l=0;r>l;l++)i[l]=arguments[l+1];e.children=i}var u=Object.create(t);return u._owner=a.current,u._context=o.current,u._store={validated:!1,props:e},c?(Object.freeze(u),u):(u.props=e,u)};return n.prototype=t,n.type=e,t.type=e,i(n,e),t.constructor=n,n},u.cloneAndReplaceProps=function(e,t){var n=Object.create(e.constructor.prototype);return n._owner=e._owner,n._context=e._context,n._store={validated:e._store.validated,props:t},c?(Object.freeze(n),n):(n.props=t,n)},u.isValidFactory=function(e){return"function"==typeof e&&e.prototype instanceof u},u.isValidDescriptor=function(e){return e instanceof u},t.exports=u},{"./ReactContext":39,"./ReactCurrentOwner":40,"./merge":144,"./warning":158}],57:[function(e,t){function n(){var e=d.current;return e&&e.constructor.displayName||void 0}function r(e,t){e._store.validated||null!=e.props.key||(e._store.validated=!0,o("react_key_warning",'Each child in an array should have a unique "key" prop.',e,t))}function i(e,t,n){g.test(e)&&o("react_numeric_key_warning","Child objects should have non-numeric keys so ordering is preserved.",t,n)}function o(e,t,r,i){var o=n(),a=i.displayName,s=o||a,l=f[e];if(!l.hasOwnProperty(s)){l[s]=!0,t+=o?" Check the render method of "+o+".":" Check the renderComponent call using <"+a+">.";var c=null;r._owner&&r._owner!==d.current&&(c=r._owner.constructor.displayName,t+=" It was passed a child from "+c+"."),t+=" See http://fb.me/react-warning-keys for more information.",p(e,{component:s,componentOwner:c}),console.warn(t)}}function a(){var e=n()||"";h.hasOwnProperty(e)||(h[e]=!0,p("react_object_map_children"))}function s(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var o=e[n];c.isValidDescriptor(o)&&r(o,t)}else if(c.isValidDescriptor(e))e._store.validated=!0;else if(e&&"object"==typeof e){a();for(var s in e)i(s,e[s],t)}}function l(e,t,n,r){for(var i in t)if(t.hasOwnProperty(i)){var o;try{o=t[i](n,i,e,r)}catch(a){o=a}o instanceof Error&&!(o.message in m)&&(m[o.message]=!0,p("react_failed_descriptor_type_check",{message:o.message}))}}var c=e("./ReactDescriptor"),u=e("./ReactPropTypeLocations"),d=e("./ReactCurrentOwner"),p=e("./monitorCodeUse"),f={react_key_warning:{},react_numeric_key_warning:{}},h={},m={},g=/^\d+$/,v={createFactory:function(e,t,n){var r=function(){for(var r=e.apply(this,arguments),i=1;i<arguments.length;i++)s(arguments[i],r.type);var o=r.type.displayName;return t&&l(o,t,r.props,u.prop),n&&l(o,n,r._context,u.context),r};r.prototype=e.prototype,r.type=e.type;for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}};t.exports=v},{"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactPropTypeLocations":74,"./monitorCodeUse":148}],58:[function(e,t){function n(){return s(a,"Trying to return null from a render, but no null placeholder component was injected."),a()}function r(e){l[e]=!0}function i(e){delete l[e]}function o(e){return l[e]}var a,s=e("./invariant"),l={},c={injectEmptyComponent:function(e){a=e}},u={deregisterNullComponentID:i,getEmptyComponent:n,injection:c,isNullComponentID:o,registerNullComponentID:r};t.exports=u},{"./invariant":134}],59:[function(e,t){var n={guard:function(e){return e
22}};t.exports=n},{}],60:[function(e,t){function n(e){r.enqueueEvents(e),r.processEventQueue()}var r=e("./EventPluginHub"),i={handleTopLevel:function(e,t,i,o){var a=r.extractEvents(e,t,i,o);n(a)}};t.exports=i},{"./EventPluginHub":18}],61:[function(e,t){function n(e){var t=u.getID(e),n=c.getReactRootIDFromNodeID(t),r=u.findReactContainerForID(n),i=u.getFirstReactDOM(r);return i}function r(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){for(var t=u.getFirstReactDOM(p(e.nativeEvent))||window,r=t;r;)e.ancestors.push(r),r=n(r);for(var i=0,o=e.ancestors.length;o>i;i++){t=e.ancestors[i];var a=u.getID(t)||"";m._handleTopLevel(e.topLevelType,t,a,e.nativeEvent)}}function o(e){var t=f(window);e(t)}var a=e("./EventListener"),s=e("./ExecutionEnvironment"),l=e("./PooledClass"),c=e("./ReactInstanceHandles"),u=e("./ReactMount"),d=e("./ReactUpdates"),p=e("./getEventTarget"),f=e("./getUnboundedScrollPosition"),h=e("./mixInto");h(r,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),l.addPoolingTo(r,l.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:s.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;if(r)return a.listen(r,t,m.dispatchEvent.bind(null,e))},trapCapturedEvent:function(e,t,n){var r=n;if(r)return a.capture(r,t,m.dispatchEvent.bind(null,e))},monitorScrollValue:function(e){var t=o.bind(null,e);a.listen(window,"scroll",t),a.listen(window,"resize",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{d.batchedUpdates(i,n)}finally{r.release(n)}}}};t.exports=m},{"./EventListener":17,"./ExecutionEnvironment":22,"./PooledClass":28,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactUpdates":87,"./getEventTarget":125,"./getUnboundedScrollPosition":130,"./mixInto":147}],62:[function(e,t){var n=e("./DOMProperty"),r=e("./EventPluginHub"),i=e("./ReactComponent"),o=e("./ReactCompositeComponent"),a=e("./ReactDOM"),s=e("./ReactEmptyComponent"),l=e("./ReactBrowserEventEmitter"),c=e("./ReactPerf"),u=e("./ReactRootIndex"),d=e("./ReactUpdates"),p={Component:i.injection,CompositeComponent:o.injection,DOMProperty:n.injection,EmptyComponent:s.injection,EventPluginHub:r.injection,DOM:a.injection,EventEmitter:l.injection,Perf:c.injection,RootIndex:u.injection,Updates:d.injection};t.exports=p},{"./DOMProperty":11,"./EventPluginHub":18,"./ReactBrowserEventEmitter":31,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactDOM":41,"./ReactEmptyComponent":58,"./ReactPerf":71,"./ReactRootIndex":78,"./ReactUpdates":87}],63:[function(e,t){function n(e){return i(document.documentElement,e)}var r=e("./ReactDOMSelection"),i=e("./containsNode"),o=e("./focusNode"),a=e("./getActiveElement"),s={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t=a(),r=e.focusedElem,i=e.selectionRange;t!==r&&n(r)&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,i),o(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,i=t.end;if("undefined"==typeof i&&(i=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(i,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",i-n),o.select()}else r.setOffsets(e,t)}};t.exports=s},{"./ReactDOMSelection":50,"./containsNode":109,"./focusNode":120,"./getActiveElement":122}],64:[function(e,t){function n(e){return p+e.toString(36)}function r(e,t){return e.charAt(t)===p||t===e.length}function i(e){return""===e||e.charAt(0)===p&&e.charAt(e.length-1)!==p}function o(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function a(e){return e?e.substr(0,e.lastIndexOf(p)):""}function s(e,t){if(d(i(e)&&i(t),"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,t),d(o(e,t),"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,t),e===t)return e;for(var n=e.length+f,a=n;a<t.length&&!r(t,a);a++);return t.substr(0,a)}function l(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var o=0,a=0;n>=a;a++)if(r(e,a)&&r(t,a))o=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,o);return d(i(s),"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,t,s),s}function c(e,t,n,r,i,l){e=e||"",t=t||"",d(e!==t,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e);var c=o(t,e);d(c||o(e,t),"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,t);for(var u=0,p=c?a:s,f=e;;f=p(f,t)){var m;if(i&&f===e||l&&f===t||(m=n(f,c,r)),m===!1||f===t)break;d(u++<h,"traverseParentPath(%s, %s, ...): Detected an infinite loop while traversing the React DOM ID tree. This may be due to malformed IDs: %s",e,t)}}var u=e("./ReactRootIndex"),d=e("./invariant"),p=".",f=p.length,h=100,m={createReactRootID:function(){return n(u.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===p&&e.length>1){var t=e.indexOf(p,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,i){var o=l(e,t);o!==e&&c(e,o,n,r,!1,!0),o!==t&&c(o,t,n,i,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:l,_getNextDescendantID:s,isAncestorIDOf:o,SEPARATOR:p};t.exports=m},{"./ReactRootIndex":78,"./invariant":134}],65:[function(e,t){function n(e,t){this.value=e,this.requestChange=t}function r(e){var t={value:"undefined"==typeof e?i.PropTypes.any.isRequired:e.isRequired,requestChange:i.PropTypes.func.isRequired};return i.PropTypes.shape(t)}var i=e("./React");n.PropTypes={link:r},t.exports=n},{"./React":29}],66:[function(e,t){var n=e("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var i=t.getAttribute(r.CHECKSUM_ATTR_NAME);i=i&&parseInt(i,10);var o=n(e);return o===i}};t.exports=r},{"./adler32":107}],67:[function(e,t){function n(e){var t=y(e);return t&&R.getID(t)}function r(e){var t=i(e);if(t)if(I.hasOwnProperty(t)){var n=I[t];n!==e&&(b(!s(n,t),"ReactMount: Two valid but unequal nodes with the same `%s`: %s",C,t),I[t]=e)}else I[t]=e;return t}function i(e){return e&&e.getAttribute&&e.getAttribute(C)||""}function o(e,t){var n=i(e);n!==t&&delete I[n],e.setAttribute(C,t),I[t]=e}function a(e){return I.hasOwnProperty(e)&&s(I[e],e)||(I[e]=R.findReactNodeByID(e)),I[e]}function s(e,t){if(e){b(i(e)===t,"ReactMount: Unexpected modification of `%s`",C);var n=R.findReactContainerForID(t);if(n&&v(n,e))return!0}return!1}function l(e){delete I[e]}function c(e){var t=I[e];return t&&s(t,e)?void(L=t):!1}function u(e){L=null,m.traverseAncestors(e,c);var t=L;return L=null,t}var d=e("./DOMProperty"),p=e("./ReactBrowserEventEmitter"),f=e("./ReactCurrentOwner"),h=e("./ReactDescriptor"),m=e("./ReactInstanceHandles"),g=e("./ReactPerf"),v=e("./containsNode"),y=e("./getReactRootElementInContainer"),_=e("./instantiateReactComponent"),b=e("./invariant"),E=e("./shouldUpdateReactComponent"),w=e("./warning"),S=m.SEPARATOR,C=d.ID_ATTRIBUTE_NAME,I={},k=1,x=9,T={},D={},M={},O=[],L=null,R={_instancesByReactRootID:T,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,r,i){var o=t.props;return R.scrollMonitor(r,function(){e.replaceProps(o,i)}),M[n(r)]=y(r),e},_registerComponent:function(e,t){b(t&&(t.nodeType===k||t.nodeType===x),"_registerComponent(...): Target container is not a DOM element."),p.ensureScrollValueMonitoring();var n=R.registerContainer(t);return T[n]=e,n},_renderNewRootComponent:g.measure("ReactMount","_renderNewRootComponent",function(e,t,n){w(null==f.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.");var r=_(e),i=R._registerComponent(r,t);return r.mountComponentIntoNode(i,t,n),M[i]=y(t),r}),renderComponent:function(e,t,r){b(h.isValidDescriptor(e),"renderComponent(): Invalid component descriptor.%s",h.isValidFactory(e)?" Instead of passing a component class, make sure to instantiate it first by calling it with props.":"undefined"!=typeof e.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i=T[n(t)];if(i){var o=i._descriptor;if(E(o,e))return R._updateRootComponent(i,e,t,r);R.unmountComponentAtNode(t)}var a=y(t),s=a&&R.isRenderedByReact(a),l=s&&!i,c=R._renderNewRootComponent(e,t,l);return r&&r.call(c),c},constructAndRenderComponent:function(e,t,n){return R.renderComponent(e(t),n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return b(r,'Tried to get element with id of "%s" but it is not present on the page.',n),R.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=n(e);return t&&(t=m.getReactRootIDFromNodeID(t)),t||(t=m.createReactRootID()),D[t]=e,t},unmountComponentAtNode:function(e){w(null==f.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.");var t=n(e),r=T[t];return r?(R.unmountComponentFromNode(r,e),delete T[t],delete D[t],delete M[t],!0):!1},unmountComponentFromNode:function(e,t){for(e.unmountComponent(),t.nodeType===x&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=m.getReactRootIDFromNodeID(e),n=D[t],r=M[t];if(r&&r.parentNode!==n){b(i(r)===t,"ReactMount: Root element ID differed from reactRootID.");var o=n.firstChild;o&&t===i(o)?M[t]=o:console.warn("ReactMount: Root element has been removed from its original container. New container:",r.parentNode)}return n},findReactNodeByID:function(e){var t=R.findReactContainerForID(e);return R.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=R.getID(e);return t?t.charAt(0)===S:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(R.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=O,r=0,i=u(t)||e;for(n[0]=i.firstChild,n.length=1;r<n.length;){for(var o,a=n[r++];a;){var s=R.getID(a);s?t===s?o=a:m.isAncestorIDOf(s,t)&&(n.length=r=0,n.push(a.firstChild)):n.push(a.firstChild),a=a.nextSibling}if(o)return n.length=0,o}n.length=0,b(!1,"findComponentRoot(..., %s): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting <p> or <a> tags, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",t,R.getID(e))},getReactRootID:n,getID:r,setID:o,getNode:a,purgeID:l};t.exports=R},{"./DOMProperty":11,"./ReactBrowserEventEmitter":31,"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactPerf":71,"./containsNode":109,"./getReactRootElementInContainer":128,"./instantiateReactComponent":133,"./invariant":134,"./shouldUpdateReactComponent":154,"./warning":158}],68:[function(e,t){function n(e,t,n){h.push({parentID:e,parentNode:null,type:c.INSERT_MARKUP,markupIndex:m.push(t)-1,textContent:null,fromIndex:null,toIndex:n})}function r(e,t,n){h.push({parentID:e,parentNode:null,type:c.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:t,toIndex:n})}function i(e,t){h.push({parentID:e,parentNode:null,type:c.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:t,toIndex:null})}function o(e,t){h.push({parentID:e,parentNode:null,type:c.TEXT_CONTENT,markupIndex:null,textContent:t,fromIndex:null,toIndex:null})}function a(){h.length&&(l.BackendIDOperations.dangerouslyProcessChildrenUpdates(h,m),s())}function s(){h.length=0,m.length=0}var l=e("./ReactComponent"),c=e("./ReactMultiChildUpdateTypes"),u=e("./flattenChildren"),d=e("./instantiateReactComponent"),p=e("./shouldUpdateReactComponent"),f=0,h=[],m=[],g={Mixin:{mountChildren:function(e,t){var n=u(e),r=[],i=0;this._renderedChildren=n;for(var o in n){var a=n[o];if(n.hasOwnProperty(o)){var s=d(a);n[o]=s;var l=this._rootNodeID+o,c=s.mountComponent(l,t,this._mountDepth+1);s._mountIndex=i,r.push(c),i++}}return r},updateTextContent:function(e){f++;var t=!0;try{var n=this._renderedChildren;for(var r in n)n.hasOwnProperty(r)&&this._unmountChildByName(n[r],r);this.setTextContent(e),t=!1}finally{f--,f||(t?s():a())}},updateChildren:function(e,t){f++;var n=!0;try{this._updateChildren(e,t),n=!1}finally{f--,f||(n?s():a())}},_updateChildren:function(e,t){var n=u(e),r=this._renderedChildren;if(n||r){var i,o=0,a=0;for(i in n)if(n.hasOwnProperty(i)){var s=r&&r[i],l=s&&s._descriptor,c=n[i];if(p(l,c))this.moveChild(s,a,o),o=Math.max(s._mountIndex,o),s.receiveComponent(c,t),s._mountIndex=a;else{s&&(o=Math.max(s._mountIndex,o),this._unmountChildByName(s,i));var f=d(c);this._mountChildByNameAtIndex(f,i,a,t)}a++}for(i in r)!r.hasOwnProperty(i)||n&&n[i]||this._unmountChildByName(r[i],i)}},unmountChildren:function(){var e=this._renderedChildren;for(var t in e){var n=e[t];n.unmountComponent&&n.unmountComponent()}this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&r(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){n(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){i(this._rootNodeID,e._mountIndex)},setTextContent:function(e){o(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,r){var i=this._rootNodeID+t,o=e.mountComponent(i,r,this._mountDepth+1);e._mountIndex=n,this.createChild(e,o),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[t]=e},_unmountChildByName:function(e,t){this.removeChild(e),e._mountIndex=null,e.unmountComponent(),delete this._renderedChildren[t]}}};t.exports=g},{"./ReactComponent":35,"./ReactMultiChildUpdateTypes":69,"./flattenChildren":119,"./instantiateReactComponent":133,"./shouldUpdateReactComponent":154}],69:[function(e,t){var n=e("./keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});t.exports=r},{"./keyMirror":140}],70:[function(e,t){var n=e("./emptyObject"),r=e("./invariant"),i={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){r(i.isValidOwner(n),"addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref."),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(i.isValidOwner(n),"removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This usually means that you're trying to remove a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref."),n.refs[t]===e&&n.detachRef(t)},Mixin:{construct:function(){this.refs=n},attachRef:function(e,t){r(t.isOwnedBy(this),"attachRef(%s, ...): Only a component's owner can store a ref to it.",e);var i=this.refs===n?this.refs={}:this.refs;i[e]=t},detachRef:function(e){delete this.refs[e]}}};t.exports=i},{"./emptyObject":117,"./invariant":134}],71:[function(e,t){function n(e,t,n){return n}var r={enableMeasure:!1,storedMeasure:n,measure:function(e,t,n){var i=null;return function(){return r.enableMeasure?(i||(i=r.storedMeasure(e,t,n)),i.apply(this,arguments)):n.apply(this,arguments)}},injection:{injectMeasure:function(e){r.storedMeasure=e}}};t.exports=r},{}],72:[function(e,t){function n(e){return function(t,n,r){t[n]=t.hasOwnProperty(n)?e(t[n],r):r}}function r(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=c[n];r&&c.hasOwnProperty(n)?r(e,n,t[n]):e.hasOwnProperty(n)||(e[n]=t[n])}return e}var i=e("./emptyFunction"),o=e("./invariant"),a=e("./joinClasses"),s=e("./merge"),l=n(function(e,t){return s(t,e)}),c={children:i,className:n(a),key:i,ref:i,style:l},u={TransferStrategies:c,mergeProps:function(e,t){return r(s(e),t)},Mixin:{transferPropsTo:function(e){return o(e._owner===this,"%s: You can't call transferPropsTo() on a component that you don't own, %s. This usually means you are calling transferPropsTo() on a component passed in as props or children.",this.constructor.displayName,e.type.displayName),r(e.props,this.props),e}}};t.exports=u},{"./emptyFunction":116,"./invariant":134,"./joinClasses":139,"./merge":144}],73:[function(e,t){var n={};n={prop:"prop",context:"context",childContext:"child context"},t.exports=n},{}],74:[function(e,t){var n=e("./keyMirror"),r=n({prop:null,context:null,childContext:null});t.exports=r},{"./keyMirror":140}],75:[function(e,t){function n(e){function t(t,n,r,i,o){if(i=i||_,null!=n[r])return e(n,r,i,o);var a=v[o];return t?new Error("Required "+a+" `"+r+"` was not specified in "+("`"+i+"`.")):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function r(e){function t(t,n,r,i){var o=t[n],a=h(o);if(a!==e){var s=v[i],l=m(o);return new Error("Invalid "+s+" `"+n+"` of type `"+l+"` "+("supplied to `"+r+"`, expected `"+e+"`."))}}return n(t)}function i(){return n(y.thatReturns())}function o(e){function t(t,n,r,i){var o=t[n];if(!Array.isArray(o)){var a=v[i],s=h(o);return new Error("Invalid "+a+" `"+n+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<o.length;l++){var c=e(o,l,r,i);if(c instanceof Error)return c}}return n(t)}function a(){function e(e,t,n,r){if(!g.isValidDescriptor(e[t])){var i=v[r];return new Error("Invalid "+i+" `"+t+"` supplied to "+("`"+n+"`, expected a React component."))}}return n(e)}function s(e){function t(t,n,r,i){if(!(t[n]instanceof e)){var o=v[i],a=e.name||_;return new Error("Invalid "+o+" `"+n+"` supplied to "+("`"+r+"`, expected instance of `"+a+"`."))}}return n(t)}function l(e){function t(t,n,r,i){for(var o=t[n],a=0;a<e.length;a++)if(o===e[a])return;var s=v[i],l=JSON.stringify(e);return new Error("Invalid "+s+" `"+n+"` of value `"+o+"` "+("supplied to `"+r+"`, expected one of "+l+"."))}return n(t)}function c(e){function t(t,n,r,i){var o=t[n],a=h(o);if("object"!==a){var s=v[i];return new Error("Invalid "+s+" `"+n+"` of type "+("`"+a+"` supplied to `"+r+"`, expected an object."))}for(var l in o)if(o.hasOwnProperty(l)){var c=e(o,l,r,i);if(c instanceof Error)return c}}return n(t)}function u(e){function t(t,n,r,i){for(var o=0;o<e.length;o++){var a=e[o];if(null==a(t,n,r,i))return}var s=v[i];return new Error("Invalid "+s+" `"+n+"` supplied to "+("`"+r+"`."))}return n(t)}function d(){function e(e,t,n,r){if(!f(e[t])){var i=v[r];return new Error("Invalid "+i+" `"+t+"` supplied to "+("`"+n+"`, expected a renderable prop."))}}return n(e)}function p(e){function t(t,n,r,i){var o=t[n],a=h(o);if("object"!==a){var s=v[i];return new Error("Invalid "+s+" `"+n+"` of type `"+a+"` "+("supplied to `"+r+"`, expected `object`."))}for(var l in e){var c=e[l];if(c){var u=c(o,l,r,i);if(u)return u}}}return n(t,"expected `object`")}function f(e){switch(typeof e){case"number":case"string":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(f);if(g.isValidDescriptor(e))return!0;for(var t in e)if(!f(e[t]))return!1;return!0;default:return!1}}function h(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function m(e){var t=h(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}var g=e("./ReactDescriptor"),v=e("./ReactPropTypeLocationNames"),y=e("./emptyFunction"),_="<<anonymous>>",b={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:i(),arrayOf:o,component:a(),instanceOf:s,objectOf:c,oneOf:l,oneOfType:u,renderable:d(),shape:p};t.exports=b},{"./ReactDescriptor":56,"./ReactPropTypeLocationNames":73,"./emptyFunction":116}],76:[function(e,t){function n(){this.listenersToPut=[]}var r=e("./PooledClass"),i=e("./ReactBrowserEventEmitter"),o=e("./mixInto");o(n,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e<this.listenersToPut.length;e++){var t=this.listenersToPut[e];i.putListener(t.rootNodeID,t.propKey,t.propValue)}},reset:function(){this.listenersToPut.length=0},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./PooledClass":28,"./ReactBrowserEventEmitter":31,"./mixInto":147}],77:[function(e,t){function n(){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=r.getPooled(null),this.putListenerQueue=s.getPooled()}var r=e("./CallbackQueue"),i=e("./PooledClass"),o=e("./ReactBrowserEventEmitter"),a=e("./ReactInputSelection"),s=e("./ReactPutListenerQueue"),l=e("./Transaction"),c=e("./mixInto"),u={initialize:a.getSelectionInformation,close:a.restoreSelection},d={initialize:function(){var e=o.isEnabled();return o.setEnabled(!1),e},close:function(e){o.setEnabled(e)}},p={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},f={initialize:function(){this.putListenerQueue.reset()},close:function(){this.putListenerQueue.putListeners()}},h=[f,u,d,p],m={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){r.release(this.reactMountReady),this.reactMountReady=null,s.release(this.putListenerQueue),this.putListenerQueue=null}};c(n,l.Mixin),c(n,m),i.addPoolingTo(n),t.exports=n},{"./CallbackQueue":6,"./PooledClass":28,"./ReactBrowserEventEmitter":31,"./ReactInputSelection":63,"./ReactPutListenerQueue":76,"./Transaction":104,"./mixInto":147}],78:[function(e,t){var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};t.exports=r},{}],79:[function(e,t){function n(e){c(i.isValidDescriptor(e),"renderComponentToString(): You must pass a valid ReactComponent."),c(!(2===arguments.length&&"function"==typeof arguments[1]),"renderComponentToString(): This function became synchronous and now returns the generated markup. Please remove the second parameter.");var t;try{var n=o.createReactRootID();return t=s.getPooled(!1),t.perform(function(){var r=l(e),i=r.mountComponent(n,t,0);return a.addChecksumToMarkup(i)},null)}finally{s.release(t)}}function r(e){c(i.isValidDescriptor(e),"renderComponentToStaticMarkup(): You must pass a valid ReactComponent.");var t;try{var n=o.createReactRootID();return t=s.getPooled(!0),t.perform(function(){var r=l(e);return r.mountComponent(n,t,0)},null)}finally{s.release(t)}}var i=e("./ReactDescriptor"),o=e("./ReactInstanceHandles"),a=e("./ReactMarkupChecksum"),s=e("./ReactServerRenderingTransaction"),l=e("./instantiateReactComponent"),c=e("./invariant");t.exports={renderComponentToString:n,renderComponentToStaticMarkup:r}},{"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMarkupChecksum":66,"./ReactServerRenderingTransaction":80,"./instantiateReactComponent":133,"./invariant":134}],80:[function(e,t){function n(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=i.getPooled(null),this.putListenerQueue=o.getPooled()}var r=e("./PooledClass"),i=e("./CallbackQueue"),o=e("./ReactPutListenerQueue"),a=e("./Transaction"),s=e("./emptyFunction"),l=e("./mixInto"),c={initialize:function(){this.reactMountReady.reset()},close:s},u={initialize:function(){this.putListenerQueue.reset()},close:s},d=[u,c],p={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null,o.release(this.putListenerQueue),this.putListenerQueue=null}};l(n,a.Mixin),l(n,p),r.addPoolingTo(n),t.exports=n},{"./CallbackQueue":6,"./PooledClass":28,"./ReactPutListenerQueue":76,"./Transaction":104,"./emptyFunction":116,"./mixInto":147}],81:[function(e,t){function n(e,t){var n={};return function(r){n[t]=r,e.setState(n)}}var r={createStateSetter:function(e,t){return function(n,r,i,o,a,s){var l=t.call(e,n,r,i,o,a,s);l&&e.setState(l)}},createStateKeySetter:function(e,t){var r=e.__keySetters||(e.__keySetters={});return r[t]||(r[t]=n(e,t))}};r.Mixin={createStateSetter:function(e){return r.createStateSetter(this,e)},createStateKeySetter:function(e){return r.createStateKeySetter(this,e)}},t.exports=r},{}],82:[function(e,t){function n(){}function r(e){return function(t,r){var i;b.isDOMComponent(t)?i=t.getDOMNode():t.tagName&&(i=t);var o=new n;o.target=i;var a=new g(p.eventNameDispatchConfigs[e],f.getID(i),o);v(a,r),l.accumulateTwoPhaseDispatches(a),m.batchedUpdates(function(){s.enqueueEvents(a),s.processEventQueue()})}}function i(){b.Simulate={};var e;for(e in p.eventNameDispatchConfigs)b.Simulate[e]=r(e)}function o(e){return function(t,r){var i=new n(e);v(i,r),b.isDOMComponent(t)?b.simulateNativeEventOnDOMComponent(e,t,i):t.tagName&&b.simulateNativeEventOnNode(e,t,i)}}var a=e("./EventConstants"),s=e("./EventPluginHub"),l=e("./EventPropagators"),c=e("./React"),u=e("./ReactDescriptor"),d=e("./ReactDOM"),p=e("./ReactBrowserEventEmitter"),f=e("./ReactMount"),h=e("./ReactTextComponent"),m=e("./ReactUpdates"),g=e("./SyntheticEvent"),v=e("./mergeInto"),y=e("./copyProperties"),_=a.topLevelTypes,b={renderIntoDocument:function(e){var t=document.createElement("div");return c.renderComponent(e,t)},isDescriptor:function(e){return u.isValidDescriptor(e)},isDescriptorOfType:function(e,t){return u.isValidDescriptor(e)&&e.type===t.type},isDOMComponent:function(e){return!!(e&&e.mountComponent&&e.tagName)},isDOMComponentDescriptor:function(e){return!!(e&&u.isValidDescriptor(e)&&e.tagName)},isCompositeComponent:function(e){return"function"==typeof e.render&&"function"==typeof e.setState},isCompositeComponentWithType:function(e,t){return!(!b.isCompositeComponent(e)||e.constructor!==t.type)},isCompositeComponentDescriptor:function(e){if(!u.isValidDescriptor(e))return!1;var t=e.type.prototype;return"function"==typeof t.render&&"function"==typeof t.setState},isCompositeComponentDescriptorWithType:function(e,t){return!(!b.isCompositeComponentDescriptor(e)||e.constructor!==t)},isTextComponent:function(e){return e instanceof h.type},findAllInRenderedTree:function(e,t){if(!e)return[];var n=t(e)?[e]:[];if(b.isDOMComponent(e)){var r,i=e._renderedChildren;for(r in i)i.hasOwnProperty(r)&&(n=n.concat(b.findAllInRenderedTree(i[r],t)))}else b.isCompositeComponent(e)&&(n=n.concat(b.findAllInRenderedTree(e._renderedComponent,t)));return n},scryRenderedDOMComponentsWithClass:function(e,t){return b.findAllInRenderedTree(e,function(e){var n=e.props.className;return b.isDOMComponent(e)&&n&&-1!==(" "+n+" ").indexOf(" "+t+" ")})},findRenderedDOMComponentWithClass:function(e,t){var n=b.scryRenderedDOMComponentsWithClass(e,t);if(1!==n.length)throw new Error("Did not find exactly one match for class:"+t);return n[0]},scryRenderedDOMComponentsWithTag:function(e,t){return b.findAllInRenderedTree(e,function(e){return b.isDOMComponent(e)&&e.tagName===t.toUpperCase()})},findRenderedDOMComponentWithTag:function(e,t){var n=b.scryRenderedDOMComponentsWithTag(e,t);if(1!==n.length)throw new Error("Did not find exactly one match for tag:"+t);return n[0]},scryRenderedComponentsWithType:function(e,t){return b.findAllInRenderedTree(e,function(e){return b.isCompositeComponentWithType(e,t)})},findRenderedComponentWithType:function(e,t){var n=b.scryRenderedComponentsWithType(e,t);if(1!==n.length)throw new Error("Did not find exactly one match for componentType:"+t);return n[0]},mockComponent:function(e){var t=c.createClass({render:function(){var t=t||e.mockTagName||"div";return d[t](null,this.props.children)}});return y(e,t),e.mockImplementation(t),this},simulateNativeEventOnNode:function(e,t,n){n.target=t,p.ReactEventListener.dispatchEvent(e,n)},simulateNativeEventOnDOMComponent:function(e,t,n){b.simulateNativeEventOnNode(e,t.getDOMNode(),n)},nativeTouchData:function(e,t){return{touches:[{pageX:e,pageY:t}]}},Simulate:null,SimulateNative:{}},E=s.injection.injectEventPluginOrder;s.injection.injectEventPluginOrder=function(){E.apply(this,arguments),i()};var w=s.injection.injectEventPluginsByName;s.injection.injectEventPluginsByName=function(){w.apply(this,arguments),i()},i();var S;for(S in _){var C=0===S.indexOf("top")?S.charAt(3).toLowerCase()+S.substr(4):S;b.SimulateNative[C]=o(S)}t.exports=b},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./React":29,"./ReactBrowserEventEmitter":31,"./ReactDOM":41,"./ReactDescriptor":56,"./ReactMount":67,"./ReactTextComponent":83,"./ReactUpdates":87,"./SyntheticEvent":96,"./copyProperties":110,"./mergeInto":146}],83:[function(e,t){var n=e("./DOMPropertyOperations"),r=e("./ReactBrowserComponentMixin"),i=e("./ReactComponent"),o=e("./ReactDescriptor"),a=e("./escapeTextForBrowser"),s=e("./mixInto"),l=function(e){this.construct(e)};s(l,i.Mixin),s(l,r),s(l,{mountComponent:function(e,t,r){i.Mixin.mountComponent.call(this,e,t,r);var o=a(this.props);return t.renderToStaticMarkup?o:"<span "+n.createMarkupForID(e)+">"+o+"</span>"},receiveComponent:function(e){var t=e.props;t!==this.props&&(this.props=t,i.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}}),t.exports=o.createFactory(l)},{"./DOMPropertyOperations":12,"./ReactBrowserComponentMixin":30,"./ReactComponent":35,"./ReactDescriptor":56,"./escapeTextForBrowser":118,"./mixInto":147}],84:[function(e,t){var n=e("./ReactChildren"),r={getChildMapping:function(e){return n.map(e,function(e){return e})},mergeChildMappings:function(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},i=[];for(var o in e)t.hasOwnProperty(o)?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in t){if(r.hasOwnProperty(l))for(a=0;a<r[l].length;a++){var c=r[l][a];s[r[l][a]]=n(c)}s[l]=n(l)}for(a=0;a<i.length;a++)s[i[a]]=n(i[a]);return s}};t.exports=r},{"./ReactChildren":34}],85:[function(e,t){function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var n in a){var r=a[n];for(var i in r)if(i in t){s.push(r[i]);break}}}function r(e,t,n){e.addEventListener(t,n,!1)}function i(e,t,n){e.removeEventListener(t,n,!1)}var o=e("./ExecutionEnvironment"),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},s=[];o.canUseDOM&&n();var l={addEndEventListener:function(e,t){return 0===s.length?void window.setTimeout(t,0):void s.forEach(function(n){r(e,n,t)})},removeEndEventListener:function(e,t){0!==s.length&&s.forEach(function(n){i(e,n,t)})}};t.exports=l},{"./ExecutionEnvironment":22}],86:[function(e,t){var n=e("./React"),r=e("./ReactTransitionChildMapping"),i=e("./cloneWithProps"),o=e("./emptyFunction"),a=e("./merge"),s=n.createClass({displayName:"ReactTransitionGroup",propTypes:{component:n.PropTypes.func,childFactory:n.PropTypes.func},getDefaultProps:function(){return{component:n.DOM.span,childFactory:o.thatReturnsArgument}
23},getInitialState:function(){return{children:r.getChildMapping(this.props.children)}},componentWillReceiveProps:function(e){var t=r.getChildMapping(e.children),n=this.state.children;this.setState({children:r.mergeChildMappings(n,t)});var i;for(i in t){var o=n&&n.hasOwnProperty(i);!t[i]||o||this.currentlyTransitioningKeys[i]||this.keysToEnter.push(i)}for(i in n){var a=t&&t.hasOwnProperty(i);!n[i]||a||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}},componentWillMount:function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},componentDidUpdate:function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)},performEnter:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)},_handleDoneEntering:function(e){var t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e];var n=r.getChildMapping(this.props.children);n&&n.hasOwnProperty(e)||this.performLeave(e)},performLeave:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)},_handleDoneLeaving:function(e){var t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];var n=r.getChildMapping(this.props.children);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{var i=a(this.state.children);delete i[e],this.setState({children:i})}},render:function(){var e={};for(var t in this.state.children){var n=this.state.children[t];n&&(e[t]=i(this.props.childFactory(n),{ref:t}))}return this.transferPropsTo(this.props.component(null,e))}});t.exports=s},{"./React":29,"./ReactTransitionChildMapping":84,"./cloneWithProps":108,"./emptyFunction":116,"./merge":144}],87:[function(e,t){function n(){f(S.ReactReconcileTransaction&&v,"ReactUpdates: must inject a reconcile transaction class and batching strategy")}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=l.getPooled(null),this.reconcileTransaction=S.ReactReconcileTransaction.getPooled()}function i(e,t,r){n(),v.batchedUpdates(e,t,r)}function o(e,t){return e._mountDepth-t._mountDepth}function a(e){var t=e.dirtyComponentsLength;f(t===g.length,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",t,g.length),g.sort(o);for(var n=0;t>n;n++){var r=g[n];if(r.isMounted()){var i=r._pendingCallbacks;if(r._pendingCallbacks=null,r.performUpdateIfNecessary(e.reconcileTransaction),i)for(var a=0;a<i.length;a++)e.callbackQueue.enqueue(i[a],r)}}}function s(e,t){return f(!t||"function"==typeof t,"enqueueUpdate(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."),n(),m(null==u.current,"enqueueUpdate(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."),v.isBatchingUpdates?(g.push(e),void(t&&(e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t]))):void v.batchedUpdates(s,e,t)}var l=e("./CallbackQueue"),c=e("./PooledClass"),u=e("./ReactCurrentOwner"),d=e("./ReactPerf"),p=e("./Transaction"),f=e("./invariant"),h=e("./mixInto"),m=e("./warning"),g=[],v=null,y={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),E()):g.length=0}},_={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},b=[y,_];h(r,p.Mixin),h(r,{getTransactionWrappers:function(){return b},destructor:function(){this.dirtyComponentsLength=null,l.release(this.callbackQueue),this.callbackQueue=null,S.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return p.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),c.addPoolingTo(r);var E=d.measure("ReactUpdates","flushBatchedUpdates",function(){for(;g.length;){var e=r.getPooled();e.perform(a,null,e),r.release(e)}}),w={injectReconcileTransaction:function(e){f(e,"ReactUpdates: must provide a reconcile transaction class"),S.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){f(e,"ReactUpdates: must provide a batching strategy"),f("function"==typeof e.batchedUpdates,"ReactUpdates: must provide a batchedUpdates() function"),f("boolean"==typeof e.isBatchingUpdates,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"),v=e}},S={ReactReconcileTransaction:null,batchedUpdates:i,enqueueUpdate:s,flushBatchedUpdates:E,injection:w};t.exports=S},{"./CallbackQueue":6,"./PooledClass":28,"./ReactCurrentOwner":40,"./ReactPerf":71,"./Transaction":104,"./invariant":134,"./mixInto":147,"./warning":158}],88:[function(e,t){var n=e("./LinkedStateMixin"),r=e("./React"),i=e("./ReactComponentWithPureRenderMixin"),o=e("./ReactCSSTransitionGroup"),a=e("./ReactTransitionGroup"),s=e("./cx"),l=e("./cloneWithProps"),c=e("./update");r.addons={CSSTransitionGroup:o,LinkedStateMixin:n,PureRenderMixin:i,TransitionGroup:a,classSet:s,cloneWithProps:l,update:c},r.addons.Perf=e("./ReactDefaultPerf"),r.addons.TestUtils=e("./ReactTestUtils"),t.exports=r},{"./LinkedStateMixin":24,"./React":29,"./ReactCSSTransitionGroup":32,"./ReactComponentWithPureRenderMixin":37,"./ReactDefaultPerf":54,"./ReactTestUtils":82,"./ReactTransitionGroup":86,"./cloneWithProps":108,"./cx":114,"./update":157}],89:[function(e,t){var n=e("./DOMProperty"),r=n.injection.MUST_USE_ATTRIBUTE,i={Properties:{cx:r,cy:r,d:r,dx:r,dy:r,fill:r,fillOpacity:r,fontFamily:r,fontSize:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,markerEnd:r,markerMid:r,markerStart:r,offset:r,opacity:r,patternContentUnits:r,patternUnits:r,points:r,preserveAspectRatio:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeDasharray:r,strokeLinecap:r,strokeOpacity:r,strokeWidth:r,textAnchor:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,y1:r,y2:r,y:r},DOMAttributeNames:{fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox"}};t.exports=i},{"./DOMProperty":11}],90:[function(e,t){function n(e){if("selectionStart"in e&&a.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(document.selection){var t=document.selection.createRange();return{parentElement:t.parentElement(),text:t.text,top:t.boundingTop,left:t.boundingLeft}}var n=window.getSelection();return{anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}}function r(e){if(!v&&null!=h&&h==l()){var t=n(h);if(!g||!d(g,t)){g=t;var r=s.getPooled(f.select,m,e);return r.type="select",r.target=h,o.accumulateTwoPhaseDispatches(r),r}}}var i=e("./EventConstants"),o=e("./EventPropagators"),a=e("./ReactInputSelection"),s=e("./SyntheticEvent"),l=e("./getActiveElement"),c=e("./isTextInputElement"),u=e("./keyOf"),d=e("./shallowEqual"),p=i.topLevelTypes,f={select:{phasedRegistrationNames:{bubbled:u({onSelect:null}),captured:u({onSelectCapture:null})},dependencies:[p.topBlur,p.topContextMenu,p.topFocus,p.topKeyDown,p.topMouseDown,p.topMouseUp,p.topSelectionChange]}},h=null,m=null,g=null,v=!1,y={eventTypes:f,extractEvents:function(e,t,n,i){switch(e){case p.topFocus:(c(t)||"true"===t.contentEditable)&&(h=t,m=n,g=null);break;case p.topBlur:h=null,m=null,g=null;break;case p.topMouseDown:v=!0;break;case p.topContextMenu:case p.topMouseUp:return v=!1,r(i);case p.topSelectionChange:case p.topKeyDown:case p.topKeyUp:return r(i)}}};t.exports=y},{"./EventConstants":16,"./EventPropagators":21,"./ReactInputSelection":63,"./SyntheticEvent":96,"./getActiveElement":122,"./isTextInputElement":137,"./keyOf":141,"./shallowEqual":153}],91:[function(e,t){var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};t.exports=r},{}],92:[function(e,t){var n=e("./EventConstants"),r=e("./EventPluginUtils"),i=e("./EventPropagators"),o=e("./SyntheticClipboardEvent"),a=e("./SyntheticEvent"),s=e("./SyntheticFocusEvent"),l=e("./SyntheticKeyboardEvent"),c=e("./SyntheticMouseEvent"),u=e("./SyntheticDragEvent"),d=e("./SyntheticTouchEvent"),p=e("./SyntheticUIEvent"),f=e("./SyntheticWheelEvent"),h=e("./invariant"),m=e("./keyOf"),g=n.topLevelTypes,v={blur:{phasedRegistrationNames:{bubbled:m({onBlur:!0}),captured:m({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:m({onClick:!0}),captured:m({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:m({onContextMenu:!0}),captured:m({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:m({onCopy:!0}),captured:m({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:m({onCut:!0}),captured:m({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:m({onDoubleClick:!0}),captured:m({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:m({onDrag:!0}),captured:m({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:m({onDragEnd:!0}),captured:m({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:m({onDragEnter:!0}),captured:m({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:m({onDragExit:!0}),captured:m({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:m({onDragLeave:!0}),captured:m({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:m({onDragOver:!0}),captured:m({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:m({onDragStart:!0}),captured:m({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:m({onDrop:!0}),captured:m({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:m({onFocus:!0}),captured:m({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:m({onInput:!0}),captured:m({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:m({onKeyDown:!0}),captured:m({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:m({onKeyPress:!0}),captured:m({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:m({onKeyUp:!0}),captured:m({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:m({onLoad:!0}),captured:m({onLoadCapture:!0})}},error:{phasedRegistrationNames:{bubbled:m({onError:!0}),captured:m({onErrorCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:m({onMouseDown:!0}),captured:m({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:m({onMouseMove:!0}),captured:m({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:m({onMouseOut:!0}),captured:m({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:m({onMouseOver:!0}),captured:m({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:m({onMouseUp:!0}),captured:m({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:m({onPaste:!0}),captured:m({onPasteCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:m({onReset:!0}),captured:m({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:m({onScroll:!0}),captured:m({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:m({onSubmit:!0}),captured:m({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:m({onTouchCancel:!0}),captured:m({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:m({onTouchEnd:!0}),captured:m({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:m({onTouchMove:!0}),captured:m({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:m({onTouchStart:!0}),captured:m({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:m({onWheel:!0}),captured:m({onWheelCapture:!0})}}},y={topBlur:v.blur,topClick:v.click,topContextMenu:v.contextMenu,topCopy:v.copy,topCut:v.cut,topDoubleClick:v.doubleClick,topDrag:v.drag,topDragEnd:v.dragEnd,topDragEnter:v.dragEnter,topDragExit:v.dragExit,topDragLeave:v.dragLeave,topDragOver:v.dragOver,topDragStart:v.dragStart,topDrop:v.drop,topError:v.error,topFocus:v.focus,topInput:v.input,topKeyDown:v.keyDown,topKeyPress:v.keyPress,topKeyUp:v.keyUp,topLoad:v.load,topMouseDown:v.mouseDown,topMouseMove:v.mouseMove,topMouseOut:v.mouseOut,topMouseOver:v.mouseOver,topMouseUp:v.mouseUp,topPaste:v.paste,topReset:v.reset,topScroll:v.scroll,topSubmit:v.submit,topTouchCancel:v.touchCancel,topTouchEnd:v.touchEnd,topTouchMove:v.touchMove,topTouchStart:v.touchStart,topWheel:v.wheel};for(var _ in y)y[_].dependencies=[_];var b={eventTypes:v,executeDispatch:function(e,t,n){var i=r.executeDispatch(e,t,n);i===!1&&(e.stopPropagation(),e.preventDefault())},extractEvents:function(e,t,n,r){var m=y[e];if(!m)return null;var v;switch(e){case g.topInput:case g.topLoad:case g.topError:case g.topReset:case g.topSubmit:v=a;break;case g.topKeyPress:if(0===r.charCode)return null;case g.topKeyDown:case g.topKeyUp:v=l;break;case g.topBlur:case g.topFocus:v=s;break;case g.topClick:if(2===r.button)return null;case g.topContextMenu:case g.topDoubleClick:case g.topMouseDown:case g.topMouseMove:case g.topMouseOut:case g.topMouseOver:case g.topMouseUp:v=c;break;case g.topDrag:case g.topDragEnd:case g.topDragEnter:case g.topDragExit:case g.topDragLeave:case g.topDragOver:case g.topDragStart:case g.topDrop:v=u;break;case g.topTouchCancel:case g.topTouchEnd:case g.topTouchMove:case g.topTouchStart:v=d;break;case g.topScroll:v=p;break;case g.topWheel:v=f;break;case g.topCopy:case g.topCut:case g.topPaste:v=o}h(v,"SimpleEventPlugin: Unhandled event type, `%s`.",e);var _=v.getPooled(m,n,r);return i.accumulateTwoPhaseDispatches(_),_}};t.exports=b},{"./EventConstants":16,"./EventPluginUtils":20,"./EventPropagators":21,"./SyntheticClipboardEvent":93,"./SyntheticDragEvent":95,"./SyntheticEvent":96,"./SyntheticFocusEvent":97,"./SyntheticKeyboardEvent":99,"./SyntheticMouseEvent":100,"./SyntheticTouchEvent":101,"./SyntheticUIEvent":102,"./SyntheticWheelEvent":103,"./invariant":134,"./keyOf":141}],93:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),i={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};r.augmentClass(n,i),t.exports=n},{"./SyntheticEvent":96}],94:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),i={data:null};r.augmentClass(n,i),t.exports=n},{"./SyntheticEvent":96}],95:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticMouseEvent"),i={dataTransfer:null};r.augmentClass(n,i),t.exports=n},{"./SyntheticMouseEvent":100}],96:[function(e,t){function n(e,t,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var r=this.constructor.Interface;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];this[o]=a?a(n):n[o]}var s=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;this.isDefaultPrevented=s?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse}var r=e("./PooledClass"),i=e("./emptyFunction"),o=e("./getEventTarget"),a=e("./merge"),s=e("./mergeInto"),l={type:null,target:o,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};s(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=i.thatReturnsTrue},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=i.thatReturnsTrue},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=l,n.augmentClass=function(e,t){var n=this,i=Object.create(n.prototype);s(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=a(n.Interface,t),e.augmentClass=n.augmentClass,r.addPoolingTo(e,r.threeArgumentPooler)},r.addPoolingTo(n,r.threeArgumentPooler),t.exports=n},{"./PooledClass":28,"./emptyFunction":116,"./getEventTarget":125,"./merge":144,"./mergeInto":146}],97:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),i={relatedTarget:null};r.augmentClass(n,i),t.exports=n},{"./SyntheticUIEvent":102}],98:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),i={data:null};r.augmentClass(n,i),t.exports=n},{"./SyntheticEvent":96}],99:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),i=e("./getEventKey"),o=e("./getEventModifierState"),a={key:i,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:o,charCode:function(e){return"keypress"===e.type?"charCode"in e?e.charCode:e.keyCode:0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return e.keyCode||e.charCode}};r.augmentClass(n,a),t.exports=n},{"./SyntheticUIEvent":102,"./getEventKey":123,"./getEventModifierState":124}],100:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),i=e("./ViewportMetrics"),o=e("./getEventModifierState"),a={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:o,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+i.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+i.currentScrollTop}};r.augmentClass(n,a),t.exports=n},{"./SyntheticUIEvent":102,"./ViewportMetrics":105,"./getEventModifierState":124}],101:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),i=e("./getEventModifierState"),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:i};r.augmentClass(n,o),t.exports=n},{"./SyntheticUIEvent":102,"./getEventModifierState":124}],102:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),i=e("./getEventTarget"),o={view:function(e){if(e.view)return e.view;var t=i(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};r.augmentClass(n,o),t.exports=n},{"./SyntheticEvent":96,"./getEventTarget":125}],103:[function(e,t){function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticMouseEvent"),i={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};r.augmentClass(n,i),t.exports=n},{"./SyntheticMouseEvent":100}],104:[function(e,t){var n=e("./invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,r,i,o,a,s,l){n(!this.isInTransaction(),"Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.");var c,u;try{this._isInTransaction=!0,c=!0,this.initializeAll(0),u=e.call(t,r,i,o,a,s,l),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(d){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return u},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=i.OBSERVED_ERROR,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===i.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(o){}}}},closeAll:function(e){n(this.isInTransaction(),"Transaction.closeAll(): Cannot close transaction when none are open.");for(var t=this.transactionWrappers,r=e;r<t.length;r++){var o,a=t[r],s=this.wrapperInitData[r];try{o=!0,s!==i.OBSERVED_ERROR&&a.close&&a.close.call(this,s),o=!1}finally{if(o)try{this.closeAll(r+1)}catch(l){}}}this.wrapperInitData.length=0}},i={Mixin:r,OBSERVED_ERROR:{}};t.exports=i},{"./invariant":134}],105:[function(e,t){var n=e("./getUnboundedScrollPosition"),r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(){var e=n(window);r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};t.exports=r},{"./getUnboundedScrollPosition":130}],106:[function(e,t){function n(e,t){if(r(null!=t,"accumulate(...): Accumulated items must be not be null or undefined."),null==e)return t;var n=Array.isArray(e),i=Array.isArray(t);return n?e.concat(t):i?[e].concat(t):[e,t]}var r=e("./invariant");t.exports=n},{"./invariant":134}],107:[function(e,t){function n(e){for(var t=1,n=0,i=0;i<e.length;i++)t=(t+e.charCodeAt(i))%r,n=(n+t)%r;return t|n<<16}var r=65521;t.exports=n},{}],108:[function(e,t){function n(e,t){o(!e.props.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent.");var n=r.mergeProps(t,e.props);return!n.hasOwnProperty(a)&&e.props.hasOwnProperty(a)&&(n.children=e.props.children),e.constructor(n)}var r=e("./ReactPropTransferer"),i=e("./keyOf"),o=e("./warning"),a=i({children:null});t.exports=n},{"./ReactPropTransferer":72,"./keyOf":141,"./warning":158}],109:[function(e,t){function n(e,t){return e&&t?e===t?!0:r(e)?!1:r(t)?n(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var r=e("./isTextNode");t.exports=n},{"./isTextNode":138}],110:[function(e,t){function n(e,t,n,r,i,o,a){if(e=e||{},a)throw new Error("Too many arguments passed to copyProperties");for(var s,l=[t,n,r,i,o],c=0;l[c];){s=l[c++];for(var u in s)e[u]=s[u];s.hasOwnProperty&&s.hasOwnProperty("toString")&&"undefined"!=typeof s.toString&&e.toString!==s.toString&&(e.toString=s.toString)}return e}t.exports=n},{}],111:[function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function r(e){return n(e)?Array.isArray(e)?e.slice():i(e):[e]}var i=e("./toArray");t.exports=r},{"./toArray":155}],112:[function(e,t){function n(e){var t=r.createClass({displayName:"ReactFullPageComponent"+(e.type.displayName||""),componentWillUnmount:function(){i(!1,"%s tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this.constructor.displayName)},render:function(){return this.transferPropsTo(e(null,this.props.children))}});return t}var r=e("./ReactCompositeComponent"),i=e("./invariant");t.exports=n},{"./ReactCompositeComponent":38,"./invariant":134}],113:[function(e,t){function n(e){var t=e.match(c);return t&&t[1].toLowerCase()}function r(e,t){var r=l;s(!!l,"createNodesFromMarkup dummy not initialized");var i=n(e),c=i&&a(i);if(c){r.innerHTML=c[1]+e+c[2];for(var u=c[0];u--;)r=r.lastChild}else r.innerHTML=e;var d=r.getElementsByTagName("script");d.length&&(s(t,"createNodesFromMarkup(...): Unexpected <script> element rendered."),o(d).forEach(t));for(var p=o(r.childNodes);r.lastChild;)r.removeChild(r.lastChild);return p}var i=e("./ExecutionEnvironment"),o=e("./createArrayFrom"),a=e("./getMarkupWrap"),s=e("./invariant"),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=r},{"./ExecutionEnvironment":22,"./createArrayFrom":111,"./getMarkupWrap":126,"./invariant":134}],114:[function(e,t){function n(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).join(" "):Array.prototype.join.call(arguments," ")}t.exports=n},{}],115:[function(e,t){function n(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var r=e("./CSSProperty"),i=r.isUnitlessNumber;t.exports=n},{"./CSSProperty":4}],116:[function(e,t){function n(e){return function(){return e}}function r(){}var i=e("./copyProperties");i(r,{thatReturns:n,thatReturnsFalse:n(!1),thatReturnsTrue:n(!0),thatReturnsNull:n(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(e){return e}}),t.exports=r},{"./copyProperties":110}],117:[function(e,t){var n={};Object.freeze(n),t.exports=n},{}],118:[function(e,t){function n(e){return i[e]}function r(e){return(""+e).replace(o,n)}var i={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},o=/[&><"']/g;t.exports=r},{}],119:[function(e,t){function n(e,t,n){var r=e,i=!r.hasOwnProperty(n);o(i,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n),i&&null!=t&&(r[n]=t)}function r(e){if(null==e)return e;var t={};return i(e,n,t),t}var i=e("./traverseAllChildren"),o=e("./warning");t.exports=r},{"./traverseAllChildren":156,"./warning":158}],120:[function(e,t){function n(e){e.disabled||e.focus()}t.exports=n},{}],121:[function(e,t){var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],122:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],123:[function(e,t){function n(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n="charCode"in e?e.charCode:e.keyCode;return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?o[e.keyCode]||"Unidentified":void r(!1,"Unexpected keyboard event type: %s",e.type)}var r=e("./invariant"),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{"./invariant":134}],124:[function(e,t){function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function r(){return n}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],125:[function(e,t){function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],126:[function(e,t){function n(e){return i(!!o,"Markup wrapping node not initialized"),d.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(o.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!o.firstChild),a[e]?d[e]:null}var r=e("./ExecutionEnvironment"),i=e("./invariant"),o=r.canUseDOM?document.createElement("div"):null,a={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},s=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],u=[1,"<svg>","</svg>"],d={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:s,option:s,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c,circle:u,defs:u,ellipse:u,g:u,line:u,linearGradient:u,path:u,polygon:u,polyline:u,radialGradient:u,rect:u,stop:u,text:u};t.exports=n},{"./ExecutionEnvironment":22,"./invariant":134}],127:[function(e,t){function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var i=n(e),o=0,a=0;i;){if(3==i.nodeType){if(a=o+i.textContent.length,t>=o&&a>=t)return{node:i,offset:t-o};o=a}i=n(r(i))}}t.exports=i},{}],128:[function(e,t){function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],129:[function(e,t){function n(){return!i&&r.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var r=e("./ExecutionEnvironment"),i=null;t.exports=n},{"./ExecutionEnvironment":22}],130:[function(e,t){function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],131:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],132:[function(e,t){function n(e){return r(e).replace(i,"-ms-")}var r=e("./hyphenate"),i=/^ms-/;t.exports=n},{"./hyphenate":131}],133:[function(e,t){function n(e){return e&&"function"==typeof e.type&&"function"==typeof e.type.prototype.mountComponent&&"function"==typeof e.type.prototype.receiveComponent}function r(e){return i(n(e),"Only React Components are valid for mounting."),new e.type(e)}var i=e("./invariant");t.exports=r},{"./invariant":134}],134:[function(e,t){var n=function(e,t,n,r,i,o,a,s){if(void 0===t)throw new Error("invariant requires an error message argument");if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;l=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[u++]}))}throw l.framesToPop=1,l}};t.exports=n},{}],135:[function(e,t){function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var a=document.createElement("div");a.setAttribute(n,"return;"),o="function"==typeof a[n]}return!o&&r&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var r,i=e("./ExecutionEnvironment");i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{"./ExecutionEnvironment":22}],136:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],137:[function(e,t){function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],138:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=n},{"./isNode":136}],139:[function(e,t){function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e+=" "+t);return e}t.exports=n},{}],140:[function(e,t){var n=e("./invariant"),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e),"keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(r[t]=t);
24return r};t.exports=r},{"./invariant":134}],141:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],142:[function(e,t){function n(e,t,n){if(!e)return null;var r=0,i={};for(var o in e)e.hasOwnProperty(o)&&(i[o]=t.call(n,e[o],o,r++));return i}t.exports=n},{}],143:[function(e,t){function n(e){var t={};return function(n){return t.hasOwnProperty(n)?t[n]:t[n]=e.call(this,n)}}t.exports=n},{}],144:[function(e,t){var n=e("./mergeInto"),r=function(e,t){var r={};return n(r,e),n(r,t),r};t.exports=r},{"./mergeInto":146}],145:[function(e,t){var n=e("./invariant"),r=e("./keyMirror"),i=36,o=function(e){return"object"!=typeof e||null===e},a={MAX_MERGE_DEPTH:i,isTerminal:o,normalizeMergeArg:function(e){return void 0===e||null===e?{}:e},checkMergeArrayArgs:function(e,t){n(Array.isArray(e)&&Array.isArray(t),"Tried to merge arrays, instead got %s and %s.",e,t)},checkMergeObjectArgs:function(e,t){a.checkMergeObjectArg(e),a.checkMergeObjectArg(t)},checkMergeObjectArg:function(e){n(!o(e)&&!Array.isArray(e),"Tried to merge an object, instead got %s.",e)},checkMergeIntoObjectArg:function(e){n(!(o(e)&&"function"!=typeof e||Array.isArray(e)),"Tried to merge into an object, instead got %s.",e)},checkMergeLevel:function(e){n(i>e,"Maximum deep merge depth exceeded. You may be attempting to merge circular structures in an unsupported way.")},checkArrayStrategy:function(e){n(void 0===e||e in a.ArrayStrategies,"You must provide an array strategy to deep merge functions to instruct the deep merge how to resolve merging two arrays.")},ArrayStrategies:r({Clobber:!0,IndexByIndex:!0})};t.exports=a},{"./invariant":134,"./keyMirror":140}],146:[function(e,t){function n(e,t){if(o(e),null!=t){i(t);for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}}var r=e("./mergeHelpers"),i=r.checkMergeObjectArg,o=r.checkMergeIntoObjectArg;t.exports=n},{"./mergeHelpers":145}],147:[function(e,t){var n=function(e,t){var n;for(n in t)t.hasOwnProperty(n)&&(e.prototype[n]=t[n])};t.exports=n},{}],148:[function(e,t){function n(e){r(e&&!/[^a-z0-9_]/.test(e),"You must provide an eventName using only the characters [a-z0-9_]")}var r=e("./invariant");t.exports=n},{"./invariant":134}],149:[function(e,t){function n(e){return i(r.isValidDescriptor(e),"onlyChild must be passed a children with exactly one child."),e}var r=e("./ReactDescriptor"),i=e("./invariant");t.exports=n},{"./ReactDescriptor":56,"./invariant":134}],150:[function(e,t){var n,r=e("./ExecutionEnvironment");r.canUseDOM&&(n=window.performance||window.msPerformance||window.webkitPerformance),t.exports=n||{}},{"./ExecutionEnvironment":22}],151:[function(e,t){var n=e("./performance");n&&n.now||(n=Date);var r=n.now.bind(n);t.exports=r},{"./performance":150}],152:[function(e,t){var n=e("./ExecutionEnvironment"),r=function(e,t){e.innerHTML=t};if(n.canUseDOM){var i=document.createElement("div");i.innerHTML=" ",""===i.innerHTML&&(r=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),t.match(/^[ \r\n\t\f]/)||"<"===t[0]&&(-1!==t.indexOf("<noscript")||-1!==t.indexOf("<script")||-1!==t.indexOf("<style")||-1!==t.indexOf("<meta")||-1!==t.indexOf("<link"))){e.innerHTML=""+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=r},{"./ExecutionEnvironment":22}],153:[function(e,t){function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],154:[function(e,t){function n(e,t){return e&&t&&e.type===t.type&&(e.props&&e.props.key)===(t.props&&t.props.key)&&e._owner===t._owner?!0:!1}t.exports=n},{}],155:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e),"toArray: Array-like object expected"),r("number"==typeof t,"toArray: Object needs a length property"),r(0===t||t-1 in e,"toArray: Object should have keys for indices"),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var i=Array(t),o=0;t>o;o++)i[o]=e[o];return i}var r=e("./invariant");t.exports=n},{"./invariant":134}],156:[function(e,t){function n(e){return p[e]}function r(e,t){return e&&e.props&&null!=e.props.key?o(e.props.key):t.toString(36)}function i(e){return(""+e).replace(f,n)}function o(e){return"$"+i(e)}function a(e,t,n){return null==e?0:h(e,"",0,t,n)}var s=e("./ReactInstanceHandles"),l=e("./ReactTextComponent"),c=e("./invariant"),u=s.SEPARATOR,d=":",p={"=":"=0",".":"=1",":":"=2"},f=/[=.:]/g,h=function(e,t,n,i,a){var s=0;if(Array.isArray(e))for(var p=0;p<e.length;p++){var f=e[p],m=t+(t?d:u)+r(f,p),g=n+s;s+=h(f,m,g,i,a)}else{var v=typeof e,y=""===t,_=y?u+r(e,0):t;if(null==e||"boolean"===v)i(a,null,_,n),s=1;else if(e.type&&e.type.prototype&&e.type.prototype.mountComponentIntoNode)i(a,e,_,n),s=1;else if("object"===v){c(!e||1!==e.nodeType,"traverseAllChildren(...): Encountered an invalid child; DOM elements are not valid children of React components.");for(var b in e)e.hasOwnProperty(b)&&(s+=h(e[b],t+(t?d:u)+o(b)+d+r(e[b],0),n+s,i,a))}else if("string"===v){var E=l(e);i(a,E,_,n),s+=1}else if("number"===v){var w=l(""+e);i(a,w,_,n),s+=1}}return s};t.exports=a},{"./ReactInstanceHandles":64,"./ReactTextComponent":83,"./invariant":134}],157:[function(e,t){function n(e){return Array.isArray(e)?e.concat():e&&"object"==typeof e?o(new e.constructor,e):e}function r(e,t,n){s(Array.isArray(e),"update(): expected target of %s to be an array; got %s.",n,e);var r=t[n];s(Array.isArray(r),"update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?",n,r)}function i(e,t){if(s("object"==typeof t,"update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?",h.join(", "),d),t.hasOwnProperty(d))return s(1===Object.keys(t).length,"Cannot have more than one key in an object with %s",d),t[d];var a=n(e);if(t.hasOwnProperty(p)){var g=t[p];s(g&&"object"==typeof g,"update(): %s expects a spec of type 'object'; got %s",p,g),s(a&&"object"==typeof a,"update(): %s expects a target of type 'object'; got %s",p,a),o(a,t[p])}t.hasOwnProperty(l)&&(r(e,t,l),t[l].forEach(function(e){a.push(e)})),t.hasOwnProperty(c)&&(r(e,t,c),t[c].forEach(function(e){a.unshift(e)})),t.hasOwnProperty(u)&&(s(Array.isArray(e),"Expected %s target to be an array; got %s",u,e),s(Array.isArray(t[u]),"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",u,t[u]),t[u].forEach(function(e){s(Array.isArray(e),"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",u,t[u]),a.splice.apply(a,e)})),t.hasOwnProperty(f)&&(s("function"==typeof t[f],"update(): expected spec of %s to be a function; got %s.",f,t[f]),a=t[f](a));for(var v in t)m.hasOwnProperty(v)&&m[v]||(a[v]=i(e[v],t[v]));return a}var o=e("./copyProperties"),a=e("./keyOf"),s=e("./invariant"),l=a({$push:null}),c=a({$unshift:null}),u=a({$splice:null}),d=a({$set:null}),p=a({$merge:null}),f=a({$apply:null}),h=[l,c,u,d,p,f],m={};h.forEach(function(e){m[e]=!0}),t.exports=i},{"./copyProperties":110,"./invariant":134,"./keyOf":141}],158:[function(e,t){var n=e("./emptyFunction"),r=n;r=function(e,t){var n=Array.prototype.slice.call(arguments,2);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(!e){var r=0;console.warn("Warning: "+t.replace(/%s/g,function(){return n[r++]}))}},t.exports=r},{"./emptyFunction":116}]},{},[88])(88)}),define("project/FileTreeView",["require","exports","module","thirdparty/react","thirdparty/immutable","thirdparty/lodash","file/FileUtils","project/FileTreeViewModel","utils/ViewUtils","utils/KeyEvent"],function(e,t){function n(e,t){return""!==t?e.substring(0,e.length-t.length-1):e}function r(e){var t=$("<div />",{css:{position:"absolute",top:"-200px",left:"-1000px",visibility:"hidden"}}).appendTo("body");t.text("pW"+e);var n=t.width();return t.remove(),n}function i(e){return void 0!==e}function o(e){function t(t,n){var r=v.isFile(e.get(t)),i=v.isFile(e.get(n));return!r&&i?-1:r&&!i?1:g.compareFilenames(t,n)}return t}function a(e,t){return e.keySeq().sort(t?o(e):g.compareFilenames)}function s(e,t,n,r,i,o){n&&f.renderComponent(R({treeData:t.treeData,selectionViewInfo:t.selectionViewInfo,sortDirectoriesFirst:t.sortDirectoriesFirst,parentPath:n.fullPath,actions:r,extensions:E,platform:o,forceRender:i}),e)}function l(e,t){if(!t||"function"!=typeof t)return void console.error("Attempt to add FileTreeView",e,"extension without a callback function");var n=E.get(e);n||(n=h.Vector()),n=n.push(t),E=E.set(e,n)}function c(e){l("icons",e)}function u(e){l("addClass",e)}var d,p,f=e("thirdparty/react"),h=e("thirdparty/immutable"),m=e("thirdparty/lodash"),g=e("file/FileUtils"),v=e("project/FileTreeViewModel"),y=e("utils/ViewUtils"),_=e("utils/KeyEvent"),b=f.DOM,E=h.Map(),w=500,S=2,C=0,I={myPath:function(){var e=this.props.parentPath+this.props.name;return v.isFile(this.props.entry)||"/"===m.last(e)||(e+="/"),e}},k={handleClick:function(e){return e.stopPropagation(),e.button!==C?!1:!0},handleKeyDown:function(e){e.keyCode===_.DOM_VK_ESCAPE?this.props.actions.cancelRename():e.keyCode===_.DOM_VK_RETURN&&this.props.actions.performRename()},handleKeyUp:function(){this.props.actions.setRenameValue(this.refs.name.getDOMNode().value.trim())},handleBlur:function(){this.props.actions.performRename()}},x=f.createClass({mixins:[k],componentDidMount:function(){var e=this.props.name,t=g.getSmartFileExtension(e),r=this.refs.name.getDOMNode();r.setSelectionRange(0,n(e,t).length),y.scrollElementIntoView($("#project-files-container"),$(r),!0)},render:function(){var e=r(this.props.name);return b.input({className:"jstree-rename-input",type:"text",defaultValue:this.props.name,autoFocus:!0,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onClick:this.handleClick,onBlur:this.handleBlur,style:{width:e},ref:"name"})}}),T={handleMouseDown:function(e){return e.button===S||"mac"===this.props.platform&&e.button===C&&e.ctrlKey?(this.props.actions.setContext(this.myPath()),!1):void 0}},D={getIcons:function(){var e,t=this.props.extensions;if(t&&t.get("icons")){var n=this.getDataForExtension();e=t.get("icons").map(function(e){try{var t=e(n);return f.isValidComponent(t)||(t=f.DOM.span({dangerouslySetInnerHTML:{__html:$(t)[0].outerHTML}})),t}catch(r){console.warn("Exception thrown in FileTreeView icon provider:",r)}}).filter(i).toArray()}return e&&0!==e.length||(e=[b.ins({className:"jstree-icon"}," ")]),e},getClasses:function(e){var t=this.props.extensions;if(t&&t.get("addClass")){var n=this.getDataForExtension();e=e+" "+t.get("addClass").map(function(e){try{return e(n)}catch(t){console.warn("Exception thrown in FileTreeView addClass provider:",t)}}).filter(i).toArray().join(" ")}return e}},M=f.createClass({mixins:[T,I,D],getInitialState:function(){return{clickTimer:null}},shouldComponentUpdate:function(e){return e.forceRender||this.props.entry!==e.entry||this.props.extensions!==e.extensions},componentDidUpdate:function(e){var t=e.entry.get("selected"),n=this.props.entry.get("selected");n&&!t?y.scrollElementIntoView($("#project-files-container"),$(this.getDOMNode()),!0):!n&&t&&null!==this.state.clickTimer&&this.clearTimer()},clearTimer:function(){null!==this.state.clickTimer&&(window.clearTimeout(this.state.clickTimer),this.setState({clickTimer:null}))},startRename:function(){this.props.entry.get("rename")||this.props.actions.startRename(this.myPath()),this.clearTimer()},handleClick:function(e){if(this.props.entry.get("rename"))return!0;if(e.button===C){if(this.props.entry.get("selected")){if(null===this.state.clickTimer&&!this.props.entry.get("rename")){var t=window.setTimeout(this.startRename,w);this.setState({clickTimer:t})}}else this.props.actions.setSelected(this.myPath());return!1}},handleDoubleClick:function(){this.props.entry.get("rename")||(null!==this.state.clickTimer&&this.clearTimer(),this.props.actions.selectInWorkingSet(this.myPath()))},getDataForExtension:function(){return{name:this.props.name,isFile:!0,fullPath:this.myPath()}},render:function(){var e=this.props.name,t=g.getSmartFileExtension(e),r=n(e,t);t&&(t=b.span({className:"extension"},"."+t));var i,o=f.addons.classSet,a=o({"jstree-clicked selected-node":this.props.entry.get("selected"),"context-node":this.props.entry.get("context")});if(this.props.entry.get("rename"))i=x({actions:this.props.actions,entry:this.props.entry,name:this.props.name,parentPath:this.props.parentPath});else{var s=m.flatten([{href:"#",className:a},this.getIcons(),r,t],!0);i=b.a.apply(b.a,s)}return b.li({className:this.getClasses("jstree-leaf"),onClick:this.handleClick,onMouseDown:this.handleMouseDown,onDoubleClick:this.handleDoubleClick},b.ins({className:"jstree-icon"}," "),i)}}),O=f.createClass({mixins:[k],render:function(){var e=r(this.props.name);return b.input({className:"jstree-rename-input",type:"text",defaultValue:this.props.name,autoFocus:!0,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onBlur:this.handleBlur,style:{width:e},onClick:this.handleClick,ref:"name"})}});d=f.createClass({mixins:[T,I,D],shouldComponentUpdate:function(e){return e.forceRender||this.props.entry!==e.entry||this.props.sortDirectoriesFirst!==e.sortDirectoriesFirst||this.props.extensions!==e.extensions},handleClick:function(e){if(e.button===C){var t=this.props.entry.get("open"),n=t?!1:!0;return e.metaKey||e.ctrlKey?e.altKey?n?(this.props.actions.toggleSubdirectories(this.myPath(),n),this.props.actions.setDirectoryOpen(this.myPath(),n)):this.props.actions.closeSubtree(this.myPath()):this.props.actions.toggleSubdirectories(this.props.parentPath,n):this.props.actions.setDirectoryOpen(this.myPath(),n),!1}},getDataForExtension:function(){return{name:this.props.name,isFile:!1,fullPath:this.myPath()}},render:function(){var e,t,n=this.props.entry,r=n.get("children"),i=n.get("open"),o="";i&&r?(e="open",t=p({parentPath:this.myPath(),contents:r,extensions:this.props.extensions,actions:this.props.actions,forceRender:this.props.forceRender,platform:this.props.platform,sortDirectoriesFirst:this.props.sortDirectoriesFirst})):e="closed",this.props.entry.get("selected")&&(o+=" jstree-clicked sidebar-selection"),n.get("context")&&(o+=" context-node");var a,s;n.get("rename")&&(s=O({actions:this.props.actions,entry:this.props.entry,name:this.props.name,parentPath:this.props.parentPath}));var l=m.flatten([{href:"#",className:o},this.getIcons()],!0);return n.get("rename")||l.push(this.props.name),a=b.a.apply(b.a,l),b.li({className:this.getClasses("jstree-"+e),onClick:this.handleClick,onMouseDown:this.handleMouseDown},b.ins({className:"jstree-icon"}," "),s,a,t)}}),p=f.createClass({shouldComponentUpdate:function(e){return e.forceRender||this.props.contents!==e.contents||this.props.sortDirectoriesFirst!==e.sortDirectoriesFirst||this.props.extensions!==e.extensions},render:function(){var e=this.props.extensions,t=e&&e.get("icons")?"jstree-icons":"jstree-no-icons",n=this.props.isRoot?{className:"jstree-brackets jstree-no-dots "+t}:null,r=this.props.contents,i=a(r,this.props.sortDirectoriesFirst);return b.ul(n,i.map(function(e){var t=r.get(e);return v.isFile(t)?M({parentPath:this.props.parentPath,name:e,entry:t,actions:this.props.actions,extensions:this.props.extensions,forceRender:this.props.forceRender,platform:this.props.platform,key:e}):d({parentPath:this.props.parentPath,name:e,entry:t,actions:this.props.actions,extensions:this.props.extensions,sortDirectoriesFirst:this.props.sortDirectoriesFirst,forceRender:this.props.forceRender,platform:this.props.platform,key:e})}.bind(this)).toArray())}});var L=f.createClass({getInitialState:function(){return{initialScroll:0}},componentDidUpdate:function(){if(this.props.visible){var e=this.getDOMNode(),t=$(e.parentNode).find(this.props.selectedClassName),n=this.props.selectionViewInfo;0!==t.length&&(e.style.top=t.offset().top-n.get("offsetTop")+n.get("scrollTop")-t.position().top+"px")}},render:function(){var e=this.props.selectionViewInfo,t=e.get("scrollLeft"),n=e.get("width")-this.props.widthAdjustment,r=e.get("scrollWidth");return t+n>r&&(t=r-n),b.div({style:{overflow:"auto",left:t,width:n,display:this.props.visible?"block":"none"},className:this.props.className})}}),R=f.createClass({shouldComponentUpdate:function(e){return e.forceRender||this.props.treeData!==e.treeData||this.props.sortDirectoriesFirst!==e.sortDirectoriesFirst||this.props.extensions!==e.extensions||this.props.selectionViewInfo!==e.selectionViewInfo},render:function(){var e=L({ref:"selectionBackground",selectionViewInfo:this.props.selectionViewInfo,className:"filetree-selection",visible:this.props.selectionViewInfo.get("hasSelection"),widthAdjustment:0,selectedClassName:".selected-node",forceUpdate:!0}),t=L({ref:"contextBackground",selectionViewInfo:this.props.selectionViewInfo,className:"filetree-context",visible:this.props.selectionViewInfo.get("hasContext"),widthAdjustment:0,selectedClassName:".context-node",forceUpdate:!0});return b.div(null,e,t,p({isRoot:!0,parentPath:this.props.parentPath,sortDirectoriesFirst:this.props.sortDirectoriesFirst,contents:this.props.treeData,extensions:this.props.extensions,actions:this.props.actions,forceRender:this.props.forceRender,platform:this.props.platform}))}});t._sortFormattedDirectory=a,t._fileNode=M,t._directoryNode=d,t._directoryContents=p,t._fileTreeView=R,t.addIconProvider=c,t.addClassesProvider=u,t.render=s}),define("project/ProjectManager",["require","exports","module","utils/Global","thirdparty/lodash","utils/AppInit","utils/Async","preferences/PreferencesDialogs","preferences/PreferencesManager","document/DocumentManager","view/MainViewManager","command/CommandManager","command/Commands","widgets/Dialogs","widgets/DefaultDialogs","utils/DeprecationWarning","language/LanguageManager","command/Menus","utils/StringUtils","strings","filesystem/FileSystem","project/FileViewController","utils/PerfUtils","file/FileUtils","filesystem/FileSystemError","i18n!nls/urls","project/FileSyncManager","project/ProjectModel","project/FileTreeView","utils/ViewUtils"],function(e,t,n){function r(){return gt.getFileSelectionFocus()===gt.PROJECT_MANAGER}function i(e,t){window.setTimeout(function(){var e=t.type,n=t.isFolder,r=t.name;if(e===_t.ALREADY_EXISTS)G(Tt,n,null,r);else if(e===wt.ERROR_INVALID_FILENAME)G(Nt,n,wt._invalidChars);else{var i=e===_t.NOT_WRITABLE?ht.NO_MODIFICATION_ALLOWED_ERR:ft.format(ht.GENERIC_ERROR,e);G(xt,n,i,r).getPromise()}},10)}function o(e,t){Pt.setSelected(e),t&&gt.setFileViewFocus(gt.WORKING_SET_VIEW)}function a(e){this.model=e,this._bindEvents()}function s(){var e=Pt.getContext();return e||(e=Pt.getSelected()),e||(e=ot.getCurrentlyViewedFile()),e}function l(){$t.setFocused(r()),Y()}function c(){var e=ot.getCurrentlyViewedPath(ot.ACTIVE_PANE);e&&r()?$t.setSelected(e,!0):$t.setSelected(null),l()}function u(e,t){$t.setCurrentFile(t)}function d(){return{location:{scope:"user",layer:"project",layerID:Pt.projectRoot.fullPath}}}function p(){return Pt.getBaseUrl()}function f(e){var t=d();e=Pt.setBaseUrl(e),rt.setViewState("project.baseUrl",e,t)}function h(e){return Pt.isWithinProject(e)}function m(e){return Pt.makeProjectRelativeIfPossible(e)}function g(){return Pt.projectRoot}function v(e){var t=new $.Deferred;return Pt.setProjectRoot(e).then(function(){t.resolve(),Pt.reopenNodes(rt.getViewState("project.treeState",d()))}),t.promise()}function y(e){return ut.deprecationWarning("ProjectManager.isBinaryFile() called for "+e+". Use LanguageManager.getLanguageForPath(fileName).isBinary() instead."),dt.getLanguageForPath(e).isBinary()}function _(){return wt._getWelcomeProjectPath(bt.GETTING_STARTED,yt.getNativeBracketsDirectoryPath())}function b(e){var t=wt._addWelcomeProjectPath(e,rt.getViewState("welcomeProjects"));rt.setViewState("welcomeProjects",t)}function E(e){return wt._isWelcomeProjectPath(e,_(),rt.getViewState("welcomeProjects"))}function w(e){return E(e)?_():e}function S(){function e(e){var t=new $.Deferred,n=mt.getDirectoryForPath(e);return n.exists(function(e,n){!e&&n?t.resolve():t.reject()}),t.promise()}var t=[],n=rt.getViewState("recentProjects")||[],r=new $.Deferred;return n.length>1&&t.push(n[1]),t.push(_()),tt.firstSequentially(t,e).done(function(e){r.resolve(e)}).fail(function(){r.resolve(yt.getNativeBracketsDirectoryPath())}),r.promise()}function C(){return w(rt.getViewState("projectPath"))}function I(e){mt.on("change",q),mt.on("rename",z),mt.watch(mt.getDirectoryForPath(e),wt._shouldShowName,function(t){t===_t.TOO_MANY_ENTRIES?Ft||(G(Rt),Ft=!0):t&&console.error("Error watching project root: ",e,t)}),Pt._resetCache()}function k(){var e=new $.Deferred;return Pt.projectRoot?(mt.off("change",q),mt.off("rename",z),mt.unwatch(Pt.projectRoot,function(t){t?(console.error("Error unwatching project root: ",Pt.projectRoot.fullPath,t),e.reject(t)):e.resolve()}),Pt._resetCache()):e.reject(),e.promise()}function x(){var e=g();e?rt._setProjectSettingsFile(e.fullPath+It):rt._setProjectSettingsFile()}function T(e,n){var r=new $.Deferred,i=new $.Deferred;if(e=wt._ensureTrailingSlash(e),n)i.resolve();else{if(Pt.projectRoot&&Pt.projectRoot.fullPath===e)return(new $.Deferred).resolve().promise();Pt.projectRoot&&$(t).triggerHandler("beforeProjectClose",Pt.projectRoot),ot._closeAll(ot.ALL_PANES),k().always(function(){Pt.projectRoot&&(dt._resetPathLanguageOverrides(),rt._reloadUserPrefs(Pt.projectRoot),$(t).triggerHandler("projectClose",Pt.projectRoot)),i.resolve()})}return i.done(function(){var i={location:{scope:"user",layer:"project"}};if(n||rt._stateProjectLayer.setProjectPath(e),!brackets.inBrowser){n||I(e);var o=mt.getDirectoryForPath(e);o.exists(function(n,a){if(a){var s=!Pt.projectRoot||!o||Pt.projectRoot.fullPath!==o.fullPath,l=vt.markStart("Load Project: "+e);Ft=!1,v(o).always(function(){if(Pt.setBaseUrl(rt.getViewState("project.baseUrl",i)||""),s&&(x(),rt._setCurrentEditingFile(e)),e===_()&&b(e),s){var n=[];$(t).triggerHandler({type:"projectOpen",promises:n},[Pt.projectRoot]),$.when.apply($,n).then(r.resolve,r.reject)}else $(t).triggerHandler("projectRefresh",Pt.projectRoot),r.resolve();vt.addMeasurement(l)})}else console.log("error loading project"),G(Lt,!0,n||_t.NOT_FOUND,e).done(function(){Pt.projectRoot=null,S().done(function(e){T(e).always(function(){r.reject()})})})})}}),r.promise()}function D(){if(jt)Vt=!0;else{var e=Pt.refresh(),t=new $.Deferred;jt=t.promise(),jt.always(function(){jt=null,Vt&&(Vt=!1,D())}),window.setTimeout(function(){e.then(t.resolve,t.reject)},Bt)}return jt}function M(e){return Pt.showInTree(e).then(K)}function O(e){var t=new $.Deferred;return at.execute(st.FILE_CLOSE_ALL,{promptOnly:!0}).done(function(){e?T(e,!1).then(t.resolve,t.reject):mt.showOpenDialog(!1,!0,ht.CHOOSE_FOLDER,Pt.projectRoot.fullPath,null,function(e,n){e?(G(At,null,e),t.reject()):n.length>0?T(n[0]).then(t.resolve,t.reject):t.reject()})}).fail(function(){t.reject()}),t.promise()}function L(){return nt.showProjectPreferencesDialog(p()).getPromise()}function R(e,t,n,r){return"string"==typeof e?"/"!==Z.last(e)&&(e+="/"):e=e.fullPath,n?Pt.createAtPath(e+t,r):$t.startCreating(e,t,r)}function A(e){var t=new $.Deferred;return e.moveToTrash(function(n){n?(G(Mt,e.isDirectory,yt.getFileErrorString(n),e.fullPath),t.reject(n)):(it.notifyPathDeleted(e.fullPath),t.resolve())}),t.promise()}function N(e){return function(t){var n=dt.getLanguageForPath(t.fullPath).getId();return"string"==typeof e?n===e:-1!==e.indexOf(n)}}function P(){$t.performRename()}function F(e){Pt.setSelectionWidth(e),Y()}function U(e){var t,n="projectTreeState_";return 0===e.indexOf(n)?(t=e.substr(n.length),"user project.treeState "+t):(n="projectBaseUrl_",0===e.indexOf(n)?(t=e.substr(e.indexOf(" ")+1),t=t.substr(0,t.length-1),"user project.baseUrl "+t):null)}function j(){return Pt.getContext()}function V(e,t){var n,r;return void 0===t&&"function"!=typeof e&&(t=e,e=null),t&&(n=ot.getWorkingSet(ot.ALL_PANES)),r=new $.Deferred,Pt.getAllFiles(e,n).done(function(e){r.resolve(e)}).fail(function(e){e!==_t.TOO_MANY_ENTRIES||Ft||(G(Rt),Ft=!0),r.resolve([])}),r.promise()}function B(e){return St.addIconProvider(e)}function W(e){return St.addClassesProvider(e)}function H(){Y(!0)}e("utils/Global");var q,z,G,K,X,Y,Q,J,Z=e("thirdparty/lodash"),et=e("utils/AppInit"),tt=e("utils/Async"),nt=e("preferences/PreferencesDialogs"),rt=e("preferences/PreferencesManager"),it=e("document/DocumentManager"),ot=e("view/MainViewManager"),at=e("command/CommandManager"),st=e("command/Commands"),lt=e("widgets/Dialogs"),ct=e("widgets/DefaultDialogs"),ut=e("utils/DeprecationWarning"),dt=e("language/LanguageManager"),pt=e("command/Menus"),ft=e("utils/StringUtils"),ht=e("strings"),mt=e("filesystem/FileSystem"),gt=e("project/FileViewController"),vt=e("utils/PerfUtils"),yt=e("file/FileUtils"),_t=e("filesystem/FileSystemError"),bt=e("i18n!nls/urls"),Et=e("project/FileSyncManager"),wt=e("project/ProjectModel"),St=e("project/FileTreeView"),Ct=e("utils/ViewUtils"),It="."+rt.SETTINGS_FILENAME,kt="sortDirectoriesFirst",xt=1,Tt=2,Dt=3,Mt=4,Ot=5,Lt=6,Rt=7,At=8,Nt=9,Pt=new wt.ProjectModel({focused:r()}),Ft=!1;a.prototype._bindEvents=function(){this.model.on(wt.EVENT_CHANGE,function(){Y()}),this.model.on(wt.EVENT_SHOULD_SELECT,function(e,t){t.add?gt.openFileAndAddToWorkingSet(t.path).fail(Z.partial(o,t.previousPath,!t.hadFocus)):gt.openAndSelectDocument(t.path,gt.PROJECT_MANAGER).fail(Z.partial(o,t.previousPath,!t.hadFocus))}),this.model.on(wt.EVENT_SHOULD_FOCUS,function(){gt.setFileViewFocus(gt.PROJECT_MANAGER)}),this.model.on(wt.ERROR_CREATION,i)},a.prototype.setDirectoryOpen=function(e,t){this.model.setDirectoryOpen(e,t).then(K)},a.prototype.setSelected=function(e,t){this.model.setSelected(e,t)},a.prototype.selectInWorkingSet=function(e){this.model.selectInWorkingSet(e)},a.prototype.setContext=function(e){this.model.setContext(e)},a.prototype.restoreContext=function(){this.model.restoreContext()},a.prototype.startRename=function(e){X(e)},a.prototype.setRenameValue=function(e){this.model.setRenameValue(e)},a.prototype.cancelRename=function(){this.model.cancelRename()},a.prototype.performRename=function(){return this.model.performRename()},a.prototype.startCreating=function(e,t,n){return this.model.startCreating(e,t,n)},a.prototype.setSortDirectoriesFirst=function(e){this.model.setSortDirectoriesFirst(e)},a.prototype.setFocused=function(e){this.model.setFocused(e)},a.prototype.setCurrentFile=function(e){this.model.setCurrentFile(e)},a.prototype.toggleSubdirectories=function(e,t){this.model.toggleSubdirectories(e,t).then(K)},a.prototype.closeSubtree=function(e){this.model.closeSubtree(e),K()},a.prototype.refresh=function(){this.model.refresh()};var $t=new a(Pt),Ut=function(){rt.setViewState("projectPath",Pt.projectRoot.fullPath)};K=function(){var e=d(),t=Pt.getOpenNodes();rt.setViewState("project.treeState",t,e)},G=function(e,t,n,r){var i,o,a=t?ht.DIRECTORY_TITLE:ht.FILE_TITLE,s=t?ht.DIRECTORY:ht.FILE;switch(r=ft.breakableUrl(r),e){case xt:i=ft.format(ht.ERROR_CREATING_FILE_TITLE,a),o=ft.format(ht.ERROR_CREATING_FILE,s,r,n);break;case Tt:i=ft.format(ht.INVALID_FILENAME_TITLE,a),o=ft.format(ht.ENTRY_WITH_SAME_NAME_EXISTS,r);break;case Dt:i=ft.format(ht.ERROR_RENAMING_FILE_TITLE,a),o=ft.format(ht.ERROR_RENAMING_FILE,r,n,s);break;case Mt:i=ft.format(ht.ERROR_DELETING_FILE_TITLE,a),o=ft.format(ht.ERROR_DELETING_FILE,r,n,s);break;case Ot:i=ht.ERROR_LOADING_PROJECT,o=ft.format(ht.READ_DIRECTORY_ENTRIES_ERROR,r,n);break;case Lt:i=ht.ERROR_LOADING_PROJECT,o=ft.format(ht.REQUEST_NATIVE_FILE_SYSTEM_ERROR,r,n);break;case Rt:i=ht.ERROR_MAX_FILES_TITLE,o=ht.ERROR_MAX_FILES;break;case At:i=ht.ERROR_LOADING_PROJECT,o=ft.format(ht.OPEN_DIALOG_ERROR,n);break;case Nt:i=ft.format(ht.INVALID_FILENAME_TITLE,t?ht.DIRECTORY_NAME:ht.FILENAME),o=ft.format(ht.INVALID_FILENAME_MESSAGE,t?ht.DIRECTORY_NAMES_LEDE:ht.FILENAMES_LEDE,n)}return i&&o?lt.showModalDialog(ct.DIALOG_ID_ERROR,i,o):null},Y=function(e){var t=g();t&&(Pt.setScrollerInfo(Q[0].scrollWidth,Q.scrollTop(),Q.scrollLeft(),Q.offset().top),St.render(J,Pt._viewModel,t,$t,e,brackets.platform))};var jt=null,Vt=!1,Bt=1e3;q=function(e,t,n,r){Et.syncOpenDocuments(),Pt.handleFSEvent(t,n,r),r&&r.forEach(function(e){it.notifyPathDeleted(e.fullPath)})},z=function(e,t,n){it.notifyPathNameChanged(t,n)},et.htmlReady(function(){Q=$("#project-files-container"),Q.addClass("jstree jstree-brackets"),Q.css("overflow","auto"),Q.css("position","relative"),J=$("<div>").appendTo(Q)[0],Pt.setSelectionWidth(Q.width()),$(".main-view").click(function(e){e.target.classList.contains("jstree-rename-input")||(P(),$t.setContext(null))}),$("#working-set-list-container").on("contentChanged",function(){Q.trigger("contentChanged")}),$(pt.getContextMenu(pt.ContextMenuIds.PROJECT_MENU)).on("beforeContextMenuOpen",function(){$t.restoreContext()}),$(pt.getContextMenu(pt.ContextMenuIds.PROJECT_MENU)).on("beforeContextMenuClose",function(){Pt.setContext(null,!1,!0)}),Q.on("contextmenu",function(){P()}),$("#project-context-menu").on("click.dropdown-menu",function(){Pt.setContext(null,!0)}),Q.on("scroll",function(){$(".dropdown.open").length>0&&(pt.closeAll(),$t.setContext(null)),Y()}),Y(),Ct.addScrollerShadow(Q[0])}),rt.stateManager.definePreference("projectPath","string",_()),rt.convertPreferences(n,{projectPath:"user",projectTreeState_:"user",welcomeProjects:"user",projectBaseUrl_:"user"},!0,U),$(t).on("projectOpen",x),$(t).on("projectOpen",Ut),$(gt).on("documentSelectionFocusChange",c),$(gt).on("fileViewFocusChange",l),$(ot).on("currentFileChange",u),$(t).on("beforeAppClose",k),at.register(ht.CMD_OPEN_FOLDER,st.FILE_OPEN_FOLDER,O),at.register(ht.CMD_PROJECT_SETTINGS,st.FILE_PROJECT_SETTINGS,L),at.register(ht.CMD_FILE_REFRESH,st.FILE_REFRESH,D),rt.definePreference(kt,"boolean","mac"!==brackets.platform).on("change",function(){$t.setSortDirectoriesFirst(rt.get(kt))}),$t.setSortDirectoriesFirst(rt.get(kt)),X=function(e){var t=new $.Deferred;return Pt.startRename(e).done(function(){t.resolve()}).fail(function(e){window.setTimeout(function(){if(e.type===wt.ERROR_INVALID_FILENAME)G(Nt,e.isFolder,wt._invalidChars);else{var t=e.type===_t.ALREADY_EXISTS?ht.FILE_EXISTS_ERR:yt.getFileErrorString(e.type);G(Dt,e.isFolder,t,e.fullPath)}},10),t.reject(e)}),t.promise()},t._actionCreator=$t,t._setFileTreeSelectionWidth=F,t.getProjectRoot=g,t.getBaseUrl=p,t.setBaseUrl=f,t.isWithinProject=h,t.makeProjectRelativeIfPossible=m,t.shouldShow=wt.shouldShow,t.isBinaryFile=y,t.openProject=O,t.getSelectedItem=s,t.getContext=j,t.getInitialProjectPath=C,t.isWelcomeProjectPath=E,t.updateWelcomeProjectPath=w,t.createNewItem=R,t.renameItemInline=X,t.deleteItem=A,t.forceFinishRename=P,t.showInTree=M,t.refreshFileTree=D,t.getAllFiles=V,t.getLanguageFilter=N,t.addIconProvider=B,t.addClassesProvider=W,t.rerenderTree=H}),define("document/ChangedDocumentTracker",["require","exports","module","document/DocumentManager","project/ProjectManager"],function(e,t,n){function r(){var e=this;this._changedPaths={},this._windowFocus=!0,this._addListener=this._addListener.bind(this),this._removeListener=this._removeListener.bind(this),this._onChange=this._onChange.bind(this),this._onWindowFocus=this._onWindowFocus.bind(this),$(i).on("afterDocumentCreate",function(t,n){o.isWithinProject(n.file.fullPath)&&e._addListener(n)}),$(i).on("beforeDocumentDelete",function(t,n){e._removeListener(n)}),$(window).focus(this._onWindowFocus)}var i=e("document/DocumentManager"),o=e("project/ProjectManager");r.prototype._addListener=function(e){$(e).on("change",this._onChange)},r.prototype._removeListener=function(e){$(e).off("change",this._onChange)},r.prototype._onWindowFocus=function(){this._windowFocus=!0},r.prototype._onChange=function(e,t){this._changedPaths[t.file.fullPath]=!0},r.prototype.reset=function(){this._changedPaths={},this._windowFocus=!1},r.prototype.isPathChanged=function(e){return this._windowFocus||this._changedPaths[e]},r.prototype.getChangedPaths=function(){return $.makeArray(this._changedPaths)
25},n.exports=r}),define("language/JSUtils",["require","exports","module","thirdparty/lodash","thirdparty/CodeMirror2/lib/codemirror","utils/Async","document/DocumentManager","document/ChangedDocumentTracker","filesystem/FileSystem","file/FileUtils","utils/PerfUtils","utils/StringUtils"],function(e,t){function n(e){var t,n,r={};for(_.markStart(_.JSUTILS_REGEXP);null!==(n=w.exec(e));)t=(n[2]||n[5]).trim(),Array.isArray(r[t])||(r[t]=[]),r[t].push({offsetStart:n.index});return _.addMeasurement(_.JSUTILS_REGEXP),r}function r(e,t){function n(){if(i&&(u++,u>=d))return!1;s=u;var t=e.indexOf("\n",s);return-1===t&&(t=d),i=new f.StringStream(e.slice(u,t)),!0}function r(){if(u>=d)return!1;for(i&&(i.start=i.pos);!i||i.eol();)if(!n())return!1;return o=l.token(i,c),a=i.current(),u=s+i.pos,!0}for(var i,o,a,s,l=f.getMode({},"javascript"),c=f.startState(l),u=t,d=e.length,p=0,h=!1;r();)if("comment"!==o&&"regexp"!==o&&"string"!==o&&("{"===a?(h=!0,p++):"}"===a&&p--),h&&0>=p)return u;return d}function i(e,t,n,i){var o=e.getText(),a=b.getLines(o);n.forEach(function(n){n.offsetEnd||(_.markStart(_.JSUTILS_END_OFFSET),n.offsetEnd=r(o,n.offsetStart),n.lineStart=b.offsetToLineNum(a,n.offsetStart),n.lineEnd=b.offsetToLineNum(a,n.offsetEnd),_.addMeasurement(_.JSUTILS_END_OFFSET)),i.push({document:e,name:t,lineStart:n.lineStart,lineEnd:n.lineEnd})})}function o(e,t){m.getDocumentForPath(e.fullPath).done(function(r){var i=n(r.getText());e.JSUtils={},e.JSUtils.functions=i,e.JSUtils.timestamp=r.diskTimestamp,t.resolve({doc:r,functions:i})}).fail(function(e){t.reject(e)})}function a(e){var t=new $.Deferred,n=E.isPathChanged(e.fullPath);if(n&&e.JSUtils){var r=m.getOpenDocumentForPath(e.fullPath);if(r&&r.isDirty)t.resolve(!1);else{var i=v.getFileForPath(e.fullPath);i.stat(function(n,r){n?t.reject(n):t.resolve(e.JSUtils.timestamp.getTime()===r.mtime.getTime())})}}else t.resolve(!n&&e.JSUtils);return t.promise()}function s(e,t){var n=new $.Deferred,r=[],o=[];return e.forEach(function(e){if(p.has(e.functions,t)){var n=e.functions[t];r.push({doc:e.doc,fileInfo:e.fileInfo,functions:n})}}),h.doInParallel(r,function(e){var n=e.doc,r=new $.Deferred;return n?(i(n,t,e.functions,o),r.resolve()):m.getDocumentForPath(e.fileInfo.fullPath).done(function(n){i(n,t,e.functions,o)}).always(function(){r.resolve()}),r.promise()}).done(function(){n.resolve(o)}),n.promise()}function l(e){var t=new $.Deferred;return a(e).done(function(n){n?t.resolve({fileInfo:e,functions:e.JSUtils.functions}):o(e,t)}).fail(function(e){t.reject(e)}),t.promise()}function c(e){var t=new $.Deferred,n=[];return _.markStart(_.JSUTILS_GET_ALL_FUNCTIONS),h.doInParallel(e,function(e){var t=new $.Deferred;return l(e).done(function(e){n.push(e)}).always(function(){t.resolve()}),t.promise()}).always(function(){E.reset(),_.addMeasurement(_.JSUTILS_GET_ALL_FUNCTIONS),t.resolve(n)}),t.promise()}function u(e,t,n){var r=new $.Deferred,i=[];return i=n?t:t.filter(function(e){return"js"===y.getFileExtension(e.fullPath).toLowerCase()}),c(i).done(function(t){s(t,e).done(function(e){r.resolve(e)})}),r.promise()}function d(e,t){var i=n(e),o=[],a=e.split("\n");return p.forEach(i,function(n,i){(i===t||"*"===t)&&n.forEach(function(t){var n=r(e,t.offsetStart);o.push({name:i,lineStart:b.offsetToLineNum(a,t.offsetStart),lineEnd:b.offsetToLineNum(a,n)})})}),o}var p=e("thirdparty/lodash"),f=e("thirdparty/CodeMirror2/lib/codemirror"),h=e("utils/Async"),m=e("document/DocumentManager"),g=e("document/ChangedDocumentTracker"),v=e("filesystem/FileSystem"),y=e("file/FileUtils"),_=e("utils/PerfUtils"),b=e("utils/StringUtils"),E=new g,w=/(function\s+([$_A-Za-z\u007F-\uFFFF][$_A-Za-z0-9\u007F-\uFFFF]*)\s*(\([^)]*\)))|(([$_A-Za-z\u007F-\uFFFF][$_A-Za-z0-9\u007F-\uFFFF]*)\s*[:=]\s*function\s*(\([^)]*\)))/g;_.createPerfMeasurement("JSUTILS_GET_ALL_FUNCTIONS","Parallel file search across project"),_.createPerfMeasurement("JSUTILS_REGEXP","RegExp search for all functions"),_.createPerfMeasurement("JSUTILS_END_OFFSET","Find end offset for a single matched function"),t.findAllMatchingFunctionsInText=d,t._getFunctionEndOffset=r,t.findMatchingFunctions=u}),define("text!htmlContent/working-set.html",[],function(){return'<div class="working-set-view" id="{{id}}">\n <div class="working-set-header"><span class="working-set-header-title">{{WORKING_FILES}}</span></div>\n <div class="open-files-container">\n <!-- This will contain runtime-generated <li>\'s for each file in the working set -->\n <ul>\n </ul>\n </div>\n<div>'}),define("project/WorkingSetView",["require","exports","module","document/DocumentManager","view/MainViewManager","command/CommandManager","command/Commands","command/Menus","project/FileViewController","utils/ViewUtils","utils/KeyEvent","text!htmlContent/working-set.html","strings","thirdparty/lodash"],function(e,t){function n(e){k.forEach(x,function(t){var n=t.$openFilesContainer.scrollTop();e?t._rebuildViewList(!0):t._redraw(),t.$openFilesContainer.scrollTop(n)})}function r(){k.forEach(x,function(e){e.$openFilesContainer.triggerHandler("scroll")})}function i(e,t){var n=t&&$(e).data(L).fullPath===t.fullPath;w.toggleClass($(e),"selected",n)}function o(e){var t=g.getOpenDocumentForPath(e.fullPath);return t&&t.isDirty}function a(){return E.getFileSelectionFocus()===E.WORKING_SET_VIEW}function s(e){k.forEach(x,function(t){t.suppressSortRedraw=e})}function l(e){k.forEach(x,function(t){e?w.removeScrollerShadow(t.$openFilesContainer[0],null):t.$openFilesContainer[0].scrollHeight>t.$openFilesContainer[0].clientHeight&&w.addScrollerShadow(t.$openFilesContainer[0],null,!0)})}function c(e){k.forEach(x,function(t){e?t.$el.hasClass("active")&&(t.$el.removeClass("active").addClass("reactivate"),t.$openFilesList.trigger("selectionHide")):(t.$el.hasClass("reactivate")&&t.$el.removeClass("reactivate").addClass("active"),t._fireSelectionChanged(!1))})}function u(e){e.hasClass("working-set-view")||(e=e.parents(".working-set-view"));var t=e.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();return x[t]}function d(e){function t(){i&&(window.clearInterval(i),i=void 0)}function r(e,n,r,o){var a=e[0],s=a.scrollHeight-a.clientHeight;s&&r&&!i&&(i=window.setInterval(function(){var i=e.scrollTop();-1===r&&0>=i||1===r&&i>=s?t(n):(e.scrollTop(i+7*r),o(n))},50))}var i,o=e.data(L);e.mousedown(function(i){function d(e){Y=u(e.which)}function p(t){function n(e){var t=e.offset().top,n=e.height();return t+n/2>E}function r(e){var t=e.offset().top,n=h;return w>0&&(n+=m),t+T/2>=n}function i(e){var t=e.offset().top,n=h;return w>0&&(n+=m),n>=t+T/2}function o(e,t){var n=e.offset().top,r=t.offset().top;return n>=r+t.height()}function a(){return 0===d.length||o(d,M)}function s(){return d.is(".working-set-view")||d.is(".open-files-container")||d.is("ul")&&d.parent().is(".open-files-container")}function l(){return d.is(".working-set-header")||d.is(".working-set-header-title")||d.is(".scroller-shadow")||d.is(".scroller-shadow")}function c(e){return e.is(".working-set-view")?e:e.parents(".working-set-view")}var u,d,p,f,h,m,g,v,y,_,b,E=W.offset().top,w=t.pageY-k,S={where:R},C=0,I=!1,x=!1,D=!1,M=$("#working-set-list-container");if(t.pageX<0||t.pageX>M.width())return S;do W.hide(),d=$(window.document.elementFromPoint(t.pageX,E)),f=d.closest(".working-set-view"),p=d.closest("#working-set-list-container li"),W.show(),u=f.children(".open-files-container"),u.length&&(y=u.offset(),_={top:y.top-14,bottom:y.top+7},b={top:y.top+u.height()-7,bottom:y.top+u.height()+14}),p[0]===e[0]&&(w>0?(p=p.next(),p.length&&(E+=T)):(p=p.prev(),p.length&&(E-=T))),p.length||(E+=T);while(!p.length&&++C<2);if(0===p.length&&(d.is("a")||d.is("span"))&&(p=d.parents("#working-set-list-container li")),h=W.offset().top,m=W.height(),g=h+m,v=E-t.pageY,I=p.length&&u.length&&u[0].scrollHeight>u[0].clientHeight,x=I&&_&&(h>=_.top&&h<=_.bottom||g>=_.top&&g<=_.bottom),D=I&&b&&(h>=b.top&&h<=b.bottom||g>=b.top&&g<=b.bottom),p.length)x&&(0>=w||Q.where===F)?S={where:F,which:p}:D&&(w>=0||Q.where===U)?S={where:U,which:p}:r(p)?S={where:N,which:p}:i(p)&&(S={where:P,which:p});else if(e.parent()[0]!==d[0]){if(f=e.parents(".working-set-view"),l()){if(!(0>w))return S;if(i(d))return S}if(a())return S;if(s())return S=n(d)?{where:V,which:c(d)}:{where:j,which:c(d)};var O=f.prev(),L=f.next();0>w?O.length&&(S={where:j,which:O}):w>0?L.length&&(S={where:V,which:L}):S=n(f)?{where:V,which:f}:{where:j,which:f}}else S={where:A,which:d};return S}function f(){var e=Y.$openFilesContainer,t=e[0],n=t.scrollHeight-t.clientHeight;n&&e.scrollTop(n)}function h(){$("#working-set-list-container").removeClass("dragging"),$("#working-set-list-container .drag-show-as-selected").removeClass("drag-show-as-selected"),t(e),c(!1),window.onmousewheel=window.document.onmousewheel=null,$(window).off(".wsvdragging"),W.remove(),e.css("opacity",""),C&&0===e.next().length&&f()}function m(e){C&&(s(!1),l(!1)),e||n(!0),v.focusActivePane()}function g(){h(),H.paneId===Y.paneId&&X===e.index()?C?m(!0):D||i.which===O?y.execute(_.FILE_CLOSE,{file:o,paneId:H.paneId}).always(function(){m()}):(E.setFileViewFocus(E.WORKING_SET_VIEW),y.execute(_.FILE_OPEN,{fullPath:o.fullPath,paneId:Y.paneId}).always(function(){m()})):H.paneId===Y.paneId?(v._moveWorkingSetItem(H.paneId,X,e.index()),m()):v._moveView(H.paneId,Y.paneId,o,e.index()).always(function(){K?y.execute(_.FILE_OPEN,{fullPath:o.fullPath,paneId:Y.paneId}).always(function(){m()}):m()})}var w=0,C=!1,I=i.pageY,k=I,T=e.height(),D=$(i.target).hasClass("can-close"),L=e.offset(),B=e.clone(),W=$("<div class='open-files-container wsv-drag-ghost' style='overflow: hidden; display: inline-block;'>").append($("<ul>").append(B).css("padding","0")),H=u(e),q=v.getCurrentlyViewedFile(),z=v.getActivePaneId(),G=x[z],K=e.hasClass("selected")&&H.paneId===z,X=v.findInWorkingSet(H.paneId,o.fullPath),Y=H,Q={where:R};return $(window).on("mousemove.wsvdragging",function(n){function i(n){switch(C||(s(!0),l(!0),c(!0),$("#working-set-list-container").addClass("dragging"),K||E.getFileSelectionFocus()!==E.WORKING_SET_VIEW||$(G._findListItemFromFile(q)).addClass("drag-show-as-selected"),C=!0),w=0,Q=p(n),Q.where){case R:case j:case V:e.css({opacity:".75"}),W.css("opacity",".25");break;default:e.css({opacity:".0001"}),W.css("opacity","")}switch(Q.where){case F:case N:Q.where===F&&(w=-1),e.insertBefore(Q.which),d(Q);break;case U:case P:Q.where===U&&(w=1),e.insertAfter(Q.which),d(Q);break;case j:e.appendTo(Q.which.find("ul")),d(Q);break;case V:e.prependTo(Q.which.find("ul")),d(Q)}w?r(Y.$openFilesContainer,e,w,function(){i(n)}):t(e)}W.css("top",W.offset().top+(n.pageY-k)),(C||Math.abs(n.pageY-I)>3)&&i(n),k=n.pageY,n.stopPropagation()}),i.preventDefault(),$(window).on("mouseup.wsvdragging",function(){g()}),$(window).on("keydown.wsvdragging",function(e){e.keyCode===S.DOM_VK_ESCAPE&&(h(),m(),e.stopPropagation())}),window.onmousewheel=window.document.onmousewheel=function(e){e.preventDefault()},b.closeAll(),i.which!==M||i.ctrlKey&&"mac"===brackets.platform?void g():(K&&a()&&W.addClass("dragging-current-file"),W.css({top:L.top,left:L.left,width:e.width()+8}),W.appendTo($("body")),void i.stopPropagation())})}function p(e,t){var n="working-set-list-"+t;this.$header=null,this.$openFilesList=null,this.$container=e,this.$el=e.append(Mustache.render(C,k.extend({id:n},I))).find("#"+n),this.suppressSortRedraw=!1,this.paneId=t,this.init()}function f(e,t){var n=x[t];n||(n=new p(e,t),x[n.paneId]=n)}function h(e){e&&(T.push(e),n(!0))}function m(e){e&&(D.push(e),n(!0))}var g=e("document/DocumentManager"),v=e("view/MainViewManager"),y=e("command/CommandManager"),_=e("command/Commands"),b=e("command/Menus"),E=e("project/FileViewController"),w=e("utils/ViewUtils"),S=e("utils/KeyEvent"),C=e("text!htmlContent/working-set.html"),I=e("strings"),k=e("thirdparty/lodash"),x={},T=[],D=[],M=1,O=2,L="file",R="nomansland",A="nomoveitem",N="aboveitem",P="belowitem",F="topscroll",U="bottomscroll",j="belowview",V="aboveview";p.prototype._updateVisibility=function(){var e=v.getWorkingSet(this.paneId);1!==v.getPaneCount()||e&&0!==e.length?(this.$openFilesContainer.show(),this.$workingSetListViewHeader.show(),this._checkForDuplicatesInWorkingTree()):(this.$openFilesContainer.hide(),this.$workingSetListViewHeader.hide())},p.prototype._handlePaneLayoutChange=function(){var e=this.$el.find(".working-set-header-title"),t=I.WORKING_FILES;this._updateVisibility(),v.getPaneCount()>1&&(t=v.getPaneTitle(this.paneId)),e.text(t)},p.prototype._findListItemFromFile=function(e){var t=null;if(e){var n=this.$openFilesContainer.find("ul").children();n.each(function(){var n=$(this);return n.data(L).fullPath===e.fullPath?(t=n,!1):void 0})}return t},p.prototype._makeEventName=function(e){return e+".paneList"+this.paneId},p.prototype._scrollSelectedFileIntoView=function(){if(a()){var e=v.getCurrentlyViewedFile(this.paneId),t=this._findListItemFromFile(e);t&&w.scrollElementIntoView(this.$openFilesContainer,t,!1)}},p.prototype._fireSelectionChanged=function(e){var t=void 0===e||e===!0;t&&this._scrollSelectedFileIntoView(),a()&&this.$el.hasClass("active")?this.$openFilesList.trigger("selectionChanged",t):this.$openFilesList.trigger("selectionHide"),this.$openFilesContainer.trigger("contentChanged")},p.prototype._adjustForScrollbars=function(){this.$openFilesContainer[0].scrollHeight>this.$openFilesContainer[0].clientHeight?this.$openFilesContainer.hasClass("vertical-scroll")||this.$openFilesContainer.addClass("vertical-scroll"):this.$openFilesContainer.removeClass("vertical-scroll")},p.prototype._addDirectoryNamesToWorkingTreeFiles=function(e){if(!(e.length<=1)){var t=w.getDirNamesForDuplicateFiles(e);this.$openFilesContainer.find("ul > li").each(function(){var n=$(this),r=e.indexOf(n.data(L));if(-1!==r){var i=t[r].split("/");i.length>3&&(t[r]=i[0]+"/…/"+i[i.length-1]);var o=$("<span class='directory'/>").html(" &mdash; "+t[r]);n.children("a").append(o)}})}},p.prototype._checkForDuplicatesInWorkingTree=function(){var e=this,t={},n=v.getWorkingSet(v.ALL_PANES);this.$openFilesContainer.find("ul > li > a > span.directory").remove(),n.forEach(function(e){var n=w.getFileEntryDisplay(e);t[n]||(t[n]=[]),t[n].push(e)}),k.forEach(t,function(t){t.length>1&&e._addDirectoryNamesToWorkingTreeFiles(t)})},p.prototype._redraw=function(){this._updateViewState(),this._updateVisibility(),this._updateItemClasses(),this._adjustForScrollbars(),this._fireSelectionChanged()},p.prototype._handleActivePaneChange=function(){this._redraw()},p.prototype._updateFileStatusIcon=function(e,t,n){var r=e.find(".file-status-icon"),i=t||n;i||0===r.length?i&&0===r.length&&(r=$("<div class='file-status-icon'></div>").prependTo(e)):(r.remove(),r=null),r&&(w.toggleClass(r,"dirty",t),w.toggleClass(r,"can-close",n))},p.prototype._updateItemClasses=function(){D.length>0&&this.$openFilesContainer.find("ul > li").each(function(){var e=$(this),t=e.data(L),n={fullPath:t.fullPath,name:t.name,isFile:t.isFile};e.removeAttr("class"),D.forEach(function(t){e.addClass(t(n))})})},p.prototype._createNewListItem=function(e){var t=this,n=v.getCurrentlyViewedFile(this.paneId),r={fullPath:e.fullPath,name:e.name,isFile:e.isFile},a=$("<a href='#'></a>").html(w.getFileEntryDisplay(e));T.forEach(function(e){var t=e(r);t&&a.prepend($(t))});var s=$("<li></li>").append(a).data(L,e);this.$openFilesContainer.find("ul").append(s),D.forEach(function(e){s.addClass(e(r))}),this._updateFileStatusIcon(s,o(e),!1),i(s,n),d(s),s.hover(function(){t._updateFileStatusIcon($(this),o(e),!0)},function(){t._updateFileStatusIcon($(this),o(e),!1)})},p.prototype._rebuildViewList=function(e){var t=this,n=v.getWorkingSet(this.paneId);this.$openFilesContainer.find("ul").empty(),n.forEach(function(e){t._createNewListItem(e)}),e&&t._redraw()},p.prototype._updateViewState=function(){var e=v.getActivePaneId();a()&&e===this.paneId?(this.$el.addClass("active"),this.$openFilesContainer.addClass("active")):(this.$el.removeClass("active"),this.$openFilesContainer.removeClass("active"))},p.prototype._updateListSelection=function(){var e=v.getCurrentlyViewedFile(this.paneId);this._updateViewState(),this.$openFilesContainer.find("ul").children().each(function(){i(this,e)}),this._scrollSelectedFileIntoView(),this._fireSelectionChanged()},p.prototype._handleFileAdded=function(e,t,n,r){r===this.paneId?this._rebuildViewList(!0):this._checkForDuplicatesInWorkingTree()},p.prototype._handleFileListAdded=function(e,t,n){n===this.paneId?this._rebuildViewList(!0):this._checkForDuplicatesInWorkingTree()},p.prototype._handleFileRemoved=function(e,t,n,r){if(r===this.paneId){if(!n){var i=this._findListItemFromFile(t);if(i){var a=i.next();if(a&&a.length>0){var s=1===i.find(".can-close").length,l=o(a.data(L));this._updateFileStatusIcon(a,l,s)}i.remove()}this._redraw()}}else this._checkForDuplicatesInWorkingTree()},p.prototype._handleRemoveList=function(e,t,n){var r=this;n===this.paneId?(t.forEach(function(e){var t=r._findListItemFromFile(e);t&&t.remove()}),this._redraw()):this._checkForDuplicatesInWorkingTree()},p.prototype._handleWorkingSetSort=function(e,t){this.suppressSortRedraw||t!==this.paneId||this._rebuildViewList(!0)},p.prototype._handleDirtyFlagChanged=function(e,t){var n=this._findListItemFromFile(t.file);if(n){var r=1===$(n).find(".can-close").length;this._updateFileStatusIcon(n,t.isDirty,r)}},p.prototype._handleWorkingSetUpdate=function(e,t){this.paneId===t?this._rebuildViewList(!0):this._checkForDuplicatesInWorkingTree()},p.prototype.init=function(){this.$openFilesContainer=this.$el.find(".open-files-container"),this.$workingSetListViewHeader=this.$el.find(".working-set-header"),this.$openFilesList=this.$el.find("ul"),$(v).on(this._makeEventName("workingSetAdd"),k.bind(this._handleFileAdded,this)),$(v).on(this._makeEventName("workingSetAddList"),k.bind(this._handleFileListAdded,this)),$(v).on(this._makeEventName("workingSetRemove"),k.bind(this._handleFileRemoved,this)),$(v).on(this._makeEventName("workingSetRemoveList"),k.bind(this._handleRemoveList,this)),$(v).on(this._makeEventName("workingSetSort"),k.bind(this._handleWorkingSetSort,this)),$(v).on(this._makeEventName("activePaneChange"),k.bind(this._handleActivePaneChange,this)),$(v).on(this._makeEventName("paneLayoutChange"),k.bind(this._handlePaneLayoutChange,this)),$(v).on(this._makeEventName("workingSetUpdate"),k.bind(this._handleWorkingSetUpdate,this)),$(g).on(this._makeEventName("dirtyFlagChange"),k.bind(this._handleDirtyFlagChanged,this)),$(E).on(this._makeEventName("documentSelectionFocusChange")+" "+this._makeEventName("fileViewFocusChange"),k.bind(this._updateListSelection,this)),w.addScrollerShadow(this.$openFilesContainer[0],null,!0),w.sidebarList(this.$openFilesContainer),this.$openFilesContainer.css("overflow-x","hidden"),this.$openFilesContainer.on("contextmenu.workingSetView",function(e){b.getContextMenu(b.ContextMenuIds.WORKING_SET_CONTEXT_MENU).open(e)}),this._redraw()},p.prototype.destroy=function(){w.removeScrollerShadow(this.$openFilesContainer[0],null),this.$openFilesContainer.off(".workingSetView"),this.$el.remove(),$(v).off(this._makeEventName("")),$(g).off(this._makeEventName("")),$(E).off(this._makeEventName(""))},$(v).on("paneDestroy",function(e,t){var n=x[t];delete x[n.paneId],n.destroy()}),t.createWorkingSetViewForPane=f,t.refresh=n,t.addIconProvider=h,t.addClassProvider=m,t.syncSelectionIndicator=r}),define("text!LiveDevelopment/Inspector/Inspector.json",[],function(){return'{\n "version": { "major": "1", "minor": "0" },\n "domains": [{\n "domain": "Inspector",\n "hidden": true,\n "types": [],\n "commands": [\n {\n "name": "enable",\n "description": "Enables inspector domain notifications."\n },\n {\n "name": "disable",\n "description": "Disables inspector domain notifications."\n }\n ],\n "events": [\n {\n "name": "evaluateForTestInFrontend",\n "parameters": [\n { "name": "testCallId", "type": "integer" },\n { "name": "script", "type": "string" }\n ]\n },\n {\n "name": "inspect",\n "parameters": [\n { "name": "object", "$ref": "Runtime.RemoteObject" },\n { "name": "hints", "type": "object" }\n ]\n },\n {\n "name": "detached",\n "description": "Fired when remote debugging connection is about to be terminated. Contains detach reason.",\n "parameters": [\n { "name": "reason", "type": "string", "description": "The reason why connection has been terminated." }\n ]\n }\n ]\n },\n {\n "domain": "Memory",\n "hidden": true,\n "types": [\n {\n "id": "NodeCount",\n "type": "object",\n "properties": [\n { "name": "nodeName", "type": "string" },\n { "name": "count", "type": "integer" }\n ],\n "description": "Number of nodes with given name."\n },\n {\n "id": "ListenerCount",\n "type": "object",\n "properties": [\n { "name": "type", "type": "string" },\n { "name": "count", "type": "integer" }\n ],\n "description": "Number of JS event listeners by event type."\n },\n {\n "id": "StringStatistics",\n "type": "object",\n "properties": [\n { "name": "dom", "type": "integer" },\n { "name": "js", "type": "integer" },\n { "name": "shared", "type": "integer" }\n ],\n "description": "Character data statistics for the page."\n },\n {\n "id": "DOMGroup",\n "type": "object",\n "properties": [\n { "name": "size", "type": "integer" },\n { "name": "title", "type": "string" },\n { "name": "documentURI", "type": "string", "optional": true },\n { "name": "nodeCount", "type": "array", "items": { "$ref": "NodeCount" }},\n { "name": "listenerCount", "type": "array", "items": { "$ref": "ListenerCount" }}\n ]\n },\n {\n "id": "MemoryBlock",\n "type": "object",\n "properties": [\n { "name": "size", "type": "number", "optional": true, "description": "Size of the block in bytes if available" },\n { "name": "name", "type": "string", "description": "Unique name used to identify the component that allocated this block" },\n { "name": "children", "type": "array", "optional": true, "items": { "$ref": "MemoryBlock" }}\n ]\n },\n {\n "id": "HeapSnapshotChunk",\n "type": "object",\n "properties": [\n { "name": "strings", "type": "array", "items": { "type": "string" }, "description": "An array of strings that were found since last update." },\n { "name": "nodes", "type": "array", "items": { "type": "integer" }, "description": "An array of nodes that were found since last update." },\n { "name": "edges", "type": "array", "items": { "type": "integer" }, "description": "An array of edges that were found since last update." },\n { "name": "baseToRealNodeId", "type": "array", "items": { "type": "integer" }, "description": "An array of integers for nodeId remapping. Even nodeId has to be mapped to the following odd nodeId." }\n ]\n }\n ],\n "commands": [\n {\n "name": "getDOMNodeCount",\n "returns": [\n { "name": "domGroups", "type": "array", "items": { "$ref": "DOMGroup" }},\n { "name": "strings", "$ref": "StringStatistics" }\n ]\n },\n {\n "name": "getDOMCounters",\n "returns": [\n { "name": "documents", "type": "integer" },\n { "name": "nodes", "type": "integer" },\n { "name": "jsEventListeners", "type": "integer" }\n ]\n },\n {\n "name": "getProcessMemoryDistribution",\n "parameters": [\n { "name": "reportGraph", "type": "boolean", "optional": true, "description": "Whether native memory graph should be reported in addition to aggregated statistics." }\n ],\n "returns": [\n { "name": "distribution", "$ref": "MemoryBlock", "description": "An object describing all memory allocated by the process"}\n ]\n }\n ],\n "events": [\n {\n "name": "addNativeSnapshotChunk",\n "parameters": [\n { "name": "chunk", "$ref": "HeapSnapshotChunk", "description": "A chunk of the serialized the snapshot." }\n ]\n }\n ]\n },\n {\n "domain": "Page",\n "description": "Actions and events related to the inspected page belong to the page domain.",\n "types": [\n {\n "id": "ResourceType",\n "type": "string",\n "enum": ["Document", "Stylesheet", "Image", "Font", "Script", "XHR", "WebSocket", "Other"],\n "description": "Resource type as it was perceived by the rendering engine."\n },\n {\n "id": "Frame",\n "type": "object",\n "description": "Information about the Frame on the page.",\n "properties": [\n { "name": "id", "type": "string", "description": "Frame unique identifier." },\n { "name": "parentId", "type": "string", "optional": true, "description": "Parent frame identifier." },\n { "name": "loaderId", "$ref": "Network.LoaderId", "description": "Identifier of the loader associated with this frame." },\n { "name": "name", "type": "string", "optional": true, "description": "Frame\'s name as specified in the tag." },\n { "name": "url", "type": "string", "description": "Frame document\'s URL." },\n { "name": "securityOrigin", "type": "string", "optional": true, "description": "Frame document\'s security origin." },\n { "name": "mimeType", "type": "string", "description": "Frame document\'s mimeType as determined by the browser." }\n ],\n "hidden": true\n },\n {\n "id": "FrameResourceTree",\n "type": "object",\n "description": "Information about the Frame hierarchy along with their cached resources.",\n "properties": [\n { "name": "frame", "$ref": "Frame", "description": "Frame information for this tree item." },\n { "name": "childFrames", "type": "array", "optional": true, "items": { "$ref": "FrameResourceTree" }, "description": "Child frames." },\n { "name": "resources", "type": "array",\n "items": {\n "type": "object",\n "properties": [\n { "name": "url", "type": "string", "description": "Resource URL." },\n { "name": "type", "$ref": "ResourceType", "description": "Type of this resource." },\n { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },\n { "name": "failed", "type": "boolean", "optional": true, "description": "True if the resource failed to load." },\n { "name": "canceled", "type": "boolean", "optional": true, "description": "True if the resource was canceled during loading." }\n ]\n },\n "description": "Information about frame resources."\n }\n ],\n "hidden": true\n },\n {\n "id": "SearchMatch",\n "type": "object",\n "description": "Search match for resource.",\n "properties": [\n { "name": "lineNumber", "type": "number", "description": "Line number in resource content." },\n { "name": "lineContent", "type": "string", "description": "Line with match content." }\n ],\n "hidden": true\n },\n {\n "id": "SearchResult",\n "type": "object",\n "description": "Search result for resource.",\n "properties": [\n { "name": "url", "type": "string", "description": "Resource URL." },\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Resource frame id." },\n { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." }\n ],\n "hidden": true\n },\n {\n "id": "Cookie",\n "type": "object",\n "description": "Cookie object",\n "properties": [\n { "name": "name", "type": "string", "description": "Cookie name." },\n { "name": "value", "type": "string", "description": "Cookie value." },\n { "name": "domain", "type": "string", "description": "Cookie domain." },\n { "name": "path", "type": "string", "description": "Cookie path." },\n { "name": "expires", "type": "number", "description": "Cookie expires." },\n { "name": "size", "type": "integer", "description": "Cookie size." },\n { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." },\n { "name": "secure", "type": "boolean", "description": "True if cookie is secure." },\n { "name": "session", "type": "boolean", "description": "True in case of session cookie." }\n ],\n "hidden": true\n },\n {\n "id": "ScriptIdentifier",\n "type": "string",\n "description": "Unique script identifier.",\n "hidden": true\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables page domain notifications."\n },\n {\n "name": "disable",\n "description": "Disables page domain notifications."\n },\n {\n "name": "addScriptToEvaluateOnLoad",\n "parameters": [\n { "name": "scriptSource", "type": "string" }\n ],\n "returns": [\n { "name": "identifier", "$ref": "ScriptIdentifier", "description": "Identifier of the added script." }\n ],\n "hidden": true\n },\n {\n "name": "removeScriptToEvaluateOnLoad",\n "parameters": [\n { "name": "identifier", "$ref": "ScriptIdentifier" }\n ],\n "hidden": true\n },\n {\n "name": "reload",\n "parameters": [\n { "name": "ignoreCache", "type": "boolean", "optional": true, "description": "If true, browser cache is ignored (as if the user pressed Shift+refresh)." },\n { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." },\n { "name": "scriptPreprocessor", "type": "string", "optional": true, "description": "Script body that should evaluate to function that will preprocess all the scripts before their compilation.", "hidden": true }\n ],\n "description": "Reloads given page optionally ignoring the cache."\n },\n {\n "name": "navigate",\n "parameters": [\n { "name": "url", "type": "string", "description": "URL to navigate the page to." }\n ],\n "description": "Navigates current page to the given URL."\n },\n {\n "name": "getCookies",\n "returns": [\n { "name": "cookies", "type": "array", "items": { "$ref": "Cookie"}, "description": "Array of cookie objects." },\n { "name": "cookiesString", "type": "string", "description": "document.cookie string representation of the cookies." }\n ],\n "description": "Returns all browser cookies. Depending on the backend support, will either return detailed cookie information in the <code>cookie</code> field or string cookie representation using <code>cookieString</code>.",\n "hidden": true\n },\n {\n "name": "deleteCookie",\n "parameters": [\n { "name": "cookieName", "type": "string", "description": "Name of the cookie to remove." },\n { "name": "url", "type": "string", "description": "URL to match cooke domain and path." }\n ],\n "description": "Deletes browser cookie with given name, domain and path.",\n "hidden": true\n },\n {\n "name": "getResourceTree",\n "description": "Returns present frame / resource tree structure.",\n "returns": [\n { "name": "frameTree", "$ref": "FrameResourceTree", "description": "Present frame / resource tree structure." }\n ],\n "hidden": true\n },\n {\n "name": "getResourceContent",\n "description": "Returns content of the given resource.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to get resource for." },\n { "name": "url", "type": "string", "description": "URL of the resource to get content for." }\n ],\n "returns": [\n { "name": "content", "type": "string", "description": "Resource content." },\n { "name": "base64Encoded", "type": "boolean", "description": "True, if content was served as base64." }\n ],\n "hidden": true\n },\n {\n "name": "searchInResource",\n "description": "Searches for given string in resource content.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id for resource to search in." },\n { "name": "url", "type": "string", "description": "URL of the resource to search in." },\n { "name": "query", "type": "string", "description": "String to search for." },\n { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },\n { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }\n ],\n "returns": [\n { "name": "result", "type": "array", "items": { "$ref": "SearchMatch" }, "description": "List of search matches." }\n ],\n "hidden": true\n },\n {\n "name": "searchInResources",\n "description": "Searches for given string in frame / resource tree structure.",\n "parameters": [\n { "name": "text", "type": "string", "description": "String to search for." },\n { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },\n { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }\n ],\n "returns": [\n { "name": "result", "type": "array", "items": { "$ref": "SearchResult" }, "description": "List of search results." }\n ],\n "hidden": true\n },\n {\n "name": "setDocumentContent",\n "description": "Sets given markup as the document\'s HTML.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to set HTML for." },\n { "name": "html", "type": "string", "description": "HTML content to set." }\n ],\n "hidden": true\n },\n {\n "name": "canOverrideDeviceMetrics",\n "description": "Checks whether <code>setDeviceMetricsOverride</code> can be invoked.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "If true, <code>setDeviceMetricsOverride</code> can safely be invoked on the agent." }\n ],\n "hidden": true\n },\n {\n "name": "setDeviceMetricsOverride",\n "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \\"device-width\\"/\\"device-height\\"-related CSS media query results) and the font scale factor.",\n "parameters": [\n { "name": "width", "type": "integer", "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." },\n { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." },\n { "name": "fontScaleFactor", "type": "number", "description": "Overriding font scale factor value (must be positive). 1 disables the override." },\n { "name": "fitWindow", "type": "boolean", "description": "Whether a view that exceeds the available browser window area should be scaled down to fit." }\n ],\n "hidden": true\n },\n {\n "name": "setShowPaintRects",\n "description": "Requests that backend shows paint rectangles",\n "parameters": [\n { "name": "result", "type": "boolean", "description": "True for showing paint rectangles" }\n ],\n "hidden": true\n },\n {\n "name": "canShowDebugBorders",\n "description": "Tells if backend supports debug borders on layers",\n "returns": [\n { "name": "show", "type": "boolean", "description": "True if the debug borders can be shown" }\n ],\n "hidden": true\n },\n {\n "name": "setShowDebugBorders",\n "description": "Requests that backend shows debug borders on layers",\n "parameters": [\n { "name": "show", "type": "boolean", "description": "True for showing debug borders" }\n ],\n "hidden": true\n },\n {\n "name": "canShowFPSCounter",\n "description": "Tells if backend supports a FPS counter display",\n "returns": [\n { "name": "show", "type": "boolean", "description": "True if the FPS count can be shown" }\n ],\n "hidden": true\n },\n {\n "name": "setShowFPSCounter",\n "description": "Requests that backend shows the FPS counter",\n "parameters": [\n { "name": "show", "type": "boolean", "description": "True for showing the FPS counter" }\n ],\n "hidden": true\n },\n {\n "name": "canContinuouslyPaint",\n "description": "Tells if backend supports continuous painting",\n "returns": [\n { "name": "value", "type": "boolean", "description": "True if continuous painting is available" }\n ],\n "hidden": true\n },\n {\n "name": "setContinuousPaintingEnabled",\n "description": "Requests that backend enables continuous painting",\n "parameters": [\n { "name": "enabled", "type": "boolean", "description": "True for enabling cointinuous painting" }\n ],\n "hidden": true\n },\n {\n "name": "getScriptExecutionStatus",\n "description": "Determines if scripts can be executed in the page.",\n "returns": [\n { "name": "result", "type": "string", "enum": ["allowed", "disabled", "forbidden"], "description": "Script execution status: \\"allowed\\" if scripts can be executed, \\"disabled\\" if script execution has been disabled through page settings, \\"forbidden\\" if script execution for the given page is not possible for other reasons." }\n ]\n },\n {\n "name": "setScriptExecutionDisabled",\n "description": "Switches script execution in the page.",\n "parameters": [\n { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." }\n ]\n },\n {\n "name": "setGeolocationOverride",\n "description": "Overrides the Geolocation Position or Error.",\n "parameters": [\n { "name": "latitude", "type": "number", "optional": true, "description": "Mock longitude"},\n { "name": "longitude", "type": "number", "optional": true, "description": "Mock latitude"},\n { "name": "accuracy", "type": "number", "optional": true, "description": "Mock accuracy"}\n ],\n "hidden": true\n },\n {\n "name": "clearGeolocationOverride",\n "description": "Clears the overriden Geolocation Position and Error.",\n "hidden": true\n },\n {\n "name": "canOverrideGeolocation",\n "description": "Checks if Geolocation can be overridden.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if browser can ovrride Geolocation." }\n ],\n "hidden": true\n },\n {\n "name": "setDeviceOrientationOverride",\n "description": "Overrides the Device Orientation.",\n "parameters": [\n { "name": "alpha", "type": "number", "description": "Mock alpha"},\n { "name": "beta", "type": "number", "description": "Mock beta"},\n { "name": "gamma", "type": "number", "description": "Mock gamma"}\n ],\n "hidden": true\n },\n {\n "name": "clearDeviceOrientationOverride",\n "description": "Clears the overridden Device Orientation.",\n "hidden": true\n },\n {\n "name": "canOverrideDeviceOrientation",\n "description": "Check the backend if Web Inspector can override the device orientation.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "If true, <code>setDeviceOrientationOverride</code> can safely be invoked on the agent." }\n ],\n "hidden": true\n },\n {\n "name": "setTouchEmulationEnabled",\n "parameters": [\n { "name": "enabled", "type": "boolean", "description": "Whether the touch event emulation should be enabled." }\n ],\n "description": "Toggles mouse event-based touch event emulation.",\n "hidden": true\n },\n {\n "name": "setEmulatedMedia",\n "parameters": [\n { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." }\n ],\n "description": "Emulates the given media for CSS media queries.",\n "hidden": true\n },\n {\n "name": "getCompositingBordersVisible",\n "description": "Indicates the visibility of compositing borders.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "If true, compositing borders are visible." }\n ],\n "hidden": true\n },\n {\n "name": "setCompositingBordersVisible",\n "description": "Controls the visibility of compositing borders.",\n "parameters": [\n { "name": "visible", "type": "boolean", "description": "True for showing compositing borders." }\n ],\n "hidden": true\n },\n {\n "name": "captureScreenshot",\n "description": "Capture page screenshot.",\n "returns": [\n { "name": "data", "type": "string", "description": "Base64-encoded image data (PNG)." }\n ],\n "hidden": true\n },\n {\n "name": "handleJavaScriptDialog",\n "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",\n "parameters": [\n { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." }\n ],\n "hidden": true\n }\n ],\n "events": [\n {\n "name": "domContentEventFired",\n "parameters": [\n { "name": "timestamp", "type": "number" }\n ]\n },\n {\n "name": "loadEventFired",\n "parameters": [\n { "name": "timestamp", "type": "number" }\n ]\n },\n {\n "name": "frameNavigated",\n "description": "Fired once navigation of the frame has completed. Frame is now associated with the new loader.",\n "parameters": [\n { "name": "frame", "$ref": "Frame", "description": "Frame object." }\n ],\n "hidden": true\n },\n {\n "name": "frameDetached",\n "description": "Fired when frame has been detached from its parent.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." }\n ],\n "hidden": true\n },\n {\n "name": "frameStartedLoading",\n "description": "Fired when frame has started loading.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has started loading." }\n ],\n "hidden": true\n },\n {\n "name": "frameStoppedLoading",\n "description": "Fired when frame has stopped loading.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has stopped loading." }\n ],\n "hidden": true\n },\n {\n "name": "frameScheduledNavigation",\n "description": "Fired when frame schedules a potential navigation.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." },\n { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." }\n ],\n "hidden": true\n },\n {\n "name": "frameClearedScheduledNavigation",\n "description": "Fired when frame no longer has a scheduled navigation.",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }\n ],\n "hidden": true\n },\n {\n "name": "javascriptDialogOpening",\n "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.",\n "parameters": [\n { "name": "message", "type": "string", "description": "Message that will be displayed by the dialog." }\n ],\n "hidden": true\n },\n {\n "name": "javascriptDialogClosed",\n "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.",\n "hidden": true\n }\n ]\n },\n {\n "domain": "Runtime",\n "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",\n "types": [\n {\n "id": "RemoteObjectId",\n "type": "string",\n "description": "Unique object identifier."\n },\n {\n "id": "RemoteObject",\n "type": "object",\n "description": "Mirror object referencing original JavaScript object.",\n "properties": [\n { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },\n { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },\n { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },\n { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },\n { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },\n { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },\n { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containsing abbreviated property values.", "hidden": true }\n ]\n },\n {\n "id": "ObjectPreview",\n "type": "object",\n "hidden": true,\n "description": "Object containing abbreviated remote object value.",\n "properties": [\n { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },\n { "name": "overflow", "type": "boolean", "description": "True iff some of the properties of the original did not fit." },\n { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." }\n ]\n },\n {\n "id": "PropertyPreview",\n "type": "object",\n "hidden": true,\n "properties": [\n { "name": "name", "type": "string", "description": "Property name." },\n { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },\n { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },\n { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }\n ]\n },\n {\n "id": "PropertyDescriptor",\n "type": "object",\n "description": "Object property descriptor.",\n "properties": [\n { "name": "name", "type": "string", "description": "Property name." },\n { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },\n { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },\n { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },\n { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },\n { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },\n { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },\n { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },\n { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." }\n\n ]\n },\n {\n "id": "InternalPropertyDescriptor",\n "type": "object",\n "description": "Object internal property descriptor. This property isn\'t normally visible in JavaScript code.",\n "properties": [\n { "name": "name", "type": "string", "description": "Conventional property name." },\n { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }\n ]\n },\n {\n "id": "CallArgument",\n "type": "object",\n "description": "Represents function call argument. Either remote object id <code>objectId</code> or primitive <code>value</code> or neither of (for undefined) them should be specified.",\n "properties": [\n { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },\n { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }\n ]\n },\n {\n "id": "ExecutionContextId",\n "type": "integer",\n "description": "Id of an execution context.",\n "hidden": true\n },\n {\n "id": "ExecutionContextDescription",\n "type": "object",\n "description": "Description of an isolated world.",\n "properties": [\n { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },\n { "name": "isPageContext", "type": "boolean", "description": "True if this is a context where inpspected web page scripts run. False if it is a content script isolated context." },\n { "name": "name", "type": "string", "description": "Human readable name describing given context." },\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the owning frame." }\n ],\n "hidden": true\n }\n\n ],\n "commands": [\n {\n "name": "evaluate",\n "parameters": [\n { "name": "expression", "type": "string", "description": "Expression to evaluate." },\n { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },\n { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation.", "hidden": true },\n { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true },\n { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page.", "hidden": true },\n { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },\n { "name": "generatePreview", "type": "boolean", "optional": true, "hidden": true, "description": "Whether preview should be generated for the result." }\n ],\n "returns": [\n { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },\n { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }\n ],\n "description": "Evaluates expression on global object."\n },\n {\n "name": "callFunctionOn",\n "parameters": [\n { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },\n { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },\n { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },\n { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true },\n { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },\n { "name": "generatePreview", "type": "boolean", "optional": true, "hidden": true, "description": "Whether preview should be generated for the result." }\n ],\n "returns": [\n { "name": "result", "$ref": "RemoteObject", "description": "Call result." },\n { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }\n ],\n "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."\n },\n {\n "name": "getProperties",\n "parameters": [\n { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },\n { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." }\n ],\n "returns": [\n { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." },\n { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor"}, "description": "Internal object properties." }\n ],\n "description": "Returns properties of a given object. Object group of the result is inherited from the target object."\n },\n {\n "name": "releaseObject",\n "parameters": [\n { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }\n ],\n "description": "Releases remote object with given id."\n },\n {\n "name": "releaseObjectGroup",\n "parameters": [\n { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }\n ],\n "description": "Releases all remote objects that belong to a given group."\n },\n {\n "name": "run",\n "hidden": true,\n "description": "Tells inspected instance(worker or page) that it can run in case it was started paused."\n },\n {\n "name": "enable",\n "hidden": true,\n "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."\n },\n {\n "name": "disable",\n "hidden": true,\n "description": "Disables reporting of execution contexts creation."\n }\n ],\n "events": [\n {\n "name": "executionContextCreated",\n "parameters": [\n { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." }\n ],\n "hidden": true,\n "description": "Issued when new execution context is created."\n }\n ]\n },\n {\n "domain": "Console",\n "description": "Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the <a href=\'http://getfirebug.com/wiki/index.php/Console_API\'>JavaScript Console API</a>. One needs to enable this domain using <code>enable</code> command in order to start receiving the console messages. Browser collects messages issued while console domain is not enabled as well and reports them using <code>messageAdded</code> notification upon enabling.",\n "types": [\n {\n "id": "ConsoleMessage",\n "type": "object",\n "description": "Console message.",\n "properties": [\n { "name": "source", "type": "string", "enum": ["html", "wml", "xml", "javascript", "network", "console-api", "other"], "description": "Message source." },\n { "name": "level", "type": "string", "enum": ["tip", "log", "warning", "error", "debug"], "description": "Message severity." },\n { "name": "text", "type": "string", "description": "Message text." },\n { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing"], "description": "Console message type." },\n { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },\n { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message." },\n { "name": "repeatCount", "type": "integer", "optional": true, "description": "Repeat count for repeated messages." },\n { "name": "parameters", "type": "array", "items": { "$ref": "Runtime.RemoteObject" }, "optional": true, "description": "Message parameters in case of the formatted message." },\n { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace for assertions and error messages." },\n { "name": "networkRequestId", "$ref": "Network.RequestId", "optional": true, "description": "Identifier of the network request associated with this message." }\n ]\n },\n {\n "id": "CallFrame",\n "type": "object",\n "description": "Stack entry for console errors and assertions.",\n "properties": [\n { "name": "functionName", "type": "string", "description": "JavaScript function name." },\n { "name": "url", "type": "string", "description": "JavaScript script name or url." },\n { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number." },\n { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number." }\n ]\n },\n {\n "id": "StackTrace",\n "type": "array",\n "items": { "$ref": "CallFrame" },\n "description": "Call frames for assertions or error messages."\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."\n },\n {\n "name": "disable",\n "description": "Disables console domain, prevents further console messages from being reported to the client."\n },\n {\n "name": "clearMessages",\n "description": "Clears console messages collected in the browser."\n },\n {\n "name": "setMonitoringXHREnabled",\n "parameters": [\n { "name": "enabled", "type": "boolean", "description": "Monitoring enabled state." }\n ],\n "description": "Toggles monitoring of XMLHttpRequest. If <code>true</code>, console will receive messages upon each XHR issued.",\n "hidden": true\n },\n {\n "name": "addInspectedNode",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "DOM node id to be accessible by means of $x command line API." }\n ],\n "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).",\n "hidden": true\n },\n {\n "name": "addInspectedHeapObject",\n "parameters": [\n { "name": "heapObjectId", "type": "integer" }\n ]\n }\n ],\n "events": [\n {\n "name": "messageAdded",\n "parameters": [\n { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }\n ],\n "description": "Issued when new console message is added."\n },\n {\n "name": "messageRepeatCountUpdated",\n "parameters": [\n { "name": "count", "type": "integer", "description": "New repeat count value." }\n ],\n "description": "Issued when subsequent message(s) are equal to the previous one(s)."\n },\n {\n "name": "messagesCleared",\n "description": "Issued when console is cleared. This happens either upon <code>clearMessages</code> command or after page navigation."\n }\n ]\n },\n {\n "domain": "Network",\n "description": "Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.",\n "types": [\n {\n "id": "LoaderId",\n "type": "string",\n "description": "Unique loader identifier."\n },\n {\n "id": "FrameId",\n "type": "string",\n "description": "Unique frame identifier.",\n "hidden": true\n },\n {\n "id": "RequestId",\n "type": "string",\n "description": "Unique request identifier."\n },\n {\n "id": "Timestamp",\n "type": "number",\n "description": "Number of seconds since epoch."\n },\n {\n "id": "Headers",\n "type": "object",\n "description": "Request / response headers as keys / values of JSON object."\n },\n {\n "id": "ResourceTiming",\n "type": "object",\n "description": "Timing information for the request.",\n "properties": [\n { "name": "requestTime", "type": "number", "description": "Timing\'s requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime." },\n { "name": "proxyStart", "type": "number", "description": "Started resolving proxy." },\n { "name": "proxyEnd", "type": "number", "description": "Finished resolving proxy." },\n { "name": "dnsStart", "type": "number", "description": "Started DNS address resolve." },\n { "name": "dnsEnd", "type": "number", "description": "Finished DNS address resolve." },\n { "name": "connectStart", "type": "number", "description": "Started connecting to the remote host." },\n { "name": "connectEnd", "type": "number", "description": "Connected to the remote host." },\n { "name": "sslStart", "type": "number", "description": "Started SSL handshake." },\n { "name": "sslEnd", "type": "number", "description": "Finished SSL handshake." },\n { "name": "sendStart", "type": "number", "description": "Started sending request." },\n { "name": "sendEnd", "type": "number", "description": "Finished sending request." },\n { "name": "receiveHeadersEnd", "type": "number", "description": "Finished receiving response headers." }\n ]\n },\n {\n "id": "Request",\n "type": "object",\n "description": "HTTP request data.",\n "properties": [\n { "name": "url", "type": "string", "description": "Request URL." },\n { "name": "method", "type": "string", "description": "HTTP request method." },\n { "name": "headers", "$ref": "Headers", "description": "HTTP request headers." },\n { "name": "postData", "type": "string", "optional": true, "description": "HTTP POST request data." }\n ]\n },\n {\n "id": "Response",\n "type": "object",\n "description": "HTTP response data.",\n "properties": [\n { "name": "url", "type": "string", "description": "Response URL. This URL can be different from CachedResource.url in case of redirect." },\n { "name": "status", "type": "number", "description": "HTTP response status code." },\n { "name": "statusText", "type": "string", "description": "HTTP response status text." },\n { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." },\n { "name": "headersText", "type": "string", "optional": true, "description": "HTTP response headers text." },\n { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },\n { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },\n { "name": "requestHeadersText", "type": "string", "optional": true, "description": "HTTP request headers text." },\n { "name": "connectionReused", "type": "boolean", "description": "Specifies whether physical connection was actually reused for this request." },\n { "name": "connectionId", "type": "number", "description": "Physical connection id that was actually used for this request." },\n { "name": "fromDiskCache", "type": "boolean", "optional": true, "description": "Specifies that the request was served from the disk cache." },\n { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." }\n ]\n },\n {\n "id": "WebSocketRequest",\n "type": "object",\n "description": "WebSocket request data.",\n "hidden": true,\n "properties": [\n { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }\n ]\n },\n {\n "id": "WebSocketResponse",\n "type": "object",\n "description": "WebSocket response data.",\n "hidden": true,\n "properties": [\n { "name": "status", "type": "number", "description": "HTTP response status code." },\n { "name": "statusText", "type": "string", "description": "HTTP response status text." },\n { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }\n ]\n },\n {\n "id": "WebSocketFrame",\n "type": "object",\n "description": "WebSocket frame data.",\n "hidden": true,\n "properties": [\n { "name": "opcode", "type": "number", "description": "WebSocket frame opcode." },\n { "name": "mask", "type": "boolean", "description": "WebSocke frame mask." },\n { "name": "payloadData", "type": "string", "description": "WebSocke frame payload data." }\n ]\n },\n {\n "id": "CachedResource",\n "type": "object",\n "description": "Information about the cached resource.",\n "properties": [\n { "name": "url", "type": "string", "description": "Resource URL. This is the url of the original network request." },\n { "name": "type", "$ref": "Page.ResourceType", "description": "Type of this resource." },\n { "name": "response", "$ref": "Response", "optional": true, "description": "Cached response data." },\n { "name": "bodySize", "type": "number", "description": "Cached response body size." }\n ]\n },\n {\n "id": "Initiator",\n "type": "object",\n "description": "Information about the request initiator.",\n "properties": [\n { "name": "type", "type": "string", "enum": ["parser", "script", "other"], "description": "Type of this initiator." },\n { "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "Initiator JavaScript stack trace, set for Script only." },\n { "name": "url", "type": "string", "optional": true, "description": "Initiator URL, set for Parser type only." },\n { "name": "lineNumber", "type": "number", "optional": true, "description": "Initiator line number, set for Parser type only." }\n ]\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables network tracking, network events will now be delivered to the client."\n },\n {\n "name": "disable",\n "description": "Disables network tracking, prevents network events from being sent to the client."\n },\n {\n "name": "setUserAgentOverride",\n "description": "Allows overriding user agent with the given string.",\n "parameters": [\n { "name": "userAgent", "type": "string", "description": "User agent to use." }\n ]\n },\n {\n "name": "setExtraHTTPHeaders",\n "description": "Specifies whether to always send extra HTTP headers with the requests from this page.",\n "parameters": [\n { "name": "headers", "$ref": "Headers", "description": "Map with extra HTTP headers." }\n ]\n },\n {\n "name": "getResponseBody",\n "description": "Returns content served for the given request.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Identifier of the network request to get content for." }\n ],\n "returns": [\n { "name": "body", "type": "string", "description": "Response body." },\n { "name": "base64Encoded", "type": "boolean", "description": "True, if content was sent as base64." }\n ]\n },\n {\n "name": "replayXHR",\n "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Identifier of XHR to replay." }\n ],\n "hidden": true\n },\n {\n "name": "canClearBrowserCache",\n "description": "Tells whether clearing browser cache is supported.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if browser cache can be cleared." }\n ]\n },\n {\n "name": "clearBrowserCache",\n "description": "Clears browser cache."\n },\n {\n "name": "canClearBrowserCookies",\n "description": "Tells whether clearing browser cookies is supported.",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if browser cookies can be cleared." }\n ]\n },\n {\n "name": "clearBrowserCookies",\n "description": "Clears browser cookies."\n },\n {\n "name": "setCacheDisabled",\n "parameters": [\n { "name": "cacheDisabled", "type": "boolean", "description": "Cache disabled state." }\n ],\n "description": "Toggles ignoring cache for each request. If <code>true</code>, cache will not be used."\n }\n ],\n "events": [\n {\n "name": "requestWillBeSent",\n "description": "Fired when page is about to send HTTP request.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier.", "hidden": true },\n { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },\n { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },\n { "name": "request", "$ref": "Request", "description": "Request data." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },\n { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." }\n ]\n },\n {\n "name": "requestServedFromCache",\n "description": "Fired if request ended up loading from cache.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }\n ]\n },\n {\n "name": "responseReceived",\n "description": "Fired when HTTP response is available.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier.", "hidden": true },\n { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." },\n { "name": "response", "$ref": "Response", "description": "Response data." }\n ]\n },\n {\n "name": "dataReceived",\n "description": "Fired when data chunk was received over the network.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "dataLength", "type": "integer", "description": "Data chunk length." },\n { "name": "encodedDataLength", "type": "integer", "description": "Actual bytes received (might be less than dataLength for compressed encodings)." }\n ]\n },\n {\n "name": "loadingFinished",\n "description": "Fired when HTTP request has finished loading.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }\n ]\n },\n {\n "name": "loadingFailed",\n "description": "Fired when HTTP request has failed to load.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "errorText", "type": "string", "description": "User friendly error message." },\n { "name": "canceled", "type": "boolean", "optional": true, "description": "True if loading was canceled." }\n ]\n },\n {\n "name": "requestServedFromMemoryCache",\n "description": "Fired when HTTP request has been served from memory cache.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier.", "hidden": true },\n { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },\n { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },\n { "name": "resource", "$ref": "CachedResource", "description": "Cached resource data." }\n ]\n },\n {\n "name": "webSocketWillSendHandshakeRequest",\n "description": "Fired when WebSocket is about to initiate handshake.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "request", "$ref": "WebSocketRequest", "description": "WebSocket request data." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketHandshakeResponseReceived",\n "description": "Fired when WebSocket handshake response becomes available.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "response", "$ref": "WebSocketResponse", "description": "WebSocket response data." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketCreated",\n "description": "Fired upon WebSocket creation.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "url", "type": "string", "description": "WebSocket request URL." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketClosed",\n "description": "Fired when WebSocket is closed.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketFrameReceived",\n "description": "Fired when WebSocket frame is received.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketFrameError",\n "description": "Fired when WebSocket frame error occurs.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "errorMessage", "type": "string", "description": "WebSocket frame error message." }\n ],\n "hidden": true\n },\n {\n "name": "webSocketFrameSent",\n "description": "Fired when WebSocket frame is sent.",\n "parameters": [\n { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },\n { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },\n { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }\n ],\n "hidden": true\n }\n ]\n },\n {\n "domain": "Database",\n "hidden": true,\n "types": [\n {\n "id": "DatabaseId",\n "type": "string",\n "description": "Unique identifier of Database object.",\n "hidden": true\n },\n {\n "id": "Database",\n "type": "object",\n "description": "Database object.",\n "hidden": true,\n "properties": [\n { "name": "id", "$ref": "DatabaseId", "description": "Database ID." },\n { "name": "domain", "type": "string", "description": "Database domain." },\n { "name": "name", "type": "string", "description": "Database name." },\n { "name": "version", "type": "string", "description": "Database version." }\n ]\n },\n {\n "id": "Error",\n "type": "object",\n "description": "Database error.",\n "properties": [\n { "name": "message", "type": "string", "description": "Error message." },\n { "name": "code", "type": "integer", "description": "Error code." }\n ]\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables database tracking, database events will now be delivered to the client."\n },\n {\n "name": "disable",\n "description": "Disables database tracking, prevents database events from being sent to the client."\n },\n {\n "name": "getDatabaseTableNames",\n "parameters": [\n { "name": "databaseId", "$ref": "DatabaseId" }\n ],\n "returns": [\n { "name": "tableNames", "type": "array", "items": { "type": "string" } }\n ]\n },\n {\n "name": "executeSQL",\n "async": true,\n "parameters": [\n { "name": "databaseId", "$ref": "DatabaseId" },\n { "name": "query", "type": "string" }\n ],\n "returns": [\n { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } },\n { "name": "values", "type": "array", "optional": true, "items": { "type": "any" }},\n { "name": "sqlError", "$ref": "Error", "optional": true }\n ]\n }\n ],\n "events": [\n {\n "name": "addDatabase",\n "parameters": [\n { "name": "database", "$ref": "Database" }\n ]\n }\n ]\n },\n {\n "domain": "IndexedDB",\n "hidden": true,\n "types": [\n {\n "id": "SecurityOriginWithDatabaseNames",\n "type": "object",\n "description": "Security origin with database names.",\n "properties": [\n { "name": "securityOrigin", "type": "string", "description": "Security origin." },\n { "name": "databaseNames", "type": "array", "items": { "type": "string" }, "description": "Database names for this origin." }\n ]\n },\n {\n "id": "DatabaseWithObjectStores",\n "type": "object",\n "description": "Database with an array of object stores.",\n "properties": [\n { "name": "name", "type": "string", "description": "Database name." },\n { "name": "version", "type": "string", "description": "Deprecated string database version." },\n { "name": "intVersion", "type": "integer", "description": "Integer database version." },\n { "name": "objectStores", "type": "array", "items": { "$ref": "ObjectStore" }, "description": "Object stores in this database." }\n ]\n },\n {\n "id": "ObjectStore",\n "type": "object",\n "description": "Object store.",\n "properties": [\n { "name": "name", "type": "string", "description": "Object store name." },\n { "name": "keyPath", "$ref": "KeyPath", "description": "Object store key path." },\n { "name": "autoIncrement", "type": "boolean", "description": "If true, object store has auto increment flag set." },\n { "name": "indexes", "type": "array", "items": { "$ref": "ObjectStoreIndex" }, "description": "Indexes in this object store." }\n ]\n },\n {\n "id": "ObjectStoreIndex",\n "type": "object",\n "description": "Object store index.",\n "properties": [\n { "name": "name", "type": "string", "description": "Index name." },\n { "name": "keyPath", "$ref": "KeyPath", "description": "Index key path." },\n { "name": "unique", "type": "boolean", "description": "If true, index is unique." },\n { "name": "multiEntry", "type": "boolean", "description": "If true, index allows multiple entries for a key." }\n ]\n },\n {\n "id": "Key",\n "type": "object",\n "description": "Key.",\n "properties": [\n { "name": "type", "type": "string", "enum": ["number", "string", "date", "array"], "description": "Key type." },\n { "name": "number", "type": "number", "optional": true, "description": "Number value." },\n { "name": "string", "type": "string", "optional": true, "description": "String value." },\n { "name": "date", "type": "number", "optional": true, "description": "Date value." },\n { "name": "array", "type": "array", "optional": true, "items": { "$ref": "Key" }, "description": "Array value." }\n ]\n },\n {\n "id": "KeyRange",\n "type": "object",\n "description": "Key range.",\n "properties": [\n { "name": "lower", "$ref": "Key", "optional": true, "description": "Lower bound." },\n { "name": "upper", "$ref": "Key", "optional": true, "description": "Upper bound." },\n { "name": "lowerOpen", "type": "boolean", "description": "If true lower bound is open." },\n { "name": "upperOpen", "type": "boolean", "description": "If true upper bound is open." }\n ]\n },\n {\n "id": "DataEntry",\n "type": "object",\n "description": "Data entry.",\n "properties": [\n { "name": "key", "$ref": "Runtime.RemoteObject", "description": "Key." },\n { "name": "primaryKey", "$ref": "Runtime.RemoteObject", "description": "Primary key." },\n { "name": "value", "$ref": "Runtime.RemoteObject", "description": "Value." }\n ]\n },\n {\n "id": "KeyPath",\n "type": "object",\n "description": "Key path.",\n "properties": [\n { "name": "type", "type": "string", "enum": ["null", "string", "array"], "description": "Key path type." },\n { "name": "string", "type": "string", "optional": true, "description": "String value." },\n { "name": "array", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Array value." }\n ]\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables events from backend."\n },\n {\n "name": "disable",\n "description": "Disables events from backend."\n },\n {\n "name": "requestDatabaseNamesForFrame",\n "async": true,\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id." }\n ],\n "returns": [\n { "name": "securityOriginWithDatabaseNames", "$ref": "SecurityOriginWithDatabaseNames", "description": "Frame with database names." }\n ],\n "description": "Requests database names for given frame\'s security origin."\n },\n {\n "name": "requestDatabase",\n "async": true,\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id." },\n { "name": "databaseName", "type": "string", "description": "Database name." }\n ],\n "returns": [\n { "name": "databaseWithObjectStores", "$ref": "DatabaseWithObjectStores", "description": "Database with an array of object stores." }\n ],\n "description": "Requests database with given name in given frame."\n },\n {\n "name": "requestData",\n "async": true,\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id." },\n { "name": "databaseName", "type": "string", "description": "Database name." },\n { "name": "objectStoreName", "type": "string", "description": "Object store name." },\n { "name": "indexName", "type": "string", "description": "Index name, empty string for object store data requests." },\n { "name": "skipCount", "type": "integer", "description": "Number of records to skip." },\n { "name": "pageSize", "type": "integer", "description": "Number of records to fetch." },\n { "name": "keyRange", "$ref": "KeyRange", "optional": true, "description": "Key range." }\n ],\n "returns": [\n { "name": "objectStoreDataEntries", "type": "array", "items": { "$ref": "DataEntry" }, "description": "Array of object store data entries." },\n { "name": "hasMore", "type": "boolean", "description": "If true, there are more entries to fetch in the given range." }\n ],\n "description": "Requests data from object store or index."\n }\n ]\n },\n {\n "domain": "DOMStorage",\n "hidden": true,\n "types": [\n {\n "id": "StorageId",\n "type": "string",\n "description": "Unique identifier of DOM storage entry.",\n "hidden": true\n },\n {\n "id": "Entry",\n "type": "object",\n "description": "DOM Storage entry.",\n "hidden": true,\n "properties": [\n { "name": "origin", "type": "string", "description": "Document origin." },\n { "name": "isLocalStorage", "type": "boolean", "description": "True for local storage." },\n { "name": "id", "$ref": "StorageId", "description": "Entry id for further reference." }\n ]\n },\n {\n "id": "Item",\n "type": "array",\n "description": "DOM Storage item.",\n "hidden": true,\n "items": { "type": "string" }\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables storage tracking, storage events will now be delivered to the client."\n },\n {\n "name": "disable",\n "description": "Disables storage tracking, prevents storage events from being sent to the client."\n },\n {\n "name": "getDOMStorageEntries",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" }\n ],\n "returns": [\n { "name": "entries", "type": "array", "items": { "$ref": "Item" } }\n ]\n },\n {\n "name": "setDOMStorageItem",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" },\n { "name": "key", "type": "string" },\n { "name": "value", "type": "string" }\n ],\n "returns": [\n { "name": "success", "type": "boolean" }\n ]\n },\n {\n "name": "removeDOMStorageItem",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" },\n { "name": "key", "type": "string" }\n ],\n "returns": [\n { "name": "success", "type": "boolean" }\n ]\n }\n ],\n "events": [\n {\n "name": "addDOMStorage",\n "parameters": [\n { "name": "storage", "$ref": "Entry" }\n ]\n },\n {\n "name": "domStorageItemsCleared",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" }\n ]\n },\n {\n "name": "domStorageItemRemoved",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" },\n { "name": "key", "type": "string" }\n ]\n },\n {\n "name": "domStorageItemAdded",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" },\n { "name": "key", "type": "string" },\n { "name": "newValue", "type": "string" }\n ]\n },\n {\n "name": "domStorageItemUpdated",\n "parameters": [\n { "name": "storageId", "$ref": "StorageId" },\n { "name": "key", "type": "string" },\n { "name": "oldValue", "type": "string" },\n { "name": "newValue", "type": "string" }\n ]\n }\n ]\n },\n {\n "domain": "ApplicationCache",\n "hidden": true,\n "types": [\n {\n "id": "ApplicationCacheResource",\n "type": "object",\n "description": "Detailed application cache resource information.",\n "properties": [\n { "name": "url", "type": "string", "description": "Resource url." },\n { "name": "size", "type": "integer", "description": "Resource size." },\n { "name": "type", "type": "string", "description": "Resource type." }\n ]\n },\n {\n "id": "ApplicationCache",\n "type": "object",\n "description": "Detailed application cache information.",\n "properties": [\n { "name": "manifestURL", "type": "string", "description": "Manifest URL." },\n { "name": "size", "type": "number", "description": "Application cache size." },\n { "name": "creationTime", "type": "number", "description": "Application cache creation time." },\n { "name": "updateTime", "type": "number", "description": "Application cache update time." },\n { "name": "resources", "type": "array", "items": { "$ref": "ApplicationCacheResource" }, "description": "Application cache resources." }\n ]\n },\n {\n "id": "FrameWithManifest",\n "type": "object",\n "description": "Frame identifier - manifest URL pair.",\n "properties": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame identifier." },\n { "name": "manifestURL", "type": "string", "description": "Manifest URL." },\n { "name": "status", "type": "integer", "description": "Application cache status." }\n ]\n }\n ],\n "commands": [\n {\n "name": "getFramesWithManifests",\n "returns": [\n { "name": "frameIds", "type": "array", "items": { "$ref": "FrameWithManifest" }, "description": "Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache." }\n ],\n "description": "Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache."\n },\n {\n "name": "enable",\n "description": "Enables application cache domain notifications."\n },\n {\n "name": "getManifestForFrame",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing document whose manifest is retrieved." }\n ],\n "returns": [\n { "name": "manifestURL", "type": "string", "description": "Manifest URL for document in the given frame." }\n ],\n "description": "Returns manifest URL for document in the given frame."\n },\n {\n "name": "getApplicationCacheForFrame",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing document whose application cache is retrieved." }\n ],\n "returns": [\n { "name": "applicationCache", "$ref": "ApplicationCache", "description": "Relevant application cache data for the document in given frame." }\n ],\n "description": "Returns relevant application cache data for the document in given frame."\n }\n ],\n "events": [\n {\n "name": "applicationCacheStatusUpdated",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing document whose application cache updated status." },\n { "name": "manifestURL", "type": "string", "description": "Manifest URL." },\n { "name": "status", "type": "integer", "description": "Updated application cache status." }\n ]\n },\n {\n "name": "networkStateUpdated",\n "parameters": [\n { "name": "isNowOnline", "type": "boolean" }\n ]\n }\n ]\n },\n {\n "domain": "FileSystem",\n "hidden": true,\n "types": [\n {\n "id": "Entry",\n "type": "object",\n "properties": [\n { "name": "url", "type": "string", "description": "filesystem: URL for the entry." },\n { "name": "name", "type": "string", "description": "The name of the file or directory." },\n { "name": "isDirectory", "type": "boolean", "description": "True if the entry is a directory." },\n { "name": "mimeType", "type": "string", "optional": true, "description": "MIME type of the entry, available for a file only." },\n { "name": "resourceType", "$ref": "Page.ResourceType", "optional": true, "description": "ResourceType of the entry, available for a file only." },\n { "name": "isTextFile", "type": "boolean", "optional": true, "description": "True if the entry is a text file." }\n ],\n "description": "Represents a browser side file or directory."\n },\n {\n "id": "Metadata",\n "type": "object",\n "properties": [\n { "name": "modificationTime", "type": "number", "description": "Modification time." },\n { "name": "size", "type": "number", "description": "File size. This field is always zero for directories." }\n ],\n "description": "Represents metadata of a file or entry."\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables events from backend."\n },\n {\n "name": "disable",\n "description": "Disables events from backend."\n },\n {\n "name": "requestFileSystemRoot",\n "async": true,\n "parameters": [\n { "name": "origin", "type": "string", "description": "Security origin of requesting FileSystem. One of frames in current page needs to have this security origin." },\n { "name": "type", "type": "string", "enum": ["temporary", "persistent"], "description": "FileSystem type of requesting FileSystem." }\n ],\n "returns": [\n { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." },\n { "name": "root", "$ref": "Entry", "optional": true, "description": "Contains root of the requested FileSystem if the command completed successfully." }\n ],\n "description": "Returns root directory of the FileSystem, if exists."\n },\n {\n "name": "requestDirectoryContent",\n "async": true,\n "parameters": [\n { "name": "url", "type": "string", "description": "URL of the directory that the frontend is requesting to read from." }\n ],\n "returns": [\n { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." },\n { "name": "entries", "type": "array", "items": { "$ref": "Entry" }, "optional": true, "description": "Contains all entries on directory if the command completed successfully." }\n ],\n "description": "Returns content of the directory."\n },\n {\n "name": "requestMetadata",\n "async": true,\n "parameters": [\n { "name": "url", "type": "string", "description": "URL of the entry that the frontend is requesting to get metadata from." }\n ],\n "returns": [\n { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." },\n { "name": "metadata", "$ref": "Metadata", "optional": true, "description": "Contains metadata of the entry if the command completed successfully." }\n ],\n "description": "Returns metadata of the entry."\n },\n {\n "name": "requestFileContent",\n "async": true,\n "parameters": [\n { "name": "url", "type": "string", "description": "URL of the file that the frontend is requesting to read from." },\n { "name": "readAsText", "type": "boolean", "description": "True if the content should be read as text, otherwise the result will be returned as base64 encoded text." },\n { "name": "start", "type": "integer", "optional": true, "description": "Specifies the start of range to read." },\n { "name": "end", "type": "integer", "optional": true, "description": "Specifies the end of range to read exclusively." },\n { "name": "charset", "type": "string", "optional": true, "description": "Overrides charset of the content when content is served as text." }\n ],\n "returns": [\n { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." },\n { "name": "content", "type": "string", "optional": true, "description": "Content of the file." },\n { "name": "charset", "type": "string", "optional": true, "description": "Charset of the content if it is served as text." }\n ],\n "description": "Returns content of the file. Result should be sliced into [start, end)."\n },\n {\n "name": "deleteEntry",\n "async": true,\n "parameters": [\n { "name": "url", "type": "string", "description": "URL of the entry to delete." }\n ],\n "returns": [\n { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise errorCode is set to FileError::ErrorCode value." }\n ],\n "description": "Deletes specified entry. If the entry is a directory, the agent deletes children recursively."\n }\n ]\n },\n {\n "domain": "DOM",\n "description": "This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an <code>id</code>. This <code>id</code> can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client\'s responsibility to collect information about the nodes that were sent to the client.<p>Note that <code>iframe</code> owner elements will return corresponding document elements as their child nodes.</p>",\n "types": [\n {\n "id": "NodeId",\n "type": "integer",\n "description": "Unique DOM node identifier."\n },\n {\n "id": "Node",\n "type": "object",\n "properties": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Node identifier that is passed into the rest of the DOM messages as the <code>nodeId</code>. Backend will only push node with given <code>id</code> once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client." },\n { "name": "nodeType", "type": "integer", "description": "<code>Node</code>\'s nodeType." },\n { "name": "nodeName", "type": "string", "description": "<code>Node</code>\'s nodeName." },\n { "name": "localName", "type": "string", "description": "<code>Node</code>\'s localName." },\n { "name": "nodeValue", "type": "string", "description": "<code>Node</code>\'s nodeValue." },\n { "name": "childNodeCount", "type": "integer", "optional": true, "description": "Child count for <code>Container</code> nodes." },\n { "name": "children", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Child nodes of this node when requested with children." },\n { "name": "attributes", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Attributes of the <code>Element</code> node in the form of flat array <code>[name1, value1, name2, value2]</code>." },\n { "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that <code>Document</code> or <code>FrameOwner</code> node points to." },\n { "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that <code>Document</code> or <code>FrameOwner</code> node uses for URL completion." },\n { "name": "publicId", "type": "string", "optional": true, "description": "<code>DocumentType</code>\'s publicId." },\n { "name": "systemId", "type": "string", "optional": true, "description": "<code>DocumentType</code>\'s systemId." },\n { "name": "internalSubset", "type": "string", "optional": true, "description": "<code>DocumentType</code>\'s internalSubset." },\n { "name": "xmlVersion", "type": "string", "optional": true, "description": "<code>Document</code>\'s XML version in case of XML documents." },\n { "name": "name", "type": "string", "optional": true, "description": "<code>Attr</code>\'s name." },\n { "name": "value", "type": "string", "optional": true, "description": "<code>Attr</code>\'s value." },\n { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Frame ID for frame owner elements." },\n { "name": "contentDocument", "$ref": "Node", "optional": true, "description": "Content document for frame owner elements." },\n { "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." },\n { "name": "templateContent", "$ref": "Node", "optional": true, "description": "Content document fragment for template elements" }\n ],\n "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type."\n },\n {\n "id": "EventListener",\n "type": "object",\n "hidden": true,\n "properties": [\n { "name": "type", "type": "string", "description": "<code>EventListener</code>\'s type." },\n { "name": "useCapture", "type": "boolean", "description": "<code>EventListener</code>\'s useCapture." },\n { "name": "isAttribute", "type": "boolean", "description": "<code>EventListener</code>\'s isAttribute." },\n { "name": "nodeId", "$ref": "NodeId", "description": "Target <code>DOMNode</code> id." },\n { "name": "handlerBody", "type": "string", "description": "Event handler function body." },\n { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." },\n { "name": "sourceName", "type": "string", "optional": true, "description": "Source script URL." }\n ],\n "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type."\n },\n {\n "id": "RGBA",\n "type": "object",\n "properties": [\n { "name": "r", "type": "integer", "description": "The red component, in the [0-255] range." },\n { "name": "g", "type": "integer", "description": "The green component, in the [0-255] range." },\n { "name": "b", "type": "integer", "description": "The blue component, in the [0-255] range." },\n { "name": "a", "type": "number", "optional": true, "description": "The alpha component, in the [0-1] range (default: 1)." }\n ],\n "description": "A structure holding an RGBA color."\n },\n {\n "id": "HighlightConfig",\n "type": "object",\n "properties": [\n { "name": "showInfo", "type": "boolean", "optional": true, "description": "Whether the node info tooltip should be shown (default: false)." },\n { "name": "contentColor", "$ref": "RGBA", "optional": true, "description": "The content box highlight fill color (default: transparent)." },\n { "name": "paddingColor", "$ref": "RGBA", "optional": true, "description": "The padding highlight fill color (default: transparent)." },\n { "name": "borderColor", "$ref": "RGBA", "optional": true, "description": "The border highlight fill color (default: transparent)." },\n { "name": "marginColor", "$ref": "RGBA", "optional": true, "description": "The margin highlight fill color (default: transparent)." }\n ],\n "description": "Configuration data for the highlighting of page elements."\n }\n ],\n "commands": [\n {\n "name": "getDocument",\n "returns": [\n { "name": "root", "$ref": "Node", "description": "Resulting node." }\n ],\n "description": "Returns the root DOM node to the caller."\n },\n {\n "name": "requestChildNodes",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get children for." },\n { "name": "depth", "type": "integer", "optional": true, "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." }\n ],\n "description": "Requests that children of the node with given id are returned to the caller in form of <code>setChildNodes</code> events where not only immediate children are retrieved, but all children down to the specified depth."\n },\n {\n "name": "querySelector",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to query upon." },\n { "name": "selector", "type": "string", "description": "Selector string." }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Query selector result." }\n ],\n "description": "Executes <code>querySelector</code> on a given node."\n },\n {\n "name": "querySelectorAll",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to query upon." },\n { "name": "selector", "type": "string", "description": "Selector string." }\n ],\n "returns": [\n { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" }, "description": "Query selector result." }\n ],\n "description": "Executes <code>querySelectorAll</code> on a given node."\n },\n {\n "name": "setNodeName",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to set name for." },\n { "name": "name", "type": "string", "description": "New node\'s name." }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "NodeId", "description": "New node\'s id." }\n ],\n "description": "Sets node name for a node with given id."\n },\n {\n "name": "setNodeValue",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to set value for." },\n { "name": "value", "type": "string", "description": "New node\'s value." }\n ],\n "description": "Sets node value for a node with given id."\n },\n {\n "name": "removeNode",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to remove." }\n ],\n "description": "Removes node with given id."\n },\n {\n "name": "setAttributeValue",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the element to set attribute for." },\n { "name": "name", "type": "string", "description": "Attribute name." },\n { "name": "value", "type": "string", "description": "Attribute value." }\n ],\n "description": "Sets attribute for an element with given id."\n },\n {\n "name": "setAttributesAsText",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the element to set attributes for." },\n { "name": "text", "type": "string", "description": "Text with a number of attributes. Will parse this text using HTML parser." },\n { "name": "name", "type": "string", "optional": true, "description": "Attribute name to replace with new attributes derived from text in case text parsed successfully." }\n ],\n "description": "Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs."\n },\n {\n "name": "removeAttribute",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the element to remove attribute from." },\n { "name": "name", "type": "string", "description": "Name of the attribute to remove." }\n ],\n "description": "Removes attribute with given name from an element with given id."\n },\n {\n "name": "getEventListenersForNode",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get listeners for." }\n ],\n "returns": [\n { "name": "listeners", "type": "array", "items": { "$ref": "EventListener"}, "description": "Array of relevant listeners." }\n ],\n "description": "Returns event listeners relevant to the node.",\n "hidden": true\n },\n {\n "name": "getOuterHTML",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get markup for." }\n ],\n "returns": [\n { "name": "outerHTML", "type": "string", "description": "Outer HTML markup." }\n ],\n "description": "Returns node\'s HTML markup."\n },\n {\n "name": "setOuterHTML",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to set markup for." },\n { "name": "outerHTML", "type": "string", "description": "Outer HTML markup to set." }\n ],\n "description": "Sets node HTML markup, returns new node id."\n },\n {\n "name": "performSearch",\n "parameters": [\n { "name": "query", "type": "string", "description": "Plain text or query selector or XPath search query." }\n ],\n "returns": [\n { "name": "searchId", "type": "string", "description": "Unique search session identifier." },\n { "name": "resultCount", "type": "integer", "description": "Number of search results." }\n ],\n "description": "Searches for a given string in the DOM tree. Use <code>getSearchResults</code> to access search results or <code>cancelSearch</code> to end this search session.",\n "hidden": true\n },\n {\n "name": "getSearchResults",\n "parameters": [\n { "name": "searchId", "type": "string", "description": "Unique search session identifier." },\n { "name": "fromIndex", "type": "integer", "description": "Start index of the search result to be returned." },\n { "name": "toIndex", "type": "integer", "description": "End index of the search result to be returned." }\n ],\n "returns": [\n { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" }, "description": "Ids of the search result nodes." }\n ],\n "description": "Returns search results from given <code>fromIndex</code> to given <code>toIndex</code> from the sarch with the given identifier.",\n "hidden": true\n },\n {\n "name": "discardSearchResults",\n "parameters": [\n { "name": "searchId", "type": "string", "description": "Unique search session identifier." }\n ],\n "description": "Discards search results from the session with the given id. <code>getSearchResults</code> should no longer be called for that search.",\n "hidden": true\n },\n {\n "name": "requestNode",\n "parameters": [\n { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "JavaScript object id to convert into node." }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Node id for given object." }\n ],\n "description": "Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of <code>setChildNodes</code> notifications."\n },\n {\n "name": "setInspectModeEnabled",\n "hidden": true,\n "parameters": [\n { "name": "enabled", "type": "boolean", "description": "True to enable inspection mode, false to disable it." },\n { "name": "highlightConfig", "$ref": "HighlightConfig", "optional": true, "description": "A descriptor for the highlight appearance of hovered-over nodes. May be omitted if <code>enabled == false</code>." }\n ],\n "description": "Enters the \'inspect\' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates \'inspect\' command upon element selection."\n },\n {\n "name": "highlightRect",\n "parameters": [\n { "name": "x", "type": "integer", "description": "X coordinate" },\n { "name": "y", "type": "integer", "description": "Y coordinate" },\n { "name": "width", "type": "integer", "description": "Rectangle width" },\n { "name": "height", "type": "integer", "description": "Rectangle height" },\n { "name": "color", "$ref": "RGBA", "optional": true, "description": "The highlight fill color (default: transparent)." },\n { "name": "outlineColor", "$ref": "RGBA", "optional": true, "description": "The highlight outline color (default: transparent)." }\n ],\n "description": "Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport."\n },\n {\n "name": "highlightNode",\n "parameters": [\n { "name": "highlightConfig", "$ref": "HighlightConfig", "description": "A descriptor for the highlight appearance." },\n { "name": "nodeId", "$ref": "NodeId", "optional": true, "description": "Identifier of the node to highlight." },\n { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "JavaScript object id of the node to be highlighted." }\n ],\n "description": "Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified."\n },\n {\n "name": "hideHighlight",\n "description": "Hides DOM node highlight."\n },\n {\n "name": "highlightFrame",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame to highlight." },\n { "name": "contentColor", "$ref": "RGBA", "optional": true, "description": "The content box highlight fill color (default: transparent)." },\n { "name": "contentOutlineColor", "$ref": "RGBA", "optional": true, "description": "The content box highlight outline color (default: transparent)." }\n ],\n "description": "Highlights owner element of the frame with given id.",\n "hidden": true\n },\n {\n "name": "pushNodeByPathToFrontend",\n "parameters": [\n { "name": "path", "type": "string", "description": "Path to node in the proprietary format." }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node for given path." }\n ],\n "description": "Requests that the node is sent to the caller given its path. // FIXME, use XPath",\n "hidden": true\n },\n {\n "name": "resolveNode",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to resolve." },\n { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }\n ],\n "returns": [\n { "name": "object", "$ref": "Runtime.RemoteObject", "description": "JavaScript object wrapper for given node." }\n ],\n "description": "Resolves JavaScript node object for given node id."\n },\n {\n "name": "getAttributes",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to retrieve attibutes for." }\n ],\n "returns": [\n { "name": "attributes", "type": "array", "items": { "type": "string" }, "description": "An interleaved array of node attribute names and values." }\n ],\n "description": "Returns attributes for the specified node."\n },\n {\n "name": "moveTo",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to drop." },\n { "name": "targetNodeId", "$ref": "NodeId", "description": "Id of the element to drop into." },\n { "name": "insertBeforeNodeId", "$ref": "NodeId", "optional": true, "description": "Drop node before given one." }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "NodeId", "description": "New id of the moved node." }\n ],\n "description": "Moves node into the new container, places it before the given anchor."\n },\n {\n "name": "undo",\n "description": "Undoes the last performed action.",\n "hidden": true\n },\n {\n "name": "redo",\n "description": "Re-does the last undone action.",\n "hidden": true\n },\n {\n "name": "markUndoableState",\n "description": "Marks last undoable state.",\n "hidden": true\n },\n {\n "name": "focus",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Id of the node to focus." }\n ],\n "description": "Focuses the given element.",\n "hidden": true\n }\n ],\n "events": [\n {\n "name": "documentUpdated",\n "description": "Fired when <code>Document</code> has been totally updated. Node ids are no longer valid."\n },\n {\n "name": "setChildNodes",\n "parameters": [\n { "name": "parentId", "$ref": "NodeId", "description": "Parent node id to populate with children." },\n { "name": "nodes", "type": "array", "items": { "$ref": "Node"}, "description": "Child nodes array." }\n ],\n "description": "Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids."\n },\n {\n "name": "attributeModified",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has changed." },\n { "name": "name", "type": "string", "description": "Attribute name." },\n { "name": "value", "type": "string", "description": "Attribute value." }\n ],\n "description": "Fired when <code>Element</code>\'s attribute is modified."\n },\n {\n "name": "attributeRemoved",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has changed." },\n { "name": "name", "type": "string", "description": "A ttribute name." }\n ],\n "description": "Fired when <code>Element</code>\'s attribute is removed."\n },\n {\n "name": "inlineStyleInvalidated",\n "parameters": [\n { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" }, "description": "Ids of the nodes for which the inline styles have been invalidated." }\n ],\n "description": "Fired when <code>Element</code>\'s inline style is modified via a CSS property modification.",\n "hidden": true\n },\n {\n "name": "characterDataModified",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has changed." },\n { "name": "characterData", "type": "string", "description": "New text value." }\n ],\n "description": "Mirrors <code>DOMCharacterDataModified</code> event."\n },\n {\n "name": "childNodeCountUpdated",\n "parameters": [\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has changed." },\n { "name": "childNodeCount", "type": "integer", "description": "New node count." }\n ],\n "description": "Fired when <code>Container</code>\'s child node count has changed."\n },\n {\n "name": "childNodeInserted",\n "parameters": [\n { "name": "parentNodeId", "$ref": "NodeId", "description": "Id of the node that has changed." },\n { "name": "previousNodeId", "$ref": "NodeId", "description": "If of the previous siblint." },\n { "name": "node", "$ref": "Node", "description": "Inserted node data." }\n ],\n "description": "Mirrors <code>DOMNodeInserted</code> event."\n },\n {\n "name": "childNodeRemoved",\n "parameters": [\n { "name": "parentNodeId", "$ref": "NodeId", "description": "Parent id." },\n { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has been removed." }\n ],\n "description": "Mirrors <code>DOMNodeRemoved</code> event."\n },\n {\n "name": "shadowRootPushed",\n "parameters": [\n { "name": "hostId", "$ref": "NodeId", "description": "Host element id." },\n { "name": "root", "$ref": "Node", "description": "Shadow root." }\n ],\n "description": "Called when shadow root is pushed into the element.",\n "hidden": true\n },\n {\n "name": "shadowRootPopped",\n "parameters": [\n { "name": "hostId", "$ref": "NodeId", "description": "Host element id." },\n { "name": "rootId", "$ref": "NodeId", "description": "Shadow root id." }\n ],\n "description": "Called when shadow root is popped from the element.",\n "hidden": true\n }\n ]\n },\n {\n "domain": "CSS",\n "hidden": true,\n "description": "This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated <code>id</code> used in subsequent operations on the related object. Each object type has a specific <code>id</code> structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the <code>get*ForNode()</code> calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the <code>getAllStyleSheets()</code> method and subsequently load the required stylesheet contents using the <code>getStyleSheet[Text]()</code> methods.",\n "types": [\n {\n "id": "StyleSheetId",\n "type": "string"\n },\n {\n "id": "CSSStyleId",\n "type": "object",\n "properties": [\n { "name": "styleSheetId", "$ref": "StyleSheetId", "description": "Enclosing stylesheet identifier." },\n { "name": "ordinal", "type": "integer", "description": "The style ordinal within the stylesheet." }\n ],\n "description": "This object identifies a CSS style in a unique way."\n },\n {\n "id": "StyleSheetOrigin",\n "type": "string",\n "enum": ["user", "user-agent", "inspector", "regular"],\n "description": "Stylesheet type: \\"user\\" for user stylesheets, \\"user-agent\\" for user-agent stylesheets, \\"inspector\\" for stylesheets created by the inspector (i.e. those holding the \\"via inspector\\" rules), \\"regular\\" for regular stylesheets."\n },\n {\n "id": "CSSRuleId",\n "type": "object",\n "properties": [\n { "name": "styleSheetId", "$ref": "StyleSheetId", "description": "Enclosing stylesheet identifier." },\n { "name": "ordinal", "type": "integer", "description": "The rule ordinal within the stylesheet." }\n ],\n "description": "This object identifies a CSS rule in a unique way."\n },\n {\n "id": "PseudoIdMatches",\n "type": "object",\n "properties": [\n { "name": "pseudoId", "type": "integer", "description": "Pseudo style identifier (see <code>enum PseudoId</code> in <code>RenderStyleConstants.h</code>)."},\n { "name": "matches", "type": "array", "items": { "$ref": "RuleMatch" }, "description": "Matches of CSS rules applicable to the pseudo style."}\n ],\n "description": "CSS rule collection for a single pseudo style."\n },\n {\n "id": "InheritedStyleEntry",\n "type": "object",\n "properties": [\n { "name": "inlineStyle", "$ref": "CSSStyle", "optional": true, "description": "The ancestor node\'s inline style, if any, in the style inheritance chain." },\n { "name": "matchedCSSRules", "type": "array", "items": { "$ref": "RuleMatch" }, "description": "Matches of CSS rules matching the ancestor node in the style inheritance chain." }\n ],\n "description": "CSS rule collection for a single pseudo style."\n },\n {\n "id": "RuleMatch",\n "type": "object",\n "properties": [\n { "name": "rule", "$ref": "CSSRule", "description": "CSS rule in the match." },\n { "name": "matchingSelectors", "type": "array", "items": { "type": "integer" }, "description": "Matching selector indices in the rule\'s selectorList selectors (0-based)." }\n ],\n "description": "Match data for a CSS rule."\n },\n {\n "id": "SelectorList",\n "type": "object",\n "properties": [\n { "name": "selectors", "type": "array", "items": { "type": "string" }, "description": "Selectors in the list." },\n { "name": "text", "type": "string", "description": "Rule selector text." },\n { "name": "range", "$ref": "SourceRange", "optional": true, "description": "Rule selector range in the underlying resource (if available)." }\n ],\n "description": "Selector list data."\n },\n {\n "id": "CSSStyleAttribute",\n "type": "object",\n "properties": [\n { "name": "name", "type": "string", "description": "DOM attribute name (e.g. \\"width\\")."},\n { "name": "style", "$ref": "CSSStyle", "description": "CSS style generated by the respective DOM attribute."}\n ],\n "description": "CSS style information for a DOM style attribute."\n },\n {\n "id": "CSSStyleSheetHeader",\n "type": "object",\n "properties": [\n { "name": "styleSheetId", "$ref": "StyleSheetId", "description": "The stylesheet identifier."},\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Owner frame identifier."},\n { "name": "sourceURL", "type": "string", "description": "Stylesheet resource URL."},\n { "name": "origin", "$ref": "StyleSheetOrigin", "description": "Stylesheet origin."},\n { "name": "title", "type": "string", "description": "Stylesheet title."},\n { "name": "disabled", "type": "boolean", "description": "Denotes whether the stylesheet is disabled."}\n ],\n "description": "CSS stylesheet metainformation."\n },\n {\n "id": "CSSStyleSheetBody",\n "type": "object",\n "properties": [\n { "name": "styleSheetId", "$ref": "StyleSheetId", "description": "The stylesheet identifier."},\n { "name": "rules", "type": "array", "items": { "$ref": "CSSRule" }, "description": "Stylesheet resource URL."},\n { "name": "text", "type": "string", "optional": true, "description": "Stylesheet resource contents (if available)."}\n ],\n "description": "CSS stylesheet contents."\n },\n {\n "id": "CSSRule",\n "type": "object",\n "properties": [\n { "name": "ruleId", "$ref": "CSSRuleId", "optional": true, "description": "The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules)."},\n { "name": "selectorList", "$ref": "SelectorList", "description": "Rule selector data." },\n { "name": "sourceURL", "type": "string", "optional": true, "description": "Parent stylesheet resource URL (for regular rules)."},\n { "name": "sourceLine", "type": "integer", "description": "Line ordinal of the rule selector start character in the resource."},\n { "name": "origin", "$ref": "StyleSheetOrigin", "description": "Parent stylesheet\'s origin."},\n { "name": "style", "$ref": "CSSStyle", "description": "Associated style declaration." },\n { "name": "media", "type": "array", "items": { "$ref": "CSSMedia" }, "optional": true, "description": "Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards." }\n ],\n "description": "CSS rule representation."\n },\n {\n "id": "SourceRange",\n "type": "object",\n "properties": [\n { "name": "start", "type": "integer", "description": "Start of range (inclusive)."},\n { "name": "end", "type": "integer", "description": "End of range (exclusive)."}\n ],\n "description": "Text range within a resource."\n },\n {\n "id": "ShorthandEntry",\n "type": "object",\n "properties": [\n { "name": "name", "type": "string", "description": "Shorthand name." },\n { "name": "value", "type": "string", "description": "Shorthand value." }\n ]\n },\n {\n "id": "CSSPropertyInfo",\n "type": "object",\n "properties": [\n { "name": "name", "type": "string", "description": "Property name." },\n { "name": "longhands", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Longhand property names." }\n ]\n },\n {\n "id": "CSSComputedStyleProperty",\n "type": "object",\n "properties": [\n { "name": "name", "type": "string", "description": "Computed style property name." },\n { "name": "value", "type": "string", "description": "Computed style property value." }\n ]\n },\n {\n "id": "CSSStyle",\n "type": "object",\n "properties": [\n { "name": "styleId", "$ref": "CSSStyleId", "optional": true, "description": "The CSS style identifier (absent for attribute styles)." },\n { "name": "cssProperties", "type": "array", "items": { "$ref": "CSSProperty" }, "description": "CSS properties in the style." },\n { "name": "shorthandEntries", "type": "array", "items": { "$ref": "ShorthandEntry" }, "description": "Computed values for all shorthands found in the style." },\n { "name": "cssText", "type": "string", "optional": true, "description": "Style declaration text (if available)." },\n { "name": "range", "$ref": "SourceRange", "optional": true, "description": "Style declaration range in the enclosing stylesheet (if available)." },\n { "name": "width", "type": "string", "optional": true, "description": "The effective \\"width\\" property value from this style." },\n { "name": "height", "type": "string", "optional": true, "description": "The effective \\"height\\" property value from this style." }\n ],\n "description": "CSS style representation."\n },\n {\n "id": "CSSProperty",\n "type": "object",\n "properties": [\n { "name": "name", "type": "string", "description": "The property name." },\n { "name": "value", "type": "string", "description": "The property value." },\n { "name": "priority", "type": "string", "optional": true, "description": "The property priority (implies \\"\\" if absent)." },\n { "name": "implicit", "type": "boolean", "optional": true, "description": "Whether the property is implicit (implies <code>false</code> if absent)." },\n { "name": "text", "type": "string", "optional": true, "description": "The full property text as specified in the style." },\n { "name": "parsedOk", "type": "boolean", "optional": true, "description": "Whether the property is understood by the browser (implies <code>true</code> if absent)." },\n { "name": "status", "type": "string", "enum": ["active", "inactive", "disabled", "style"], "optional": true, "description": "The property status: \\"active\\" (implied if absent) if the property is effective in the style, \\"inactive\\" if the property is overridden by a same-named property in this style later on, \\"disabled\\" if the property is disabled by the user, \\"style\\" if the property is reported by the browser rather than by the CSS source parser." },\n { "name": "range", "$ref": "SourceRange", "optional": true, "description": "The entire property range in the enclosing style declaration (if available)." }\n ],\n "description": "CSS style effective visual dimensions and source offsets."\n },\n {\n "id": "CSSMedia",\n "type": "object",\n "properties": [\n { "name": "text", "type": "string", "description": "Media query text." },\n { "name": "source", "type": "string", "enum": ["mediaRule", "importRule", "linkedSheet", "inlineSheet"], "description": "Source of the media query: \\"mediaRule\\" if specified by a @media rule, \\"importRule\\" if specified by an @import rule, \\"linkedSheet\\" if specified by a \\"media\\" attribute in a linked stylesheet\'s LINK tag, \\"inlineSheet\\" if specified by a \\"media\\" attribute in an inline stylesheet\'s STYLE tag." },\n { "name": "sourceURL", "type": "string", "optional": true, "description": "URL of the document containing the media query description." },\n { "name": "sourceLine", "type": "integer", "optional": true, "description": "Line in the document containing the media query (not defined for the \\"stylesheet\\" source)." }\n ],\n "description": "CSS media query descriptor."\n },\n {\n "id": "SelectorProfileEntry",\n "type": "object",\n "properties": [\n { "name": "selector", "type": "string", "description": "CSS selector of the corresponding rule." },\n { "name": "url", "type": "string", "description": "URL of the resource containing the corresponding rule." },\n { "name": "lineNumber", "type": "integer", "description": "Selector line number in the resource for the corresponding rule." },\n { "name": "time", "type": "number", "description": "Total time this rule handling contributed to the browser running time during profiling (in milliseconds.)" },\n { "name": "hitCount", "type": "integer", "description": "Number of times this rule was considered a candidate for matching against DOM elements." },\n { "name": "matchCount", "type": "integer", "description": "Number of times this rule actually matched a DOM element." }\n ],\n "description": "CSS selector profile entry."\n },\n {\n "id": "SelectorProfile",\n "type": "object",\n "properties": [\n { "name": "totalTime", "type": "number", "description": "Total processing time for all selectors in the profile (in milliseconds.)" },\n { "name": "data", "type": "array", "items": { "$ref": "SelectorProfileEntry" }, "description": "CSS selector profile entries." }\n ]\n },\n {\n "id": "Region",\n "type": "object",\n "properties": [\n { "name": "regionOverset", "type": "string", "enum": ["overset", "fit", "empty"], "description": "The \\"overset\\" attribute of a Named Flow." },\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The corresponding DOM node id." }\n ],\n "description": "This object represents a region that flows from a Named Flow.",\n "hidden": true\n },\n {\n "id": "NamedFlow",\n "type": "object",\n "properties": [\n { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." },\n { "name": "name", "type": "string", "description": "Named Flow identifier." },\n { "name": "overset", "type": "boolean", "description": "The \\"overset\\" attribute of a Named Flow." },\n { "name": "content", "type": "array", "items": { "$ref": "DOM.NodeId" }, "description": "An array of nodes that flow into the Named Flow." },\n { "name": "regions", "type": "array", "items": { "$ref": "Region" }, "description": "An array of regions associated with the Named Flow." }\n ],\n "description": "This object represents a Named Flow.",\n "hidden": true\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received."\n },\n {\n "name": "disable",\n "description": "Disables the CSS agent for the given page."\n },\n {\n "name": "getMatchedStylesForNode",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId" },\n { "name": "includePseudo", "type": "boolean", "optional": true, "description": "Whether to include pseudo styles (default: true)." },\n { "name": "includeInherited", "type": "boolean", "optional": true, "description": "Whether to include inherited styles (default: true)." }\n ],\n "returns": [\n { "name": "matchedCSSRules", "type": "array", "items": { "$ref": "RuleMatch" }, "optional": true, "description": "CSS rules matching this node, from all applicable stylesheets." },\n { "name": "pseudoElements", "type": "array", "items": { "$ref": "PseudoIdMatches" }, "optional": true, "description": "Pseudo style matches for this node." },\n { "name": "inherited", "type": "array", "items": { "$ref": "InheritedStyleEntry" }, "optional": true, "description": "A chain of inherited styles (from the immediate node parent up to the DOM tree root)." }\n ],\n "description": "Returns requested styles for a DOM node identified by <code>nodeId</code>."\n },\n {\n "name": "getInlineStylesForNode",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId" }\n ],\n "returns": [\n { "name": "inlineStyle", "$ref": "CSSStyle", "optional": true, "description": "Inline style for the specified DOM node." },\n { "name": "attributesStyle", "$ref": "CSSStyle", "optional": true, "description": "Attribute-defined element style (e.g. resulting from \\"width=20 height=100%\\")."}\n ],\n "description": "Returns the styles defined inline (explicitly in the \\"style\\" attribute and implicitly, using DOM attributes) for a DOM node identified by <code>nodeId</code>."\n },\n {\n "name": "getComputedStyleForNode",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId" }\n ],\n "returns": [\n { "name": "computedStyle", "type": "array", "items": { "$ref": "CSSComputedStyleProperty" }, "description": "Computed style for the specified DOM node." }\n ],\n "description": "Returns the computed style for a DOM node identified by <code>nodeId</code>."\n },\n {\n "name": "getAllStyleSheets",\n "returns": [\n { "name": "headers", "type": "array", "items": { "$ref": "CSSStyleSheetHeader" }, "description": "Descriptor entries for all available stylesheets." }\n ],\n "description": "Returns metainfo entries for all known stylesheets."\n },\n {\n "name": "getStyleSheet",\n "parameters": [\n { "name": "styleSheetId", "$ref": "StyleSheetId" }\n ],\n "returns": [\n { "name": "styleSheet", "$ref": "CSSStyleSheetBody", "description": "Stylesheet contents for the specified <code>styleSheetId</code>." }\n ],\n "description": "Returns stylesheet data for the specified <code>styleSheetId</code>."\n },\n {\n "name": "getStyleSheetText",\n "parameters": [\n { "name": "styleSheetId", "$ref": "StyleSheetId" }\n ],\n "returns": [\n { "name": "text", "type": "string", "description": "The stylesheet text." }\n ],\n "description": "Returns the current textual content and the URL for a stylesheet."\n },\n {\n "name": "setStyleSheetText",\n "parameters": [\n { "name": "styleSheetId", "$ref": "StyleSheetId" },\n { "name": "text", "type": "string" }\n ],\n "description": "Sets the new stylesheet text, thereby invalidating all existing <code>CSSStyleId</code>\'s and <code>CSSRuleId</code>\'s contained by this stylesheet."\n },\n {\n "name": "setPropertyText",\n "parameters": [\n { "name": "styleId", "$ref": "CSSStyleId" },\n { "name": "propertyIndex", "type": "integer" },\n { "name": "text", "type": "string" },\n { "name": "overwrite", "type": "boolean" }\n ],\n "returns": [\n { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property text modification." }\n ],\n "description": "Sets the new <code>text</code> for a property in the respective style, at offset <code>propertyIndex</code>. If <code>overwrite</code> is <code>true</code>, a property at the given offset is overwritten, otherwise inserted. <code>text</code> entirely replaces the property <code>name: value</code>."\n },\n {\n "name": "toggleProperty",\n "parameters": [\n { "name": "styleId", "$ref": "CSSStyleId" },\n { "name": "propertyIndex", "type": "integer" },\n { "name": "disable", "type": "boolean" }\n ],\n "returns": [\n { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property toggling." }\n ],\n "description": "Toggles the property in the respective style, at offset <code>propertyIndex</code>. The <code>disable</code> parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If <code>disable == false</code>, the property gets put back into its original place in the style declaration."\n },\n {\n "name": "setRuleSelector",\n "parameters": [\n { "name": "ruleId", "$ref": "CSSRuleId" },\n { "name": "selector", "type": "string" }\n ],\n "returns": [\n { "name": "rule", "$ref": "CSSRule", "description": "The resulting rule after the selector modification." }\n ],\n "description": "Modifies the rule selector."\n },\n {\n "name": "addRule",\n "parameters": [\n { "name": "contextNodeId", "$ref": "DOM.NodeId" },\n { "name": "selector", "type": "string" }\n ],\n "returns": [\n { "name": "rule", "$ref": "CSSRule", "description": "The newly created rule." }\n ],\n "description": "Creates a new empty rule with the given <code>selector</code> in a special \\"inspector\\" stylesheet in the owner document of the context node."\n },\n {\n "name": "getSupportedCSSProperties",\n "returns": [\n { "name": "cssProperties", "type": "array", "items": { "$ref": "CSSPropertyInfo" }, "description": "Supported property metainfo." }\n ],\n "description": "Returns all supported CSS property names."\n },\n {\n "name": "forcePseudoState",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The element id for which to force the pseudo state." },\n { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "description": "Element pseudo classes to force when computing the element\'s style." }\n ],\n "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser."\n },\n {\n "name": "startSelectorProfiler"\n },\n {\n "name": "stopSelectorProfiler",\n "returns": [\n { "name": "profile", "$ref": "SelectorProfile" }\n ]\n },\n {\n "name": "getNamedFlowCollection",\n "parameters": [\n { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id for which to get the Named Flow Collection." }\n ],\n "returns": [\n { "name": "namedFlows", "type": "array", "items": { "$ref": "NamedFlow" }, "description": "An array containing the Named Flows in the document." }\n ],\n "description": "Returns the Named Flows from the document.",\n "hidden": true\n }\n ],\n "events": [\n {\n "name": "mediaQueryResultChanged",\n "description": "Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features."\n },\n {\n "name": "styleSheetChanged",\n "parameters": [\n { "name": "styleSheetId", "$ref": "StyleSheetId" }\n ],\n "description": "Fired whenever a stylesheet is changed as a result of the client operation."\n },\n {\n "name": "namedFlowCreated",\n "parameters": [\n { "name": "namedFlow", "$ref": "NamedFlow", "description": "The new Named Flow." }\n ],\n "description": "Fires when a Named Flow is created.",\n "hidden": true\n },\n {\n "name": "namedFlowRemoved",\n "parameters": [\n { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." },\n { "name": "flowName", "type": "string", "description": "Identifier of the removed Named Flow." }\n ],\n "description": "Fires when a Named Flow is removed: has no associated content nodes and regions.",\n "hidden": true\n },\n {\n "name": "regionLayoutUpdated",\n "parameters": [\n { "name": "namedFlow", "$ref": "NamedFlow", "description": "The Named Flow whose layout may have changed." }\n ],\n "description": "Fires when a Named Flow\'s layout may have changed.",\n "hidden": true\n }\n ]\n },\n {\n "domain": "Timeline",\n "description": "Timeline provides its clients with instrumentation records that are generated during the page runtime. Timeline instrumentation can be started and stopped using corresponding commands. While timeline is started, it is generating timeline event records.",\n "types": [\n {\n "id": "TimelineEvent",\n "type": "object",\n "properties": [\n { "name": "type", "type": "string", "description": "Event type." },\n { "name": "data", "type": "object", "description": "Event data." },\n { "name": "children", "type": "array", "optional": true, "items": { "$ref": "TimelineEvent" }, "description": "Nested records." }\n ],\n "description": "Timeline record contains information about the recorded activity."\n }\n ],\n "commands": [\n {\n "name": "start",\n "parameters": [\n { "name": "maxCallStackDepth", "optional": true, "type": "integer", "description": "Samples JavaScript stack traces up to <code>maxCallStackDepth</code>, defaults to 5." }\n ],\n "description": "Starts capturing instrumentation events."\n },\n {\n "name": "stop",\n "description": "Stops capturing instrumentation events."\n },\n {\n "name": "setIncludeMemoryDetails",\n "parameters": [\n { "name": "enabled", "type": "boolean", "description": "True to start collecting DOM counters." }\n ],\n "hidden": true,\n "description": "Starts calculating various DOM statistics and sending them as part of timeline events."\n },\n {\n "name": "supportsFrameInstrumentation",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if timeline supports frame instrumentation." }\n ],\n "hidden": true,\n "description": "Tells whether timeline agent supports frame instrumentation."\n },\n {\n "name": "canMonitorMainThread",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if timeline supports main thread CPU utilization instrumentation." }\n ],\n "hidden": true,\n "description": "Tells whether timeline agent supports main thread CPU utilization instrumentation."\n }\n ],\n "events": [\n {\n "name": "eventRecorded",\n "parameters": [\n { "name": "record", "$ref": "TimelineEvent", "description": "Timeline event record data." }\n ],\n "description": "Fired for every instrumentation event while timeline is started."\n }\n ]\n },\n {\n "domain": "Debugger",\n "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",\n "types": [\n {\n "id": "BreakpointId",\n "type": "string",\n "description": "Breakpoint identifier."\n },\n {\n "id": "ScriptId",\n "type": "string",\n "description": "Unique script identifier."\n },\n {\n "id": "CallFrameId",\n "type": "string",\n "description": "Call frame identifier."\n },\n {\n "id": "Location",\n "type": "object",\n "properties": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },\n { "name": "lineNumber", "type": "integer", "description": "Line number in the script." },\n { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script." }\n ],\n "description": "Location in the source code."\n },\n {\n "id": "FunctionDetails",\n "hidden": true,\n "type": "object",\n "properties": [\n { "name": "location", "$ref": "Location", "description": "Location of the function." },\n { "name": "name", "type": "string", "optional": true, "description": "Name of the function. Not present for anonymous functions." },\n { "name": "displayName", "type": "string", "optional": true, "description": "Display name of the function(specified in \'displayName\' property on the function object)." },\n { "name": "inferredName", "type": "string", "optional": true, "description": "Name of the function inferred from its initial assignment." },\n { "name": "scopeChain", "type": "array", "optional": true, "items": { "$ref": "Scope" }, "description": "Scope chain for this closure." }\n ],\n "description": "Information about the function."\n },\n {\n "id": "CallFrame",\n "type": "object",\n "properties": [\n { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },\n { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },\n { "name": "location", "$ref": "Location", "description": "Location in the source code." },\n { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },\n { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." }\n ],\n "description": "JavaScript call frame. Array of call frames form the call stack."\n },\n {\n "id": "Scope",\n "type": "object",\n "properties": [\n { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch"], "description": "Scope type." },\n { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." }\n ],\n "description": "Scope description."\n }\n ],\n "commands": [\n {\n "name": "causesRecompilation",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if enabling debugger causes scripts recompilation." }\n ],\n "hidden": true,\n "description": "Tells whether enabling debugger causes scripts recompilation."\n },\n {\n "name": "supportsSeparateScriptCompilationAndExecution",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if debugger supports separate script compilation and execution." }\n ],\n "hidden": true,\n "description": "Tells whether debugger supports separate script compilation and execution."\n },\n {\n "name": "enable",\n "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."\n },\n {\n "name": "disable",\n "description": "Disables debugger for given page."\n },\n {\n "name": "setBreakpointsActive",\n "parameters": [\n { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }\n ],\n "description": "Activates / deactivates all breakpoints on the page."\n },\n {\n "name": "setBreakpointByUrl",\n "parameters": [\n { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },\n { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },\n { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },\n { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },\n { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }\n ],\n "returns": [\n { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },\n { "name": "locations", "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." }\n ],\n "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."\n },\n {\n "name": "setBreakpoint",\n "parameters": [\n { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },\n { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }\n ],\n "returns": [\n { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },\n { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }\n ],\n "description": "Sets JavaScript breakpoint at a given location."\n },\n {\n "name": "removeBreakpoint",\n "parameters": [\n { "name": "breakpointId", "$ref": "BreakpointId" }\n ],\n "description": "Removes JavaScript breakpoint."\n },\n {\n "name": "continueToLocation",\n "parameters": [\n { "name": "location", "$ref": "Location", "description": "Location to continue to." }\n ],\n "description": "Continues execution until specific location is reached."\n },\n {\n "name": "stepOver",\n "description": "Steps over the statement."\n },\n {\n "name": "stepInto",\n "description": "Steps into the function call."\n },\n {\n "name": "stepOut",\n "description": "Steps out of the function call."\n },\n {\n "name": "pause",\n "description": "Stops on the next JavaScript statement."\n },\n {\n "name": "resume",\n "description": "Resumes JavaScript execution."\n },\n {\n "name": "searchInContent",\n "parameters": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to search in." },\n { "name": "query", "type": "string", "description": "String to search for." },\n { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },\n { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }\n ],\n "returns": [\n { "name": "result", "type": "array", "items": { "$ref": "Page.SearchMatch" }, "description": "List of search matches." }\n ],\n "description": "Searches for given string in script content."\n },\n {\n "name": "canSetScriptSource",\n "returns": [\n { "name": "result", "type": "boolean", "description": "True if <code>setScriptSource</code> is supported." }\n ],\n "description": "Tells whether <code>setScriptSource</code> is supported."\n },\n {\n "name": "setScriptSource",\n "parameters": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to edit." },\n { "name": "scriptSource", "type": "string", "description": "New content of the script." },\n { "name": "preview", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code.", "hidden": true }\n ],\n "returns": [\n { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." },\n { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied.", "hidden": true }\n ],\n "description": "Edits JavaScript source live."\n },\n {\n "name": "restartFrame",\n "parameters": [\n { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }\n ],\n "returns": [\n { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame"}, "description": "New stack trace." },\n { "name": "result", "type": "object", "description": "VM-specific description.", "hidden": true }\n ],\n "hidden": true,\n "description": "Restarts particular call frame from the beginning."\n },\n {\n "name": "getScriptSource",\n "parameters": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to get source for." }\n ],\n "returns": [\n { "name": "scriptSource", "type": "string", "description": "Script source." }\n ],\n "description": "Returns source for the script with given id."\n },\n {\n "name": "getFunctionDetails",\n "hidden": true,\n "parameters": [\n { "name": "functionId", "$ref": "Runtime.RemoteObjectId", "description": "Id of the function to get location for." }\n ],\n "returns": [\n { "name": "details", "$ref": "FunctionDetails", "description": "Information about the function." }\n ],\n "description": "Returns detailed informtation on given function."\n },\n {\n "name": "setPauseOnExceptions",\n "parameters": [\n { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }\n ],\n "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."\n },\n {\n "name": "evaluateOnCallFrame",\n "parameters": [\n { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },\n { "name": "expression", "type": "string", "description": "Expression to evaluate." },\n { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },\n { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false.", "hidden": true },\n { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true },\n { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },\n { "name": "generatePreview", "type": "boolean", "optional": true, "hidden": true, "description": "Whether preview should be generated for the result." }\n ],\n "returns": [\n { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },\n { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }\n ],\n "description": "Evaluates expression on a given call frame."\n },\n {\n "name": "compileScript",\n "hidden": true,\n "parameters": [\n { "name": "expression", "type": "string", "description": "Expression to compile." },\n { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." }\n ],\n "returns": [\n { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },\n { "name": "syntaxErrorMessage", "type": "string", "optional": true, "description": "Syntax error message if compilation failed." }\n ],\n "description": "Compiles expression."\n },\n {\n "name": "runScript",\n "hidden": true,\n "parameters": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." },\n { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform script run. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." },\n { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },\n { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether script run should stop on exceptions and mute console. Overrides setPauseOnException state." }\n ],\n "returns": [\n { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Run result." },\n { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the script run." }\n ],\n "description": "Runs script with given id in a given context."\n },\n {\n "name": "setOverlayMessage",\n "parameters": [\n { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }\n ],\n "hidden": true,\n "description": "Sets overlay message."\n },\n {\n "name": "setVariableValue",\n "parameters": [\n { "name": "callFrameId", "$ref": "CallFrameId", "optional": true, "description": "Id of callframe that holds variable." },\n { "name": "functionObjectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "Object id of closure (function) that holds variable." },\n { "name": "scopeNumber", "type": "integer", "description": "0-based number of scope as was listed in scope chain. Only \'local\', \'closure\' and \'catch\' scope types are allowed. Other scopes could be manipulated manually." },\n { "name": "variableName", "type": "string", "description": "Variable name." },\n { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." }\n ],\n "hidden": true,\n "description": "Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually."\n }\n ],\n "events": [\n {\n "name": "globalObjectCleared",\n "description": "Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload."\n },\n {\n "name": "scriptParsed",\n "parameters": [\n { "name": "scriptId", "$ref": "ScriptId", "description": "Identifier of the script parsed." },\n { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },\n { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },\n { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },\n { "name": "endLine", "type": "integer", "description": "Last line of the script." },\n { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },\n { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." },\n { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },\n { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." }\n ],\n "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."\n },\n {\n "name": "scriptFailedToParse",\n "parameters": [\n { "name": "url", "type": "string", "description": "URL of the script that failed to parse." },\n { "name": "scriptSource", "type": "string", "description": "Source text of the script that failed to parse." },\n { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource." },\n { "name": "errorLine", "type": "integer", "description": "Line with error." },\n { "name": "errorMessage", "type": "string", "description": "Parse error message." }\n ],\n "description": "Fired when virtual machine fails to parse the script."\n },\n {\n "name": "breakpointResolved",\n "parameters": [\n { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },\n { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }\n ],\n "description": "Fired when breakpoint is resolved to an actual script and location."\n },\n {\n "name": "paused",\n "parameters": [\n { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },\n { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "CSPViolation", "other" ], "description": "Pause reason." },\n { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." }\n ],\n "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."\n },\n {\n "name": "resumed",\n "description": "Fired when the virtual machine resumed execution."\n }\n ]\n },\n {\n "domain": "DOMDebugger",\n "description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.",\n "types": [\n {\n "id": "DOMBreakpointType",\n "type": "string",\n "enum": ["subtree-modified", "attribute-modified", "node-removed"],\n "description": "DOM breakpoint type."\n }\n ],\n "commands": [\n {\n "name": "setDOMBreakpoint",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Identifier of the node to set breakpoint on." },\n { "name": "type", "$ref": "DOMBreakpointType", "description": "Type of the operation to stop upon." }\n ],\n "description": "Sets breakpoint on particular operation with DOM."\n },\n {\n "name": "removeDOMBreakpoint",\n "parameters": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Identifier of the node to remove breakpoint from." },\n { "name": "type", "$ref": "DOMBreakpointType", "description": "Type of the breakpoint to remove." }\n ],\n "description": "Removes DOM breakpoint that was set using <code>setDOMBreakpoint</code>."\n },\n {\n "name": "setEventListenerBreakpoint",\n "parameters": [\n { "name": "eventName", "type": "string", "description": "DOM Event name to stop on (any DOM event will do)." }\n ],\n "description": "Sets breakpoint on particular DOM event."\n },\n {\n "name": "removeEventListenerBreakpoint",\n "parameters": [\n { "name": "eventName", "type": "string", "description": "Event name." }\n ],\n "description": "Removes breakpoint on particular DOM event."\n },\n {\n "name": "setInstrumentationBreakpoint",\n "parameters": [\n { "name": "eventName", "type": "string", "description": "Instrumentation name to stop on." }\n ],\n "description": "Sets breakpoint on particular native event.",\n "hidden": true\n },\n {\n "name": "removeInstrumentationBreakpoint",\n "parameters": [\n { "name": "eventName", "type": "string", "description": "Instrumentation name to stop on." }\n ],\n "description": "Sets breakpoint on particular native event.",\n "hidden": true\n },\n {\n "name": "setXHRBreakpoint",\n "parameters": [\n { "name": "url", "type": "string", "description": "Resource URL substring. All XHRs having this substring in the URL will get stopped upon." }\n ],\n "description": "Sets breakpoint on XMLHttpRequest."\n },\n {\n "name": "removeXHRBreakpoint",\n "parameters": [\n { "name": "url", "type": "string", "description": "Resource URL substring." }\n ],\n "description": "Removes breakpoint from XMLHttpRequest."\n }\n ]\n },\n {\n "domain": "Profiler",\n "hidden": true,\n "types": [\n {\n "id": "ProfileHeader",\n "type": "object",\n "description": "Profile header.",\n "properties": [\n { "name": "typeId", "type": "string", "enum": ["CPU", "CSS", "HEAP"], "description": "Profile type name." },\n { "name": "title", "type": "string", "description": "Profile title." },\n { "name": "uid", "type": "integer", "description": "Unique identifier of the profile." },\n { "name": "maxJSObjectId", "type": "integer", "optional": true, "description": "Last seen JS object Id." }\n ]\n },\n {\n "id": "CPUProfileNode",\n "type": "object",\n "description": "CPU Profile node. Holds callsite information, execution statistics and child nodes.",\n "properties": [\n { "name": "functionName", "type": "string", "description": "Function name." },\n { "name": "url", "type": "string", "description": "URL." },\n { "name": "lineNumber", "type": "integer", "description": "Line number." },\n { "name": "totalTime", "type": "number", "description": "Total execution time." },\n { "name": "selfTime", "type": "number", "description": "Self time." },\n { "name": "numberOfCalls", "type": "integer", "description": "Number of calls." },\n { "name": "visible", "type": "boolean", "description": "Visibility." },\n { "name": "callUID", "type": "number", "description": "Call UID." },\n { "name": "children", "type": "array", "items": { "$ref": "CPUProfileNode" }, "description": "Child nodes." }\n ]\n },\n {\n "id": "CPUProfile",\n "type": "object",\n "description": "Profile.",\n "properties": [\n { "name": "head", "$ref": "CPUProfileNode", "optional": true },\n { "name": "bottomUpHead", "$ref": "CPUProfileNode", "optional": true },\n { "name": "idleTime", "type": "number", "optional": true }\n ]\n },\n {\n "id": "HeapSnapshotObjectId",\n "type": "string",\n "description": "Heap snashot object id."\n }\n ],\n "commands": [\n {\n "name": "causesRecompilation",\n "returns": [\n { "name": "result", "type": "boolean" }\n ]\n },\n {\n "name": "isSampling",\n "returns": [\n { "name": "result", "type": "boolean" }\n ]\n },\n {\n "name": "hasHeapProfiler",\n "returns": [\n { "name": "result", "type": "boolean" }\n ]\n },\n {\n "name": "enable"\n },\n {\n "name": "disable"\n },\n {\n "name": "start"\n },\n {\n "name": "stop"\n },\n {\n "name": "getProfileHeaders",\n "returns": [\n { "name": "headers", "type": "array", "items": { "$ref": "ProfileHeader"} }\n ]\n },\n {\n "name": "getCPUProfile",\n "parameters": [\n { "name": "uid", "type": "integer" }\n ],\n "returns": [\n { "name": "profile", "$ref": "CPUProfile" }\n ]\n },\n {\n "name": "getHeapSnapshot",\n "parameters": [\n { "name": "uid", "type": "integer" }\n ]\n },\n {\n "name": "removeProfile",\n "parameters": [\n { "name": "type", "type": "string" },\n { "name": "uid", "type": "integer" }\n ]\n },\n {\n "name": "clearProfiles"\n },\n {\n "name": "takeHeapSnapshot",\n "parameters": [\n { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true \'reportHeapSnapshotProgress\' events will be generated while snapshot is being taken." }\n ]\n },\n {\n "name": "collectGarbage"\n },\n {\n "name": "getObjectByHeapObjectId",\n "parameters": [\n { "name": "objectId", "$ref": "HeapSnapshotObjectId" },\n { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }\n ],\n "returns": [\n { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }\n ]\n },\n {\n "name": "getHeapObjectId",\n "parameters": [\n { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }\n ],\n "returns": [\n { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }\n ]\n }\n ],\n "events": [\n {\n "name": "addProfileHeader",\n "parameters": [\n { "name": "header", "$ref": "ProfileHeader" }\n ]\n },\n {\n "name": "addHeapSnapshotChunk",\n "parameters": [\n { "name": "uid", "type": "integer" },\n { "name": "chunk", "type": "string" }\n ]\n },\n {\n "name": "finishHeapSnapshot",\n "parameters": [\n { "name": "uid", "type": "integer" }\n ]\n },\n {\n "name": "setRecordingProfile",\n "parameters": [\n { "name": "isProfiling", "type": "boolean" }\n ]\n },\n {\n "name": "resetProfiles"\n },\n {\n "name": "reportHeapSnapshotProgress",\n "parameters": [\n { "name": "done", "type": "integer" },\n { "name": "total", "type": "integer" }\n ]\n }\n ]\n },\n {\n "domain": "Worker",\n "hidden": true,\n "types": [],\n "commands": [\n {\n "name": "enable"\n },\n {\n "name": "disable"\n },\n {\n "name": "sendMessageToWorker",\n "parameters": [\n { "name": "workerId", "type": "integer" },\n { "name": "message", "type": "object" }\n ]\n },\n {\n "name": "connectToWorker",\n "parameters": [\n { "name": "workerId", "type": "integer" }\n ]\n },\n {\n "name": "disconnectFromWorker",\n "parameters": [\n { "name": "workerId", "type": "integer" }\n ]\n },\n {\n "name": "setAutoconnectToWorkers",\n "parameters": [\n { "name": "value", "type": "boolean" }\n ]\n }\n ],\n "events": [\n {\n "name": "workerCreated",\n "parameters": [\n { "name": "workerId", "type": "integer" },\n { "name": "url", "type": "string" },\n { "name": "inspectorConnected", "type": "boolean" }\n ]\n },\n {\n "name": "workerTerminated",\n "parameters": [\n { "name": "workerId", "type": "integer" }\n ]\n },\n {\n "name": "dispatchMessageFromWorker",\n "parameters": [\n { "name": "workerId", "type": "integer" },\n { "name": "message", "type": "object" }\n ]\n },\n {\n "name": "disconnectedFromWorker"\n }\n ]\n },\n {\n "domain": "Canvas",\n "hidden": true,\n "types": [\n {\n "id": "ResourceId",\n "type": "string",\n "description": "Unique resource identifier."\n },\n {\n "id": "ResourceInfo",\n "type": "object",\n "properties": [\n { "name": "id", "$ref": "ResourceId" },\n { "name": "description", "type": "string" }\n ]\n },\n {\n "id": "ResourceState",\n "type": "object",\n "properties": [\n { "name": "id", "$ref": "ResourceId" },\n { "name": "traceLogId", "$ref": "TraceLogId" },\n { "name": "imageURL", "type": "string", "optional": true, "description": "Screenshot image data URL." }\n ]\n },\n {\n "id": "CallArgument",\n "type": "object",\n "properties": [\n { "name": "description", "type": "string" }\n ]\n },\n {\n "id": "Call",\n "type": "object",\n "properties": [\n { "name": "contextId", "$ref": "ResourceId" },\n { "name": "functionName", "type": "string", "optional": true },\n { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument" }, "optional": true },\n { "name": "result", "$ref": "CallArgument", "optional": true },\n { "name": "isDrawingCall", "type": "boolean", "optional": true },\n { "name": "property", "type": "string", "optional": true },\n { "name": "value", "$ref": "CallArgument", "optional": true },\n { "name": "sourceURL", "type": "string", "optional": true },\n { "name": "lineNumber", "type": "integer", "optional": true },\n { "name": "columnNumber", "type": "integer", "optional": true }\n ]\n },\n {\n "id": "TraceLogId",\n "type": "string",\n "description": "Unique trace log identifier."\n },\n {\n "id": "TraceLog",\n "type": "object",\n "properties": [\n { "name": "id", "$ref": "TraceLogId" },\n { "name": "calls", "type": "array", "items": { "$ref": "Call" } },\n { "name": "startOffset", "type": "integer" },\n { "name": "alive", "type": "boolean" },\n { "name": "totalAvailableCalls", "type": "number" }\n ]\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables Canvas inspection."\n },\n {\n "name": "disable",\n "description": "Disables Canvas inspection."\n },\n {\n "name": "dropTraceLog",\n "parameters": [\n { "name": "traceLogId", "$ref": "TraceLogId" }\n ]\n },\n {\n "name": "hasUninstrumentedCanvases",\n "returns": [\n { "name": "result", "type": "boolean" }\n ],\n "description": "Checks if there is any uninstrumented canvas in the inspected page."\n },\n {\n "name": "captureFrame",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed." }\n ],\n "returns": [\n { "name": "traceLogId", "$ref": "TraceLogId", "description": "Identifier of the trace log containing captured canvas calls." }\n ],\n "description": "Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared."\n },\n {\n "name": "startCapturing",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed." }\n ],\n "returns": [\n { "name": "traceLogId", "$ref": "TraceLogId", "description": "Identifier of the trace log containing captured canvas calls." }\n ],\n "description": "Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command."\n },\n {\n "name": "stopCapturing",\n "parameters": [\n { "name": "traceLogId", "$ref": "TraceLogId" }\n ]\n },\n {\n "name": "getTraceLog",\n "parameters": [\n { "name": "traceLogId", "$ref": "TraceLogId" },\n { "name": "startOffset", "type": "integer", "optional": true },\n { "name": "maxLength", "type": "integer", "optional": true }\n ],\n "returns": [\n { "name": "traceLog", "$ref": "TraceLog" }\n ]\n },\n {\n "name": "replayTraceLog",\n "parameters": [\n { "name": "traceLogId", "$ref": "TraceLogId" },\n { "name": "stepNo", "type": "integer" }\n ],\n "returns": [\n { "name": "resourceState", "$ref": "ResourceState" }\n ]\n },\n {\n "name": "getResourceInfo",\n "parameters": [\n { "name": "resourceId", "$ref": "ResourceId" }\n ],\n "returns": [\n { "name": "resourceInfo", "$ref": "ResourceInfo" }\n ]\n },\n {\n "name": "getResourceState",\n "parameters": [\n { "name": "traceLogId", "$ref": "TraceLogId" },\n { "name": "resourceId", "$ref": "ResourceId" }\n ],\n "returns": [\n { "name": "resourceState", "$ref": "ResourceState" }\n ]\n }\n ],\n "events": [\n {\n "name": "contextCreated",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing a canvas with a context." }\n ],\n "description": "Fired when a canvas context has been created in the given frame. The context may not be instrumented (see hasUninstrumentedCanvases command)."\n },\n {\n "name": "traceLogsRemoved",\n "parameters": [\n { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "If given, trace logs from the given frame were removed." },\n { "name": "traceLogId", "$ref": "TraceLogId", "optional": true, "description": "If given, trace log with the given ID was removed." }\n ],\n "description": "Fired when a set of trace logs were removed from the backend. If no parameters are given, all trace logs were removed."\n }\n ]\n },\n {\n "domain": "Input",\n "hidden": true,\n "types": [],\n "commands": [\n {\n "name": "dispatchKeyEvent",\n "parameters": [\n { "name": "type", "type": "string", "enum": ["keyDown", "keyUp", "rawKeyDown", "char"], "description": "Type of the key event." },\n { "name": "modifiers", "type": "integer", "optional": true, "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." },\n { "name": "timestamp", "type": "number", "optional": true, "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)." },\n { "name": "text", "type": "string", "optional": true, "description": "Text as generated by processing a virtual key code with a keyboard layout. Not needed for for <code>keyUp</code> and <code>rawKeyDown</code> events (default: \\"\\")" },\n { "name": "unmodifiedText", "type": "string", "optional": true, "description": "Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: \\"\\")." },\n { "name": "keyIdentifier", "type": "string", "optional": true, "description": "Unique key identifier (e.g., \'U+0041\') (default: \\"\\")." },\n { "name": "windowsVirtualKeyCode", "type": "integer", "optional": true, "description": "Windows virtual key code (default: 0)." },\n { "name": "nativeVirtualKeyCode", "type": "integer", "optional": true, "description": "Native virtual key code (default: 0)." },\n { "name": "macCharCode", "type": "integer", "optional": true, "description": "Mac character code (default: 0)." },\n { "name": "autoRepeat", "type": "boolean", "optional": true, "description": "Whether the event was generated from auto repeat (default: false)." },\n { "name": "isKeypad", "type": "boolean", "optional": true, "description": "Whether the event was generated from the keypad (default: false)." },\n { "name": "isSystemKey", "type": "boolean", "optional": true, "description": "Whether the event was a system key event (default: false)." }\n ],\n "description": "Dispatches a key event to the page."\n },\n {\n "name": "dispatchMouseEvent",\n "parameters": [\n { "name": "type", "type": "string", "enum": ["mousePressed", "mouseReleased", "mouseMoved"], "description": "Type of the mouse event." },\n { "name": "x", "type": "integer", "description": "X coordinate of the event relative to the main frame\'s viewport."},\n { "name": "y", "type": "integer", "description": "Y coordinate of the event relative to the main frame\'s viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."},\n { "name": "modifiers", "type": "integer", "optional": true, "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." },\n { "name": "timestamp", "type": "number", "optional": true, "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)." },\n { "name": "button", "type": "string", "enum": ["none", "left", "middle", "right"], "optional": true, "description": "Mouse button (default: \\"none\\")." },\n { "name": "clickCount", "type": "integer", "optional": true, "description": "Number of times the mouse button was clicked (default: 0)." }\n ],\n "description": "Dispatches a mouse event to the page."\n }\n ],\n "events": []\n },\n {\n "domain": "LayerTree",\n "hidden": true,\n "types": [\n {\n "id": "LayerId",\n "type": "string",\n "description": "Unique RenderLayer identifier."\n },\n {\n "id": "IntRect",\n "type": "object",\n "description": "A rectangle.",\n "properties": [\n { "name": "x", "type": "integer", "description": "The x position." },\n { "name": "y", "type": "integer", "description": "The y position." },\n { "name": "width", "type": "integer", "description": "The width metric." },\n { "name": "height", "type": "integer", "description": "The height metric." }\n ]\n },\n {\n "id": "Layer",\n "type": "object",\n "description": "Information about a compositing layer.",\n "properties": [\n { "name": "layerId", "$ref": "LayerId", "description": "The unique id for this layer." },\n { "name": "bounds", "$ref": "IntRect", "description": "Bounds of the layer." },\n { "name": "isComposited", "type": "boolean", "description": "Indicates whether this layer is composited." },\n { "name": "paintCount", "type": "integer", "optional": true, "description": "Indicates how many time this layer has painted." },\n { "name": "memory", "type": "integer", "optional": true, "description": "Estimated memory used by this layer." },\n { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." },\n { "name": "childLayers", "type": "array", "optional": true, "items": { "$ref": "Layer" }, "description": "Child layers." }\n ]\n }\n ],\n "commands": [\n {\n "name": "enable",\n "description": "Enables compositing tree inspection."\n },\n {\n "name": "disable",\n "description": "Disables compositing tree inspection."\n },\n {\n "name": "getLayerTree",\n "description": "Returns the layer tree structure of the current page.",\n "returns": [\n { "name": "layerTree", "$ref": "Layer", "description": "Layer tree structure of the current page." }\n ]\n },\n {\n "name": "nodeIdForLayerId",\n "description": "Returns the node id for a given layer id.",\n "parameters": [\n { "name": "layerId", "$ref": "LayerId" }\n ],\n "returns": [\n { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The node id for the given layer id." }\n ]\n }\n ],\n "events": [\n {\n "name": "layerTreeDidChange"\n }\n ]\n }]\n}\n'
26}),define("LiveDevelopment/Inspector/Inspector",["require","exports","module","utils/Async","text!LiveDevelopment/Inspector/Inspector.json"],function(e,t){function n(e,t){return void 0===t&&console.assert(e.optional===!0,"Missing argument: "+e.name),!0}function r(e,t){if(!_)return console.log("You must connect to the WebSocket before sending messages."),(new $.Deferred).reject().promise();var r,i,o,a,s,l,c={};if(o=Array.prototype.slice.call(arguments,2),"function"==typeof o[o.length-1])i=o.pop();else{var u=new $.Deferred;s=u.promise(),i=function(e,t){t?u.reject(t):u.resolve(e)}}if(r=C++,t)for(a in t)n(o[a],t[a])&&(c[t[a].name]=o[a]);return l={method:e,id:r,params:c},S[r]={callback:i,message:l},_.send(JSON.stringify(l)),s}function i(e,t,n){return r(e+"."+t,null,n)}function o(){_=void 0,w.triggerHandler("disconnect")}function a(e){b&&(b.reject(),b=null),w.triggerHandler("error",[e])}function s(){b&&(b.resolve(),b=null),w.triggerHandler("connect")}function l(e){var n=JSON.parse(e.data),r=S[n.id],i=r&&r.callback,o=r&&r.message||"No message";if(r)i(n.result,n.error),delete S[n.id];else if(n.method){var a=n.method.split("."),s=a[0],l=a[1];$(t[s]).triggerHandler(l,n.params)}w.triggerHandler("message",[n]),n.error&&w.triggerHandler("error",[n.error,o])}function c(e,t){e||(e="127.0.0.1"),t||(t=9222);var n=new $.Deferred,r=new XMLHttpRequest;return r.open("GET","http://"+e+":"+t+"/json"),r.onload=function(){var e=JSON.parse(r.response);n.resolve(e)},r.onerror=function(){n.reject(r.response)},r.send(null),n.promise()}function u(e,t){w.on(e,t)}function d(e,t){w.off(e,t)}function p(){var e=new $.Deferred,t=e.promise();return _&&_.readyState===WebSocket.OPEN?(_.onclose=function(){o(),e.resolve()},t=E.withTimeout(t,5e3),_.close()):(_&&(delete _.onmessage,delete _.onopen,delete _.onclose,delete _.onerror,_=void 0),e.resolve()),t}function f(e){p().done(function(){_=new WebSocket(e),_.onmessage=l,_.onopen=s,_.onclose=o,_.onerror=a})}function h(e){b&&b.reject("CANCEL");var t=new $.Deferred;b=t;var n=c();return n.done(function(n){var r,i;for(r in n)if(i=n[r],i.webSocketDebuggerUrl&&0===i.url.indexOf(e))return void f(i.webSocketDebuggerUrl);t.reject(FileError.ERR_NOT_FOUND)}),n.fail(function(e){t.reject(e)}),t.promise()}function m(){return void 0!==_&&_.readyState===WebSocket.OPEN}function g(){return I}function v(e){I=e}function y(n){t.config=n;var i,o,a,s,l=e("text!LiveDevelopment/Inspector/Inspector.json"),c=JSON.parse(l);for(i in c.domains){a=c.domains[i],t[a.domain]={};for(o in a.commands)s=a.commands[o],t[a.domain][s.name]=r.bind(void 0,a.domain+"."+s.name,s.parameters)}}var _,b,E=e("utils/Async"),w=$(t),S={},C=1,I="";t.connect=f,t.connected=m,t.connectToURL=h,t.disconnect=p,t.getDebuggableWindows=c,t.getUserAgent=g,t.init=y,t.off=d,t.on=u,t.send=i,t.setUserAgent=v}),define("text!widgets/StatusBar.html",[],function(){return'<div id="status-bar" class="statusbar no-focus">\n <div id="status-info" class="info" >\n <div id="status-cursor"></div>\n <div id="status-file"></div>\n </div>\n <div id="status-indicators" class="indicators">\n <div id="status-indent">\n <div id="indent-type"></div>\n <div id="indent-width-label"></div>\n <input id="indent-width-input" type="number" min="1" max="10" maxlength="2" size="2" class="hidden">\n </div>\n <div id="status-language"></div>\n <div id="status-overwrite">{{STATUSBAR_INSERT}}</div>\n <div class="spinner"></div>\n </div>\n</div>\n'}),define("widgets/StatusBar",["require","exports","module","utils/AppInit","text!widgets/StatusBar.html","strings","view/WorkspaceManager"],function(e,t){function n(e){return w?(e&&(S=!0,$("*").addClass("busyCursor")),void v.addClass("spin")):void console.error("StatusBar API invoked before status bar created")}function r(){return w?(S&&(S=!1,$("*").removeClass("busyCursor")),void v.removeClass("spin")):void console.error("StatusBar API invoked before status bar created")}function i(e,t,n,r,i,o){if(!w)return void console.error("StatusBar API invoked before status bar created");t=t||document.createElement("div"),i=i||"",r=r||"",e=e.replace(C,"-")||"";var a=$(t);if(a.attr("id",e),a.attr("title",i),a.addClass("indicator"),a.addClass(r),n||a.hide(),o&&$("#"+o).length>0)a.insertAfter("#"+o);else{var s=$("#status-bar .spinner");a.insertBefore(s)}}function o(e,t,n,r){if(!w)return void console.error("StatusBar API invoked before status bar created");var i=$("#"+e.replace(C,"-"));i&&(t?i.show():i.hide(),n?(i.removeClass(),i.addClass(n)):(i.removeClass(),i.addClass("indicator")),r&&i.attr("title",r))}function a(){h.css("display","none")}function s(){h.css("display","")}function l(){g.css("display","none")}function c(){g.css("display","")}function u(){a(),l()}function d(){s(),c()}function p(){return w?void(m.is(":visible")&&(m.hide(),E.recomputeLayout())):void console.error("StatusBar API invoked before status bar created")}function f(){return w?void(m.is(":visible")||(m.show(),E.recomputeLayout())):void console.error("StatusBar API invoked before status bar created")}var h,m,g,v,y=e("utils/AppInit"),_=e("text!widgets/StatusBar.html"),b=e("strings"),E=e("view/WorkspaceManager"),w=!1,S=!1,C=new RegExp("[^a-zA-Z 0-9]+","g");y.htmlReady(function(){var e=$(".main-view .content");e.append(Mustache.render(_,b)),m=$("#status-bar"),g=$("#status-indicators"),v=$("#status-bar .spinner"),h=$("#status-info"),w=!0,p()}),t.hideInformation=a,t.showInformation=s,t.showBusyIndicator=n,t.hideBusyIndicator=r,t.hideIndicators=l,t.showIndicators=c,t.hideAllPanes=u,t.showAllPanes=d,t.addIndicator=i,t.updateIndicator=o,t.hide=p,t.show=f}),define("document/DocumentCommandHandlers",["require","exports","module","thirdparty/lodash","utils/AppInit","command/CommandManager","command/Commands","utils/DeprecationWarning","project/ProjectManager","document/DocumentManager","view/MainViewManager","editor/EditorManager","filesystem/FileSystem","filesystem/FileSystemError","file/FileUtils","project/FileViewController","document/InMemoryFile","utils/StringUtils","utils/Async","widgets/Dialogs","widgets/DefaultDialogs","strings","widgets/PopUpManager","preferences/PreferencesManager","utils/PerfUtils","utils/KeyEvent","LiveDevelopment/Inspector/Inspector","command/Menus","utils/UrlParams","widgets/StatusBar","view/WorkspaceManager"],function(e,t){function n(){var e=Z.getCurrentDocument(),t=et.getCurrentlyViewedPath(et.ACTIVE_PANE),n=brackets.config.app_title;if(!brackets.nativeMenus){t?(Et.text(Ct),Et.attr("title",t),e?wt.css("visibility",e.isDirty?"visible":"hidden"):wt.css("visibility","hidden")):(Et.text(""),Et.attr("title",""),wt.css("visibility","hidden")),St.css("width","");var r=Et.width();St.css("width",r);var i=kt.height();xt!==i&&(xt=i,bt.recomputeLayout())}t&&(n=st.format(It,Ct,n)),e?n=e.isDirty?"• "+n:n:wt.css("visibility","hidden"),window.document.title=n}function r(e){var t=e.file.fullPath;return e.isUntitled()?t.substring(t.lastIndexOf("/")+1):J.makeProjectRelativeIfPossible(t)}function i(){var e=et.getCurrentlyViewedFile(et.ACTIVE_PANE);if(e){var t=Z.getOpenDocumentForPath(e.fullPath);Ct=t?r(t):J.makeProjectRelativeIfPossible(e.fullPath)}else Ct=null;n()}function o(e,t){var r=Z.getCurrentDocument();r&&t.file.fullPath===r.file.fullPath&&n()}function a(e,t,n,r){function i(e,t){t&&(et._removeView(n,nt.getFileForPath(t)),et.focusActivePane()),a.reject(e)}function o(e,n){t?i(e,n):it.showFileOpenError(e,n).done(function(){i(e,n)})}var a=new $.Deferred;if(et.getCurrentlyViewedPath(et.ACTIVE_PANE)===e)return a.resolve(et.getCurrentlyViewedFile(et.ACTIVE_PANE)),a.promise();if(!e)throw new Error("_doOpen() called without fullPath");var s=ht.markStart("Open File: "+e);a.always(function(){ht.addMeasurement(s)});var l=nt.getFileForPath(e);return et._open(n,l,r).done(function(){a.resolve(l)}).fail(function(t){o(t,e),a.reject()}),a.promise()}function s(e,t,n,r){var i;return n=n||et.ACTIVE_PANE,e?i=a(e,t,n,r):(i=new $.Deferred,Lt||(Lt=J.getProjectRoot().fullPath),nt.showOpenDialog(!0,!1,dt.OPEN_FILE,Lt,null,function(e,o){if(!e)if(o.length>0){var s=[];o.forEach(function(e){s.push(nt.getFileForPath(e))}),et.addListToWorkingSet(n,s),a(o[o.length-1],t,n,r).done(function(){Lt=it.getDirectoryPath(et.getCurrentlyViewedPath(n))}).then(i.resolve,i.reject)}else i.reject()})),i.promise()}function l(e){var t={path:e,line:null,column:null};if(e){var n=/(.+?):([0-9]+)(:([0-9]+))?$/.exec(e);n&&(t.path=n[1],n[2]&&(t.line=parseInt(n[2],10)),n[4]&&(t.column=parseInt(n[4],10)))}return t}function c(e){var t=l(e?e.fullPath:null),n=e&&e.silent||!1,r=e&&e.paneId||et.ACTIVE_PANE,i=new $.Deferred;return s(t.path,n,r,e&&e.options).done(function(n){e&&e.options&&e.options.noPaneActivate||et.setActivePaneId(r),null!==t.line&&((null===t.column||t.column<=0)&&(t.column=1),tt.getCurrentFullEditor().setCursorPos(t.line-1,t.column-1,!0)),i.resolve(n)}).fail(function(e){i.reject(e)}),i}function u(e){var t=new $.Deferred;return c(e).done(function(e){var n=Z.getOpenDocumentForPath(e.fullPath);t.resolve(n)}).fail(function(e){t.reject(e)}),t.promise()}function d(e){return c(e).done(function(t){var n=e&&e.paneId||et.ACTIVE_PANE;et.addToWorkingSet(n,t,e.index,e.forceRedraw)})}function p(e){Q.deprecationWarning("Commands.FILE_ADD_TO_WORKING_SET has been deprecated. Use Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN instead.");var t=new $.Deferred;return d(e).done(function(e){var n=Z.getOpenDocumentForPath(e.fullPath);t.resolve(n)}).fail(function(e){t.reject(e)}),t.promise()}function f(e,t,n){var r=t+"-"+Tt++,i=$.Deferred();if(Tt>9999)i.reject();else{var o=e.fullPath+r,a=n?nt.getDirectoryForPath(o):nt.getFileForPath(o);a.exists(function(o,a){o||a?f(e,t,n).then(i.resolve,i.reject):i.resolve(r)})}return i.promise()}function h(e){function t(t){return J.createNewItem(n,t,!1,e).always(function(){Rt=!1})}if(Rt)return void J.forceFinishRename();Rt=!0;var n,r=J.getSelectedItem();return(!r||r instanceof at)&&(r=J.getProjectRoot()),r.isFile&&(n=nt.getDirectoryForPath(r.parentPath)),n=n||r,f(n,dt.UNTITLED,e).then(t,t.bind(void 0,dt.UNTITLED))}function m(){var e="",t=Z.createUntitledDocument(Tt++,e);return et._edit(et.ACTIVE_PANE,t),(new $.Deferred).resolve(t).promise()}function g(){h(!1)}function v(){h(!0)}function y(e,t){return ct.showModalDialog(ut.DIALOG_ID_ERROR,dt.ERROR_SAVING_FILE_TITLE,st.format(dt.ERROR_SAVING_FILE,st.breakableUrl(t),it.getFileErrorString(e)))}function _(e,t){function n(e){y(e,a.fullPath).done(function(){o.reject(e)})}function r(){ct.showModalDialog(ut.DIALOG_ID_ERROR,dt.EXT_MODIFIED_TITLE,st.format(dt.EXT_MODIFIED_WARNING,st.breakableUrl(e.file.fullPath)),[{className:ct.DIALOG_BTN_CLASS_LEFT,id:ct.DIALOG_BTN_SAVE_AS,text:dt.SAVE_AS},{className:ct.DIALOG_BTN_CLASS_NORMAL,id:ct.DIALOG_BTN_CANCEL,text:dt.CANCEL},{className:ct.DIALOG_BTN_CLASS_PRIMARY,id:ct.DIALOG_BTN_OK,text:dt.SAVE_AND_OVERWRITE}]).done(function(t){t===ct.DIALOG_BTN_CANCEL?o.reject():t===ct.DIALOG_BTN_OK?_(e,!0).then(o.resolve,o.reject):t===ct.DIALOG_BTN_SAVE_AS&&Ot({doc:e}).then(o.resolve,o.reject)})}function i(){it.writeText(a,e.getText(!0),t).done(function(){e.notifySaved(),o.resolve(a)}).fail(function(e){e===rt.CONTENTS_MODIFIED?r():n(e)})}var o=new $.Deferred,a=e.file;return e.isDirty?e.keepChangesTime?e.file.stat(function(n,r){n||e.keepChangesTime!==r.mtime.getTime()||(t=!0),i()}):i():o.resolve(a),o.always(function(){et.focusActivePane()}),o.promise()}function b(e,t){var n=new $.Deferred;return it.readAsText(e.file).done(function(t,r){e.refreshText(t,r),n.resolve()}).fail(function(r){t?n.resolve():it.showFileOpenError(r,e.file.fullPath).done(function(){n.reject(r)})}),n.promise()}function E(e,t){function n(n){function i(){var e=tt.getActiveEditor();e&&t&&(e.setSelections(t.selections),e.setScrollPos(t.scrollPos.x,t.scrollPos.y)),a.resolve(s)}function o(){var t;if(ot.getFileSelectionFocus()===ot.PROJECT_MANAGER)t=ot.openAndSelectDocument(n,ot.PROJECT_MANAGER);else{var r=et.findInAllWorkingSets(e.file.fullPath).shift();et._removeView(r.paneId,e.file,!0),t=d({fullPath:n,paneId:r.paneId,index:r.index,forceRedraw:!0})}t.always(function(){i()})}var s;return n===r?void _(e).then(a.resolve,a.reject):(e.isSaving=!0,s=nt.getFileForPath(n),void it.writeText(s,e.getText(),!0).done(function(){e.isDirty&&!e.isUntitled()?b(e).always(o):o()}).fail(function(e){y(e,n).done(function(){a.reject(e)})}).always(function(){e.isSaving=!1}))}var r,i,o,a=new $.Deferred;if(e){if(r=e.file.fullPath,e.isUntitled()){var s=et.findInAllWorkingSets(r).shift();s&&et._open(s.paneId,e.file),i=J.getProjectRoot().fullPath}else i=it.getDirectoryPath(r);o=it.getBaseName(r),nt.showSaveDialog(dt.SAVE_FILE_AS,i,o,function(e,t){e?a.reject(e):t?n(t):a.reject(Mt)})}else a.reject();return a.promise()}function w(e){var t,n=tt.getActiveEditor(),r=n&&n.document,i=e&&e.doc||r;return i&&!i.isSaving?i.isUntitled()?(i===r&&(t={selections:n.getSelections(),scrollPos:n.getScrollPos()}),E(i,t)):_(i):$.Deferred().reject().promise()}function S(e){var t=!1,n=[];return lt.doSequentially(e,function(e){if(t)return(new $.Deferred).reject().promise();var r=Z.getOpenDocumentForPath(e.fullPath);if(r){var i=w({doc:r});return i.done(function(e){n.push(e)}).fail(function(e){e===Mt&&(t=!0)}),i}return n.push(e),(new $.Deferred).resolve().promise()},!1).then(function(){return n})}function C(){return S(et.getWorkingSet(et.ALL_PANES))}function I(){return C()}function k(e){function t(e){r||et._close(o,e)}var n,r,i,o=et.ACTIVE_PANE;e&&(n=e.file,r=e.promptOnly,i=e._forceClose,o=e.paneId||o);var a=new $.Deferred,s=a.promise();if(n||(n=et.getCurrentlyViewedFile(et.ACTIVE_PANE)),!n)return a.resolve(),s;var l=Z.getOpenDocumentForPath(n.fullPath);if(l&&l.isDirty&&!i){var c=it.getBaseName(l.file.fullPath);ct.showModalDialog(ut.DIALOG_ID_SAVE_CLOSE,dt.SAVE_CLOSE_TITLE,st.format(dt.SAVE_CLOSE_MESSAGE,st.breakableUrl(c)),[{className:ct.DIALOG_BTN_CLASS_LEFT,id:ct.DIALOG_BTN_DONTSAVE,text:dt.DONT_SAVE},{className:ct.DIALOG_BTN_CLASS_NORMAL,id:ct.DIALOG_BTN_CANCEL,text:dt.CANCEL},{className:ct.DIALOG_BTN_CLASS_PRIMARY,id:ct.DIALOG_BTN_OK,text:dt.SAVE}]).done(function(e){if(e===ct.DIALOG_BTN_CANCEL)a.reject();else if(e===ct.DIALOG_BTN_OK)w({doc:l}).done(function(e){t(e),a.resolve()}).fail(function(){a.reject()});else if(t(n),r)a.resolve();else{var i=!Z.getOpenDocumentForPath(n.fullPath);b(l,i).then(a.resolve,a.reject)}}),a.always(function(){et.focusActivePane()})}else t(n),et.focusActivePane(),a.resolve();return s}function x(e,t,n){var i=new $.Deferred,o=[];if(e.forEach(function(e){var t=Z.getOpenDocumentForPath(e.fullPath);t&&t.isDirty&&o.push(t)}),0===o.length||n)i.resolve();else if(1===o.length){var a={file:o[0].file,promptOnly:t};k(a).done(function(){i.resolve()}).fail(function(){i.reject()})}else{var s=dt.SAVE_CLOSE_MULTI_MESSAGE+it.makeDialogFileList(G.map(o,r));ct.showModalDialog(ut.DIALOG_ID_SAVE_CLOSE,dt.SAVE_CLOSE_TITLE,s,[{className:ct.DIALOG_BTN_CLASS_LEFT,id:ct.DIALOG_BTN_DONTSAVE,text:dt.DONT_SAVE},{className:ct.DIALOG_BTN_CLASS_NORMAL,id:ct.DIALOG_BTN_CANCEL,text:dt.CANCEL},{className:ct.DIALOG_BTN_CLASS_PRIMARY,id:ct.DIALOG_BTN_OK,text:dt.SAVE}]).done(function(t){t===ct.DIALOG_BTN_CANCEL?i.reject():t===ct.DIALOG_BTN_OK?S(e).done(function(e){i.resolve(e)}).fail(function(){i.reject()}):i.resolve()})}return i.done(function(n){n=n||e,t||et._closeList(et.ALL_PANES,n)}),i.promise()}function T(e){return x(et.getAllOpenFiles(),e&&e.promptOnly,e&&e._forceClose)}function D(e){return x(e.fileList)}function M(e,t,n){return At?(new $.Deferred).reject().promise():X.execute(Y.FILE_CLOSE_ALL,{promptOnly:!0}).done(function(){At=!0;try{$(J).triggerHandler("beforeAppClose")}catch(e){console.error(e)}ft.savePreferences(),ft.finalize().always(t)}).fail(function(){At=!1,n&&n()})}function O(){At=!1}function L(){$(pt).triggerHandler("beforeMenuPopup")}function R(e){return M(e,function(){window.close()},function(){brackets.app.abortQuit()})}function A(){var e=J.getContext();e||(e=et.getCurrentlyViewedFile()),e&&J.renameItemInline(e)}function N(e){return M(e,function(){brackets.app.quit()},function(){brackets.app.abortQuit()})}function P(e){e.keyCode===mt.DOM_VK_CONTROL&&(et.endTraversal(),Nt=!1,$(window.document.body).off("keyup",P))}function F(e){var t=et.traverseToNextViewByMRU(e);if(t){var n=t.file,r=t.paneId;et.beginTraversal(),X.execute(Y.FILE_OPEN,{fullPath:n.fullPath,paneId:r}),Nt||(Nt=!0,$(window.document.body).keyup(P))}}function U(){F(1)}function j(){F(-1)}function V(){J.showInTree(et.getCurrentlyViewedFile(et.ACTIVE_PANE))}function B(){var e=J.getSelectedItem();e.isDirectory?ct.showModalDialog(ut.DIALOG_ID_EXT_DELETED,dt.CONFIRM_FOLDER_DELETE_TITLE,st.format(dt.CONFIRM_FOLDER_DELETE,st.breakableUrl(e.name)),[{className:ct.DIALOG_BTN_CLASS_NORMAL,id:ct.DIALOG_BTN_CANCEL,text:dt.CANCEL},{className:ct.DIALOG_BTN_CLASS_PRIMARY,id:ct.DIALOG_BTN_OK,text:dt.DELETE}]).done(function(t){t===ct.DIALOG_BTN_OK&&J.deleteItem(e)}):J.deleteItem(e)}function W(){var e=J.getSelectedItem();e&&brackets.app.showOSFolder(e.fullPath,function(t){t&&console.error("Error showing '"+e.fullPath+"' in OS folder:",t)})}function H(){var e=new $.Deferred;if(brackets.inBrowser)e.resolve();else{var t=brackets.app.getRemoteDebuggingPort?brackets.app.getRemoteDebuggingPort():9234;gt.getDebuggableWindows("127.0.0.1",t).fail(e.reject).done(function(t){var n=t[0];if(!n||!n.webSocketDebuggerUrl)return void e.reject();var r=new WebSocket(n.webSocketDebuggerUrl);r.onopen=function(){r.send(JSON.stringify({id:1,method:"Network.setCacheDisabled",params:{cacheDisabled:!0}}))},r.onmessage=function(){r.close(),e.resolve()},r.onerror=e.reject})}return e.promise()}function q(e){return Dt?void 0:(Dt=!0,X.execute(Y.FILE_CLOSE_ALL,{promptOnly:!0}).done(function(){try{$(J).triggerHandler("beforeAppClose")}catch(t){console.error(t)}H().always(function(){G.forEach(vt.getAllMenus(),function(e,t){vt.removeMenu(t)});var t=e.indexOf("#");-1!==t&&(e=e.substr(0,t)),window.location.href=e})}).fail(function(){Dt=!1}))}function z(e){var t=window.location.href,n=new yt;n.parse(),e?n.get("reloadWithoutUserExts")||n.put("reloadWithoutUserExts",!0):n.get("reloadWithoutUserExts")&&n.remove("reloadWithoutUserExts"),-1!==t.indexOf("?")&&(t=t.substring(0,t.indexOf("?"))),n.isEmpty()||(t+="?"+n.toString()),window.setTimeout(function(){q(t)},100)}var G=e("thirdparty/lodash"),K=e("utils/AppInit"),X=e("command/CommandManager"),Y=e("command/Commands"),Q=e("utils/DeprecationWarning"),J=e("project/ProjectManager"),Z=e("document/DocumentManager"),et=e("view/MainViewManager"),tt=e("editor/EditorManager"),nt=e("filesystem/FileSystem"),rt=e("filesystem/FileSystemError"),it=e("file/FileUtils"),ot=e("project/FileViewController"),at=e("document/InMemoryFile"),st=e("utils/StringUtils"),lt=e("utils/Async"),ct=e("widgets/Dialogs"),ut=e("widgets/DefaultDialogs"),dt=e("strings"),pt=e("widgets/PopUpManager"),ft=e("preferences/PreferencesManager"),ht=e("utils/PerfUtils"),mt=e("utils/KeyEvent"),gt=e("LiveDevelopment/Inspector/Inspector"),vt=e("command/Menus"),yt=e("utils/UrlParams").UrlParams,_t=e("widgets/StatusBar"),bt=e("view/WorkspaceManager"),Et=null,wt=null,St=null,Ct=null,It="mac"!==brackets.platform?"{0} - {1}":"{0} — {1}",kt=null,xt=null,Tt=1,Dt=!1,Mt={userCanceled:!0};ft.definePreference("defaultExtension","string","");var Ot,Lt=null,Rt=!1;Ot=function(e){var t,n=null;if(e)n=e.doc;else{var r=tt.getActiveEditor();r&&(n=r.document,t={},t.selections=r.getSelections(),t.scrollPos=r.getScrollPos())}return E(n,t)};var At=!1,Nt=!1,Pt=G.partial(z,!0);K.htmlReady(function(){var e=new yt,t=$("#toolbar-extension-manager"),n=$("<div>"+dt.STATUSBAR_USER_EXTENSIONS_DISABLED+"</div>");e.parse(),"true"===e.get("reloadWithoutUserExts")&&(X.get(Y.FILE_EXTENSION_MANAGER).setEnabled(!1),t.css({display:"none"}),_t.addIndicator("status-user-exts",n,!0),console.log("Brackets reloaded with extensions disabled")),kt=$("#titlebar"),St=$(".title-wrapper",kt),Et=$(".title",St),wt=$(".dirty-dot",St)}),t._parseDecoratedPath=l;var Ft=dt.CMD_QUIT,$t=dt.CMD_SHOW_IN_OS;"win"===brackets.platform?(Ft=dt.CMD_EXIT,$t=dt.CMD_SHOW_IN_EXPLORER):"mac"===brackets.platform&&($t=dt.CMD_SHOW_IN_FINDER),X.register(dt.CMD_ADD_TO_WORKING_SET,Y.FILE_ADD_TO_WORKING_SET,p),X.register(dt.CMD_FILE_OPEN,Y.FILE_OPEN,u),X.register(dt.CMD_ADD_TO_WORKING_SET,Y.CMD_ADD_TO_WORKINGSET_AND_OPEN,d),X.register(dt.CMD_FILE_OPEN,Y.CMD_OPEN,c),X.register(dt.CMD_FILE_NEW_UNTITLED,Y.FILE_NEW_UNTITLED,m),X.register(dt.CMD_FILE_NEW,Y.FILE_NEW,g),X.register(dt.CMD_FILE_NEW_FOLDER,Y.FILE_NEW_FOLDER,v),X.register(dt.CMD_FILE_SAVE,Y.FILE_SAVE,w),X.register(dt.CMD_FILE_SAVE_ALL,Y.FILE_SAVE_ALL,I),X.register(dt.CMD_FILE_SAVE_AS,Y.FILE_SAVE_AS,Ot),X.register(dt.CMD_FILE_RENAME,Y.FILE_RENAME,A),X.register(dt.CMD_FILE_DELETE,Y.FILE_DELETE,B),X.register(dt.CMD_FILE_CLOSE,Y.FILE_CLOSE,k),X.register(dt.CMD_FILE_CLOSE_ALL,Y.FILE_CLOSE_ALL,T),X.register(dt.CMD_FILE_CLOSE_LIST,Y.FILE_CLOSE_LIST,D),X.register(dt.CMD_NEXT_DOC,Y.NAVIGATE_NEXT_DOC,U),X.register(dt.CMD_PREV_DOC,Y.NAVIGATE_PREV_DOC,j),X.register($t,Y.NAVIGATE_SHOW_IN_OS,W),X.register(Ft,Y.FILE_QUIT,N),X.register(dt.CMD_SHOW_IN_TREE,Y.NAVIGATE_SHOW_IN_FILE_TREE,V),X.registerInternal(Y.APP_ABORT_QUIT,O),X.registerInternal(Y.APP_BEFORE_MENUPOPUP,L),X.registerInternal(Y.FILE_CLOSE_WINDOW,R),X.registerInternal(Y.APP_RELOAD,z),X.registerInternal(Y.APP_RELOAD_WITHOUT_EXTS,Pt),$(Z).on("dirtyFlagChange",o),$(Z).on("fileNameChange",i),$(et).on("currentFileChange",i),$(J).on("beforeProjectClose",function(){Tt=1})}),define("text!htmlContent/code-hint-list.html",[],function(){return'{{#hints}}\n <li>\n <a href="#">\n <span class="codehint-item">{{{formattedHint}}}</span>\n </a>\n </li>\n{{/hints}}'}),define("editor/CodeHintList",["require","exports","module","command/Menus","utils/StringUtils","widgets/PopUpManager","utils/ViewUtils","command/KeyBindingManager","utils/KeyEvent","text!htmlContent/code-hint-list.html"],function(e,t){function n(e,t){this.hints=[],this.selectedIndex=-1,this.maxResults=999,this.opened=!1,this.editor=e,this.insertHintOnTab=t,this.pendingText="",this.handleSelect=null,this.handleClose=null,this.$hintMenu=$("<li class='dropdown codehint-menu'></li>").append($("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>").hide()).append("<ul class='dropdown-menu'></ul>"),this._keydownHook=this._keydownHook.bind(this)}var r=e("command/Menus"),i=e("utils/StringUtils"),o=e("widgets/PopUpManager"),a=e("utils/ViewUtils"),s=e("command/KeyBindingManager"),l=e("utils/KeyEvent"),c=e("text!htmlContent/code-hint-list.html");n.prototype._setSelectedIndex=function(e){var t=this.$hintMenu.find("li");if(e=Math.max(-1,Math.min(e,t.length-1)),-1!==this.selectedIndex&&$(t[this.selectedIndex]).find("a").removeClass("highlight"),this.selectedIndex=e,-1!==this.selectedIndex){var n=$(t[this.selectedIndex]),r=this.$hintMenu.find("ul.dropdown-menu");n.find("a").addClass("highlight"),a.scrollElementIntoView(r,n,!1)}},n.prototype.addPendingText=function(e){this.pendingText+=e},n.prototype.removePendingText=function(e){0===this.pendingText.indexOf(e)&&(this.pendingText=this.pendingText.slice(e.length))},n.prototype._buildListView=function(e){var t,n=this,r=e.match,o=e.selectInitial,a={hints:[]};if(this.hints=e.hints,this.hints.handleWideResults=e.handleWideResults,t=r?function(e){var t=e.replace(new RegExp(i.regexEscape(r),"i"),"<strong>$&</strong>");a.hints.push({formattedHint:"<span>"+t+"</span>"})}:function(e){a.hints.push({formattedHint:e.jquery?"":e})},this.$hintMenu.find("li").remove(),0===this.hints.length)this.handleClose&&this.handleClose();else{this.hints.some(function(e,r){return r>n.maxResults?!0:void t(e)});var s=this.$hintMenu.find("ul.dropdown-menu"),l=s.parent();s.remove().append(Mustache.render(c,a)),s.children("li").each(function(e,t){var r=n.hints[e],i=$(t);i.data("hint",r),r.jquery&&i.find(".codehint-item").append(r)}),s.on("click","li",function(e){e.stopPropagation(),n.handleSelect&&n.handleSelect($(this).data("hint"))}),this.hints.handleWideResults&&s.find("li a").addClass("wide-result"),l.append(s),this._setSelectedIndex(o?0:-1)}},n.prototype._calcHintListLocation=function(){var e=this.editor._codeMirror.cursorCoords(),t=e.bottom,n=e.left,r=this.editor.getTextHeight(),i=$(window),o=this.$hintMenu.children("ul"),a=o.outerHeight(),s=t+a-i.height();s>0&&(t-=r+2+a),t-=30;var l=o.width(),c=l,u=n+l-i.width();return u>0?n=Math.max(0,n-u):this.hints.handleWideResults&&(c=l+Math.abs(u)),{left:n,top:t,width:c}},n.prototype.isHandlingKeyCode=function(e){return e===l.DOM_VK_UP||e===l.DOM_VK_DOWN||e===l.DOM_VK_PAGE_UP||e===l.DOM_VK_PAGE_DOWN||e===l.DOM_VK_RETURN||e===l.DOM_VK_TAB&&this.insertHintOnTab},n.prototype._keydownHook=function(e){function t(e){var t,n=Math.min(i.hints.length,i.maxResults);i.selectedIndex<0?t=e>0?e-1:n-1:(t=i.selectedIndex,t=e>0?t===n-1?0:Math.min(t+e,n-1):0===t?n-1:Math.max(t+e,0)),i._setSelectedIndex(t)}function n(){var e,t=1,n=i.$hintMenu.find("li"),r=i.$hintMenu.find("ul.dropdown-menu");return 0!==n.length&&(e=$(n[0]).height(),e&&(t=Math.floor(r.height()/e),t=Math.max(1,Math.min(t,n.length)))),t}var r,i=this;if(!this.isOpen())return this.handleClose(),!1;if("keydown"===e.type&&this.isHandlingKeyCode(e.keyCode)){if(r=e.keyCode,e.shiftKey&&(e.keyCode===l.DOM_VK_UP||e.keyCode===l.DOM_VK_DOWN||e.keyCode===l.DOM_VK_PAGE_UP||e.keyCode===l.DOM_VK_PAGE_DOWN))return this.handleClose(),!1;if(r===l.DOM_VK_UP)t.call(this,-1);else if(r===l.DOM_VK_DOWN)t.call(this,1);else if(r===l.DOM_VK_PAGE_UP)t.call(this,-n());else if(r===l.DOM_VK_PAGE_DOWN)t.call(this,n());else{if(-1===this.selectedIndex||!(r===l.DOM_VK_RETURN||r===l.DOM_VK_TAB&&this.insertHintOnTab))return!1;if(this.pendingText)return!1;$(this.$hintMenu.find("li")[this.selectedIndex]).trigger("click")}return e.stopImmediatePropagation(),e.preventDefault(),!0}return!1},n.prototype.isOpen=function(){return this.opened&&!this.$hintMenu.hasClass("open")&&(this.opened=!1),this.opened},n.prototype.open=function(e){if(r.closeAll(),this._buildListView(e),this.hints.length){$("#codehint-menu-bar > ul").append(this.$hintMenu);var t=this._calcHintListLocation();this.$hintMenu.addClass("open").css({left:t.left,top:t.top,width:t.width+"px"}),this.opened=!0,o.addPopUp(this.$hintMenu,this.handleClose,!0),s.addGlobalKeydownHook(this._keydownHook)}},n.prototype.update=function(e){if(this.$hintMenu.addClass("apply-transition"),this._buildListView(e),this.hints.length){var t=this._calcHintListLocation();this.$hintMenu.css({left:t.left,top:t.top,width:t.width+"px"})}},n.prototype.close=function(){this.opened=!1,this.$hintMenu&&(this.$hintMenu.removeClass("open"),o.removePopUp(this.$hintMenu),this.$hintMenu.remove()),s.removeGlobalKeydownHook(this._keydownHook)},n.prototype.onSelect=function(e){this.handleSelect=e},n.prototype.onClose=function(e){this.handleClose=e},t.CodeHintList=n}),define("editor/CodeHintManager",["require","exports","module","command/Commands","command/CommandManager","editor/EditorManager","strings","utils/KeyEvent","editor/CodeHintList","preferences/PreferencesManager"],function(e,t){function n(e,t){return t.priority-e.priority}function r(e,t,r){var i={provider:e,priority:r||0};if(-1!==t.indexOf("all")){var o;for(o in k)k.hasOwnProperty(o)&&(k[o].push(i),k[o].sort(n))}else t.forEach(function(e){k[e]||(k[e]=Array.prototype.concat(k.all)),k[e].push(i),k[e].sort(n)})}function i(e,t){var n,r,i;i=Array.isArray(t)?t:t?[t]:Object.keys(k),i.forEach(function(t){for(r=k[t],n=0;n<r.length;n++)if(r[n].provider===e){r.splice(n,1);break}})}function o(e){var t=k[e]||k.all;return t.filter(function(e){var t="codehint."+e.provider.constructor.name;return I.get(t)!==!1})}function a(){M&&(M.close(),M=null,L=null,T=null,D=null,O&&(O.reject(),O=null))}function s(e){if(D){if(D===e&&(M.isOpen()||O&&"pending"===O.state()))return!0;a()}return!1}function l(){O&&(O.reject(),O=null);var e=T.getHints(x);if(x=null,e)if(e===!0){var t=D;a(),A(t)}else e.hasOwnProperty("hints")?M.isOpen()?M.update(e):M.open(e):(O=e,e.done(function(e){M&&(M.isOpen()?M.update(e):M.open(e))}));else a()}function c(e){e||(e=E.getFocusedEditor()),e&&(x=null,s(e)&&a(),A(e))}function u(e,t,n){L=t,n.ctrlKey||n.altKey||n.metaKey||n.keyCode!==S.DOM_VK_ENTER&&n.keyCode!==S.DOM_VK_RETURN&&n.keyCode!==S.DOM_VK_TAB||(x=String.fromCharCode(n.keyCode))}function d(e,t,n){L=t,x=String.fromCharCode(n.charCode),M&&M.addPendingText(x)}function p(e,t,n){L=t,s(t)&&(n.keyCode===S.DOM_VK_HOME||n.keyCode===S.DOM_VK_END?a():(n.keyCode===S.DOM_VK_LEFT||n.keyCode===S.DOM_VK_RIGHT||n.keyCode===S.DOM_VK_BACK_SPACE)&&l())}function f(e,t){s(t)&&t.getSelections().length>1&&a()}function h(e,t,n){if(x&&t===L){if(L=null,s(t)){var r=x;l(),s(t)||(x=r,A(t))}else A(t);if(M&&n[0]&&n[0].text.length&&n[0].text[0].length){var i=t.getCursorPos().ch-n[0].from.ch,o=n[0].text[0];o.length>i&&(o=o.substr(0,i)),M.removePendingText(o)}}}function m(e,t){return e&&e===t}function g(){return M&&M.isOpen()}function v(){return M}function y(e,t,n){t&&($(t).on("editorChange",h),$(t).on("keydown",u),$(t).on("keypress",d),$(t).on("keyup",p),$(t).on("cursorActivity",f)),n&&($(n).off("editorChange",h),$(n).off("keydown",u),$(n).off("keypress",d),$(n).off("keyup",p),$(n).off("cursorActivity",f))}var _=e("command/Commands"),b=e("command/CommandManager"),E=e("editor/EditorManager"),w=e("strings"),S=e("utils/KeyEvent"),C=e("editor/CodeHintList").CodeHintList,I=e("preferences/PreferencesManager"),k={all:[]},x=null,T=null,D=null,M=null,O=null,L=null,R=!0;I.definePreference("showCodeHints","boolean",!0),I.definePreference("insertHintOnTab","boolean",!1),I.on("change","showCodeHints",function(){R=I.get("showCodeHints")});var A;A=function(e){if(R&&!(e.getSelections().length>1)){var t=e.getLanguageForSelection(),n=o(t.getId());if(n.some(function(t){return t.provider.hasHints(e,x)?(T=t.provider,!0):void 0}),T){var r;r=void 0!==T.insertHintOnTab?T.insertHintOnTab:I.get("insertHintOnTab"),D=e,M=new C(D,r),M.onSelect(function(e){var t=T.insertHint(e),n=D;a(),t&&A(n)}),M.onClose(a),l()}else x=null}},y(null,E.getActiveEditor(),null),$(E).on("activeEditorChange",y),$(b).on("beforeExecuteCommand",a),b.register(w.CMD_SHOW_CODE_HINTS,_.SHOW_CODE_HINTS,c),t._getCodeHintList=v,t._removeHintProvider=i,t.isOpen=g,t.registerHintProvider=r,t.hasValidExclusion=m}),define("text!htmlContent/main-view.html",[],function(){return'<!-- \n Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.\n \n Permission is hereby granted, free of charge, to any person obtaining a\n copy of this software and associated documentation files (the "Software"), \n to deal in the Software without restriction, including without limitation \n the rights to use, copy, modify, merge, publish, distribute, sublicense, \n and/or sell copies of the Software, and to permit persons to whom the \n Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \n DEALINGS IN THE SOFTWARE.\n-->\n\n\n<!--\n HTML template for the body tag of index.html. It is rendered dynamically in\n brackets.js with Mustache and localized with the i18n RequireJS plugin.\n\n LOCALIZATION NOTE:\n All display text for this file must use templating so the text can be localized.\n \n English text goes in src/nls/root/strings.js. All other translations go in the strings.js file for\n the specific local in the nls folder. If a translation is missing for a specific key English\n is used as a fallback\n\n Strings should be referenced using the double brackets syntax.\n Example: {{keyname}}. Note, all strings are HTML escaped unless the form \n {{&keyname}} is used.\n\n-->\n\n <!-- Main UI: horizontal set of sidebar, main content vertical stack, and vertical toolbar -->\n <div class="main-view">\n <div id="sidebar" class="sidebar panel quiet-scrollbars horz-resizable right-resizer collapsible" data-minsize="0" data-forceleft=".content">\n <div class="working-set-splitview-btn btn-alt-quiet"></div>\n <div class="working-set-option-btn btn-alt-quiet"></div>\n \n <div id="working-set-list-container">\n \n </div>\n <div id="project-files-header">\n <span id="project-title" class="title"></span>\n </div>\n <div id="project-files-container">\n <!-- This will contain a dynamically generated <ul> hierarchy at runtime -->\n </div>\n </div>\n \n <!--\n Vertical stack of titlebar (in-browser), editor, bottom panels, status bar\n (status bar is injected later - see StatusBar.init()).\n Note: all children must be in a vertical stack with heights explicitly set in a fixed\n unit such as px (not percent/em/auto). If you change the height later, you must\n call WorkspaceManager.recomputeLayout() each time. Otherwise the layout will\n not get set correctly. Use WorkspaceManager to have this managed for you automatically.\n -->\n <div class="content">\n <!-- Horizontal titlebar containing menus & filename when inBrowser -->\n <div id="titlebar" class="toolbar no-focus">\n <!-- Menu bar -->\n <ul class="nav" data-dropdown="dropdown">\n </ul>\n \n <!-- Filename label -->\n <div class="title-wrapper">\n <span class="title"></span>&nbsp;<span class=\'dirty-dot\' style="visibility:hidden;">•</span>\n </div>\n </div>\n \n <div id="editor-holder">\n <!-- View Panes are programatically created here -->\n </div>\n \n <!-- Bottom panels and status bar are programmatically created here -->\n \n </div>\n\n <!-- Vertical toolbar docked to right -->\n <div id="main-toolbar" class="toolbar no-focus">\n <!-- Top-aligned buttons -->\n <div class="buttons">\n <a id="toolbar-go-live" href="#"></a> <!-- tooltip for this is set in JS -->\n <a id="toolbar-extension-manager" title="{{EXTENSION_MANAGER_TITLE}}" href="#"></a>\n <a id="update-notification" title="{{UPDATE_NOTIFICATION_TOOLTIP}}" href="#" style="display: none"></a>\n </div>\n <div class="bottom-buttons"></div>\n </div>\n \n <!-- Hack to ensure that the code editor\'s web font is loaded early. -->\n <!-- For more info, see note in brackets.less for class .dummy-text, or issue 76 -->\n <div class="dummy-text">x</div>\n </div>\n\n <!-- Modal Windows -->\n <div id="context-menu-bar">\n <ul data-dropdown="dropdown"></ul>\n </div>\n <div id="codehint-menu-bar">\n <ul data-dropdown="dropdown"></ul>\n </div>\n <div id="hidden-editors"></div>'
27}),define("utils/NodeConnection",["require","exports","module","socket.io"],function(e,t,n){function r(e,t){var n=setTimeout(function(){e.reject("timeout")},t);e.always(function(){clearTimeout(n)})}function i(){var t=$.Deferred(),n=null,i=null;return r(t,s),brackets.app.getNodeState(function(r,o){!r&&o&&"rejected"!==t.state()?(n=o,i=e("socket.io").connect("/brackets-ext"),i.connected?t.resolveWith(null,[i,n]):(i.on("connect",function(){console.log("Socket on /brackets-ext connected!"),t.resolveWith(null,[i,n])}),i.on("error",function(e){t.reject(e)}))):t.reject("brackets.app.getNodeState error: "+r)}),t.promise()}function o(){this.domains={},this._registeredModules=[],this._pendingInterfaceRefreshDeferreds=[],this._pendingCommandDeferreds=[]}var a=10,s=1e4,l=500,c=4294967295;o.prototype.domains=null,o.prototype._registeredModules=null,o.prototype._ws=null,o.prototype._port=null,o.prototype._commandCount=1,o.prototype._autoReconnect=!1,o.prototype._pendingInterfaceRefreshDeferreds=null,o.prototype._pendingCommandDeferreds=null,o.prototype._getNextCommandID=function(){var e;return e=this._commandCount>c?this._commandCount=0:this._commandCount++},o.prototype._cleanup=function(){if(this.domains={},this._ws&&this._ws.connected)try{this._ws.disconnect()}catch(e){}var t=this._pendingInterfaceRefreshDeferreds.concat(this._pendingCommandDeferreds);t.forEach(function(e){e.reject("cleanup")}),this._pendingInterfaceRefreshDeferreds=[],this._pendingCommandDeferreds=[],this._ws=null,this._port=null},o.prototype.connect=function(e){function t(e,t){function n(){r._ws.onclose=function(){if(r._autoReconnect){var e=r.connect(!0);$(r).triggerHandler("close",[e])}else r._cleanup(),$(r).triggerHandler("close")},o.resolve()}function i(e){r._cleanup(),o.reject(e)}r._ws=e,r._port=t,r._ws.on("message",r._receive.bind(r)),r._refreshInterface().then(function(){r._registeredModules.length>0?r.loadDomains(r._registeredModules,!1).then(n,i):n()},i)}function n(){s++,c=new Date,i().then(t,function(){if(a>s){var e=new Date,t=Math.max(l-(e-c),1);setTimeout(n,t)}else o.reject("Max connection attempts reached")})}var r=this;r._autoReconnect=e;var o=$.Deferred(),s=0,c=null;return r._cleanup(),n(),o.promise()},o.prototype.connected=function(){return!(!this._ws||!this._ws.connected)},o.prototype.disconnect=function(){this._autoReconnect=!1,this._cleanup()},o.prototype.loadDomains=function(e,t){var n=$.Deferred();r(n,s);var i=e;return Array.isArray(e)||(i=[e]),t&&Array.prototype.push.apply(this._registeredModules,i),this.domains.base&&this.domains.base.loadDomainModulesFromPaths?(this.domains.base.loadDomainModulesFromPaths(i).then(function(e){e||n.reject("loadDomainModulesFromPaths failed")},function(e){n.reject("Unable to load one of the modules: "+i+(e?", reason: "+e:""))}),this._pendingInterfaceRefreshDeferreds.push(n)):n.reject("this.domains.base is undefined"),n.promise()},o.prototype._send=function(e){if(this.connected()){var t=null;if("string"==typeof e)t=e;else try{t=JSON.stringify(e)}catch(n){console.error("[NodeConnection] Unable to stringify message in order to send: "+n.message)}if(t)try{this._ws.send(t)}catch(r){console.error("[NodeConnection] Error sending message: "+r.message)}}else console.error("[NodeConnection] Not connected to node, unable to send.")},o.prototype._receive=function(e){var t,n=null,r=e;if(e instanceof ArrayBuffer){if(r.byteLength<4)return void console.error("[NodeConnection] received malformed binary message");var i=r.slice(0,4),o=r.slice(4),a=new Uint32Array(i),s=a[0];t={type:"commandResponse",message:{id:s,response:o}}}else try{t=JSON.parse(r)}catch(l){return void console.error("[NodeConnection] received malformed message",e,l.message)}switch(t.type){case"event":var c=$(this);"base"===t.message.domain&&"newDomains"===t.message.event&&this._refreshInterface(),c.triggerHandler(t.message.domain+"."+t.message.event,t.message.parameters),c.triggerHandler(t.message.domain+":"+t.message.event,t.message.parameters);break;case"commandResponse":n=this._pendingCommandDeferreds[t.message.id],n&&(n.resolveWith(this,[t.message.response]),delete this._pendingCommandDeferreds[t.message.id]);break;case"commandError":n=this._pendingCommandDeferreds[t.message.id],n&&(n.rejectWith(this,[t.message.message,t.message.stack]),delete this._pendingCommandDeferreds[t.message.id]);break;case"error":console.error("[NodeConnection] received error: "+t.message.message);break;default:console.error("[NodeConnection] unknown event type: "+t.type)}},o.prototype._refreshInterface=function(){function e(e){function r(e,t){return function(){var r=$.Deferred(),i=Array.prototype.slice.call(arguments,0),o=n._getNextCommandID();return n._pendingCommandDeferreds[o]=r,n._send({id:o,domain:e,command:t.name,parameters:i}),r}}n.domains={},n.domainEvents={},e.forEach(function(e){n.domains[e.domain]={},e.commands.forEach(function(t){n.domains[e.domain][t.name]=r(e.domain,t)}),n.domainEvents[e.domain]={},e.events.forEach(function(t){var r=t.parameters;n.domainEvents[e.domain][t.name]=r})}),t.resolve()}var t=$.Deferred(),n=this,r=this._pendingInterfaceRefreshDeferreds;return this._pendingInterfaceRefreshDeferreds=[],t.then(function(){r.forEach(function(e){e.resolve()})},function(e){r.forEach(function(t){t.reject(e)})}),this.connected()?$.getJSON("/brackets-ext/api").done(e).fail(function(e){t.reject(e)}):t.reject("Attempted to call _refreshInterface when not connected."),t.promise()},o._getConnectionTimeout=function(){return s},n.exports=o}),define("extensibility/Package",["require","exports","module","utils/AppInit","filesystem/FileSystem","file/FileUtils","utils/StringUtils","strings","utils/ExtensionLoader","utils/NodeConnection","preferences/PreferencesManager"],function(e,t,n){function r(e){return S.domains.extensionManager?e(S.domains.extensionManager):(new $.Deferred).reject("extensionManager domain is undefined").promise()}function i(e,t){return r(function(n){var r=new $.Deferred;return n.validate(e,t).done(function(e){r.resolve({errors:e.errors,metadata:e.metadata})}).fail(function(e){r.reject(e)}),r.promise()})}function o(e,t,n){return r(function(r){var i=new $.Deferred,o=b.getUserExtensionPath(),a=o.replace(/\/user$/,"/disabled"),s=v.getNativeBracketsDirectoryPath()+"/extensions/default/",l=n?"update":"install";return r[l](e,o,{disabledDirectory:a,systemExtensionDirectory:s,apiVersion:brackets.metadata.apiVersion,nameHint:t}).done(function(e){e.keepFile=!1,e.installationStatus!==I.INSTALLED||n?i.resolve(e):b.loadExtension(e.name,{baseUrl:v.convertWindowsPathToUnixPath(e.installedTo)},"main").then(function(){i.resolve(e)},function(){i.reject(C.ERROR_LOADING)})}).fail(function(e){i.reject(e)}),i.promise()})}function a(e){if("github.com"===e.parsed.hostname||"www.github.com"===e.parsed.hostname){var t=/^\/[^\/?]+\/([^\/?]+)(\/?)$/.exec(e.parsed.pathname);t?(t[2]||(e.url+="/"),e.url+="archive/master.zip",e.filenameHint=t[1]+".zip"):(t=/^\/[^\/?]+\/([^\/?]+)\/archive\/master.zip$/.exec(e.parsed.pathname),t&&(e.filenameHint=t[1]+".zip"))}}function s(e,t){return r(function(n){var r=new $.Deferred,i=PathUtils.parseUrl(e);if(!i.hostname)return r.reject(C.MALFORMED_URL),r.promise();if("http:"!==i.protocol&&"https:"!==i.protocol)return r.reject(C.UNSUPPORTED_PROTOCOL),r.promise();var o={url:e,parsed:i,filenameHint:i.filename};a(o);var s=o.filenameHint;s=s.replace(/[^a-zA-Z0-9_\- \(\)\.]/g,"_"),s||(s="extension.zip");var l=n.downloadFile(t,o.url,w.get("proxy"));return l.done(function(e){r.resolve({localPath:v.convertWindowsPathToUnixPath(e),filenameHint:o.filenameHint})}).fail(function(e){r.reject(e)}),r.promise()})}function l(e){return r(function(t){return t.abortDownload(e)})}function c(e,t){var n=new $.Deferred;return o(e,t).done(function(e){e.keepFile=!0;var t=e.installationStatus;t===I.ALREADY_INSTALLED||t===I.NEEDS_UPDATE||t===I.SAME_VERSION||t===I.OLDER_VERSION?n.resolve(e):e.errors&&e.errors.length>0?n.reject(e.errors[0]):e.disabledReason?n.reject(e.disabledReason):n.resolve(e)}).fail(function(e){n.reject(e)}),n.promise()}function u(e){var t=1,n=2,r=3,i=4,o=new $.Deferred,a=t,u=x++;return s(e,u).done(function(e){a=n,c(e.localPath,e.filenameHint).done(function(t){var n=t.installationStatus;a=r,t.localPath=e.localPath,t.keepFile=!1,n===I.INSTALLED&&g.getFileForPath(e.localPath).unlink(),o.resolve(t)}).fail(function(t){a=i,g.getFileForPath(e.localPath).unlink(),o.reject(t)})}).fail(function(e){a=i,o.reject(e)}),{promise:o.promise(),cancel:function(){a===t&&l(u)}}}function d(e){function t(e){return _[e]?_[e]:(console.log("Unknown installation error",e),_.UNKNOWN_ERROR)}return Array.isArray(e)?(e[0]=t(e[0]),y.format.apply(window,e)):t(e)}function p(e){return r(function(t){return t.remove(e)})}function f(e,t){var n=new $.Deferred;return o(e,t,!0).done(function(e){e.installationStatus!==I.INSTALLED?n.reject(e.errors):n.resolve(e)}).fail(function(e){n.reject(e)}),n.promise()}function h(){return k}var m=e("utils/AppInit"),g=e("filesystem/FileSystem"),v=e("file/FileUtils"),y=e("utils/StringUtils"),_=e("strings"),b=e("utils/ExtensionLoader"),E=e("utils/NodeConnection"),w=e("preferences/PreferencesManager");w.definePreference("proxy","string",void 0);var S,C={ERROR_LOADING:"ERROR_LOADING",MALFORMED_URL:"MALFORMED_URL",UNSUPPORTED_PROTOCOL:"UNSUPPORTED_PROTOCOL"},I={FAILED:"FAILED",INSTALLED:"INSTALLED",ALREADY_INSTALLED:"ALREADY_INSTALLED",SAME_VERSION:"SAME_VERSION",OLDER_VERSION:"OLDER_VERSION",NEEDS_UPDATE:"NEEDS_UPDATE",DISABLED:"DISABLED"},k=$.Deferred(),x=0;m.appReady(function(){S=new E,S.connect(!0).then(function(){var e=v.getNativeBracketsDirectoryPath()+"/"+v.getNativeModuleDirectoryPath(n)+"/node/ExtensionManagerDomain";S.loadDomains(e,!0).then(function(){k.resolve()},function(){console.error("[Extensions] Failed to connect to node",arguments),k.reject()})})}),t._getNodeConnectionDeferred=h,t.installFromURL=u,t.installFromPath=c,t.validate=i,t.install=o,t.remove=p,t.installUpdate=f,t.formatError=d,t.InstallationStatuses=I}),define("view/ViewCommandHandlers",["require","exports","module","command/Commands","command/CommandManager","strings","utils/StringUtils","editor/EditorManager","preferences/PreferencesManager","document/DocumentManager","view/ThemeSettings","view/MainViewManager","utils/AppInit","thirdparty/lodash"],function(e,t,n){function r(e){$("#"+e).remove()}function i(e,t,n,i,o){o=o||".CodeMirror";var a=$("<style type='text/css'></style>").attr("id",e),s=O.format("{0}: {1}{2}",t,n,i?" !important":"");a.html(o+"{ "+s+" }"),r(e),$("head").append(a)}function o(){r(V)}function a(e){i(V,"font-size",e,!0)}function s(){r(B)}function l(e){i(B,"font-family",e)}function c(e,t){var n=e._codeMirror.defaultCharWidth(),r=j.get("fontSize"),i=t,o=0,a=0,s=e.getScrollPos(),l=e._codeMirror.lineAtHeight(s.y,"local");o=/em$/.test(r)?10:1,a=parseInt((parseFloat(i)-parseFloat(r))*o,10),a&&e.refreshAll();var c=e._codeMirror.defaultCharWidth(),u=s.x/n,d=s.x+Math.round(u*(c-n)),p=e._codeMirror.heightAtLine(l,"local");e.setScrollPos(d,p)}function u(e){var n=j.get("fontSize");n!==e&&(o(),e&&a(e),U.forEach(P.getPaneIdList(),function(t){var n=P.getCurrentlyViewedPath(t),r=n&&A.getOpenDocumentForPath(n);r&&r._masterEditor&&c(r._masterEditor,e)}),$(t).triggerHandler("fontSizeChange",[e,n]),j.set("fontSize",e))}function d(){return j.get("fontSize")}function p(e){var n=L.getCurrentFullEditor(),r=j.get("fontFamily");r!==e&&(s(),e&&l(e),$(t).triggerHandler("fontFamilyChange",[e,r]),j.set("fontFamily",e),n&&n.refreshAll())}function f(){return j.get("fontFamily")}function h(e){var t=j.get("fontSize"),n=/^[\d\.]+(px|em)$/;if(-1===t.search(n))return!1;var r=t.substring(t.length-2,t.length),i="px"===r?1:.1,o=parseFloat(t.substring(0,t.length-2)),a=o+i*e,s=a+r;return W*i>a||a>H*i?!1:(u(s),!0)}function m(){h(1)}function g(){h(-1)}function v(){u(q+"px")}function y(){null!==A.getCurrentDocument()?D.get(T.VIEW_INCREASE_FONT_SIZE).getEnabled()||(D.get(T.VIEW_INCREASE_FONT_SIZE).setEnabled(!0),D.get(T.VIEW_DECREASE_FONT_SIZE).setEnabled(!0),D.get(T.VIEW_RESTORE_FONT_SIZE).setEnabled(!0)):(D.get(T.VIEW_INCREASE_FONT_SIZE).setEnabled(!1),D.get(T.VIEW_DECREASE_FONT_SIZE).setEnabled(!1),D.get(T.VIEW_RESTORE_FONT_SIZE).setEnabled(!1))}function _(){l(j.get("fontFamily")),a(j.get("fontSize")),y()}function b(){var e=j.get("fontSize"),t=R.getViewState("fontSizeAdjustment");t&&(R.setViewState("fontSizeAdjustment"),e||(e=q+t+"px",j.set("fontSize",e))),e&&(o(),a(e))}function E(){p(z),u(q+"px")}function w(e,t,n){var r=t/e,i=(t+n)/e,o=Math.ceil(r),a=Math.floor(i)-1;return{first:o,last:a}}function S(e){var t,n,r=L.getCurrentFullEditor(),i=r.getTextHeight(),o=r.getCursorPos(),a=r.hasSelection(),s=r.getInlineWidgets(),l=r._codeMirror.getScrollInfo(),c=r._getLineSpaceElement().offsetTop,u=l.clientHeight,d=l.top-c,p=c;s.forEach(function(e){t=r._getInlineWidgetLineNumber(e),n=r._codeMirror.charCoords({line:t,ch:0},"local"),n.top<l.top?(d-=e.info.height,p+=e.info.height):n.top+e.info.height<l.top+u&&(u-=e.info.height)});var f=w(i,d,u);a||(o.line<f.first?r.setCursorPos({line:f.first+e,ch:o.ch}):o.line>f.last?r.setCursorPos({line:f.last+e,ch:o.ch}):(e>0&&o.line===f.first||0>e&&o.line===f.last)&&r._codeMirror.moveV(e,"line"));var h=f.first+e;r.setScrollPos(l.left,i*h+p)}function C(){S(-1)}function I(){S(1)}function k(){N.showDialog()}function x(e,t){return{fontSizeStyle:q+t+"px"}}var T=e("command/Commands"),D=e("command/CommandManager"),M=e("strings"),O=e("utils/StringUtils"),L=e("editor/EditorManager"),R=e("preferences/PreferencesManager"),A=e("document/DocumentManager"),N=e("view/ThemeSettings"),P=e("view/MainViewManager"),F=e("utils/AppInit"),U=e("thirdparty/lodash"),j=R.getExtensionPrefs("fonts"),V="codemirror-dynamic-fonts",B="codemirror-dynamic-font-family",W=1,H=72,q=12,z="'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace";D.register(M.CMD_INCREASE_FONT_SIZE,T.VIEW_INCREASE_FONT_SIZE,m),D.register(M.CMD_DECREASE_FONT_SIZE,T.VIEW_DECREASE_FONT_SIZE,g),D.register(M.CMD_RESTORE_FONT_SIZE,T.VIEW_RESTORE_FONT_SIZE,v),D.register(M.CMD_SCROLL_LINE_UP,T.VIEW_SCROLL_LINE_UP,C),D.register(M.CMD_SCROLL_LINE_DOWN,T.VIEW_SCROLL_LINE_DOWN,I),D.register(M.CMD_THEMES,T.CMD_THEMES_OPEN_SETTINGS,k),R.convertPreferences(n,{fontSizeAdjustment:"user"},!0,x),j.definePreference("fontSize","string",q+"px"),j.definePreference("fontFamily","string",z),$(P).on("currentFileChange",y),F.appReady(_),t.restoreFontSize=b,t.restoreFonts=E,t.getFontSize=d,t.setFontSize=u,t.getFontFamily=f,t.setFontFamily=p}),define("text!htmlContent/themes-settings.html",[],function(){return'<div class="theme-settings modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{Strings.THEMES_SETTINGS}}</h1>\n </div>\n <div class="modal-body">\n <form class="form-horizontal">\n <div class="control-group">\n <label class="control-label">{{Strings.CURRENT_THEME}}:</label>\n <div class="controls">\n <select>\n {{#themes}}\n <option style="text-align:left;" value="{{name}}" data-target="theme">{{displayName}}</option>\n {{/themes}}\n </select>\n </div>\n </div>\n\n <div class="control-group">\n <label class="control-label">{{Strings.USE_THEME_SCROLLBARS}}:</label>\n <div class="controls">\n {{#settings.themeScrollbars}}\n <input type="checkbox" data-target="themeScrollbars" checked>\n {{/settings.themeScrollbars}}\n {{^settings.themeScrollbars}}\n <input type="checkbox" data-target="themeScrollbars">\n {{/settings.themeScrollbars}}\n </div>\n </div>\n\n <div class="control-group">\n <label class="control-label">{{Strings.FONT_SIZE}}:</label>\n <div class="controls">\n <input type="text" data-target="fontSize" value="{{settings.fontSize}}">\n </div>\n </div>\n\n <div class="control-group">\n <label class="control-label">{{Strings.FONT_FAMILY}}:</label>\n <div class="controls">\n <input type="text" data-target="fontFamily" value="{{settings.fontFamily}}">\n </div>\n </div>\n </form>\n </div>\n <div class="modal-footer">\n <button class="dialog-button btn" data-button-id="cancel">{{Strings.CANCEL}}</button>\n <button class="dialog-button btn primary" data-button-id="save">{{Strings.DONE}}</button>\n </div>\n</div>\n'}),define("view/ThemeSettings",["require","exports","module","thirdparty/lodash","widgets/Dialogs","strings","view/ViewCommandHandlers","text!htmlContent/themes-settings.html","preferences/PreferencesManager"],function(e,t){function n(){var e={};return Object.keys(h).forEach(function(t){e[t]=p.get(t)}),e.fontFamily=c.getFontFamily(),e.fontSize=c.getFontSize(),e}function r(){var e=n(),t={},r=a.map(f,function(e){return e}),i=$("<div>").append(m).html(),o=$(Mustache.render(i,{settings:e,themes:r,Strings:l})),u=o.find("[value='"+e.theme+"']");0===u.length&&(u=o.find("[value='"+h.theme+"']")),u.attr("selected","selected"),o.find("[data-toggle=tab].default").tab("show"),o.on("change","[data-target]:checkbox",function(){var e=$(this),n=e.attr("data-target");t[n]=e.is(":checked")}).on("input","[data-target]:text",function(){var e=$(this),n=e.attr("data-target");t[n]=e.val()}).on("change",function(){var e=$(":selected",this),t=e.attr("data-target");t&&p.set(t,e.val())}),s.showModalDialogUsingTemplate(o).done(function(n){var r;"save"===n?Object.keys(t).forEach(function(e){h.hasOwnProperty(e)?p.set(e,t[e]):(r="set"+e[0].toLocaleUpperCase()+e.substr(1),"function"==typeof c[r]&&c[r](t[e]))}):"cancel"===n&&p.set("theme",e.theme)})}function i(e){f=e}function o(){p.set("theme",h.theme),p.set("themeScrollbars",h.themeScrollbars)}var a=e("thirdparty/lodash"),s=e("widgets/Dialogs"),l=e("strings"),c=e("view/ViewCommandHandlers"),u=e("text!htmlContent/themes-settings.html"),d=e("preferences/PreferencesManager"),p=d.getExtensionPrefs("themes"),f={},h={themeScrollbars:!0,theme:"light-theme"},m=$(u).addClass("themeSettings");p.definePreference("theme","string",h.theme),p.definePreference("themeScrollbars","boolean",h.themeScrollbars),t._setThemes=i,t.restore=o,t.showDialog=r}),define("view/ThemeView",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror","preferences/PreferencesManager"],function(e,t){function n(e){if(e=e||{},a.get("themeScrollbars")){var t=(e.scrollbar||[]).join(" ");s.text(t||"")}else s.text("")}function r(e){var t=a.get("theme"),n=(e.getOption("theme")||"").replace(/[\s]*/,"");n!==t&&(i.defaults.theme=t,e.setOption("theme",t))}var i=e("thirdparty/CodeMirror2/lib/codemirror"),o=e("preferences/PreferencesManager"),a=o.getExtensionPrefs("themes"),s=$("<style id='scrollbars'>").appendTo("head");t.updateScrollbars=n,t.updateThemes=r}),define("view/ThemeManager",["require","exports","module","thirdparty/lodash","filesystem/FileSystem","file/FileUtils","editor/EditorManager","utils/ExtensionUtils","view/ThemeSettings","view/ThemeView","preferences/PreferencesManager"],function(e,t){function n(e){var t=e.lastIndexOf(".");return e=e.substring(0,-1!==t?t:void 0).replace(/-/g," "),e.split(" ").map(function(e){return e[0].toUpperCase()+e.substring(1)}).join(" ")}function r(e,t){t=t||{};var r=e.name;t.name||(t.name=t.title?t.title:g.getFilenameWithoutExtension(r).replace(/\.min$/,""),t.name=t.name.toLocaleLowerCase().replace(/[\W]/g,"-")),this.file=e,this.name=t.name,this.displayName=t.title||n(r),this.dark=void 0!==t.theme&&t.theme.dark===!0}function i(e){var t=[];return e=e.replace(T,function(e){return t.push(e),""}),{content:e,scrollbar:t}}function o(e){return e.replace(/^([A-Z]+:)?\//,function(e){return e.toLocaleLowerCase()})}function a(e,t){var n=new $.Deferred,r=new less.Parser({rootpath:o(D),filename:o(t.file._path)});return r.parse("#editor-holder {"+e+"\n}",function(e,t){e?n.reject(e):n.resolve(t.toCSS())}),n.promise()}function s(e){var t=e._path;return h.find(S,function(e){return e.file._path===t})}function l(){return C||(C=S[w.get("theme")]||S[k]),C}function c(){return h.map(S,function(e){return e})}function u(){var e=l(),t=e&&g.readAsText(e.file).then(function(t){return a(t.replace(x,""),e)}).then(function(t){var n=i(t);return e.scrollbar=n.scrollbar,n.content}).then(function(t){return $("body").toggleClass("dark",e.dark),I.text(t),e});return $.when(t)}function d(e){e&&(C=null),$.when(e&&u()).done(function(){var e=v.getActiveEditor();if(e&&e._codeMirror){var t=e._codeMirror;b.updateThemes(t)}})}function p(e,t){var n=new $.Deferred,i=m.getFileForPath(e),o=w.get("theme");return i.exists(function(e,a){var s;a?(s=new r(i,t),S[s.name]=s,_._setThemes(S),o===s.name&&d(!0),n.resolve(s)):(e||!a)&&n.reject(e)}),n.promise()}function f(e){var t=e.path+"/"+e.metadata.theme.file;return p(t,e.metadata)}var h=e("thirdparty/lodash"),m=e("filesystem/FileSystem"),g=e("file/FileUtils"),v=e("editor/EditorManager"),y=e("utils/ExtensionUtils"),_=e("view/ThemeSettings"),b=e("view/ThemeView"),E=e("preferences/PreferencesManager"),w=E.getExtensionPrefs("themes"),S={},C=null,I=$(y.addEmbeddedStyleSheet("")),k="thor-light-theme",x=/\/\*([\s\S]*?)\*\//gm,T=/((?:[^}|,]*)::-webkit-scrollbar(?:[^{]*)[{](?:[^}]*?)[}])/gim,D=g.getNativeBracketsDirectoryPath()+"/styles/";w.on("change","theme",function(){C&&C.name===w.get("theme")||(d(!0),b.updateScrollbars(l()),$(t).trigger("themeChange",l()))}),w.on("change","themeScrollbars",function(){d(),b.updateScrollbars(l())}),m.on("change",function(e,t){t&&!t.isDirectory&&s(t)&&d(!0)}),$(v).on("activeEditorChange",function(){d()}),t.refresh=d,t.loadFile=p,t.loadPackage=f,t.getCurrentTheme=l,t.getAllThemes=c,t._toDisplayName=n,t._extractScrollbars=i}),function(e){function t(e,t){var n=t?F[et]:F[Q];return n.test(e)?new i(e,t):null}function n(e,n){var r=t(e,n);return r?r.version:null}function r(e,n){var r=t(e,n);return r?r.version:null}function i(e,t){if(e instanceof i){if(e.loose===t)return e;e=e.version}if(!(this instanceof i))return new i(e,t);this.loose=t;var n=e.trim().match(t?F[et]:F[Q]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.prerelease=n[4]?n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e}):[],this.build=n[5]?n[5].split("."):[],this.format()}function o(e,t,n){try{return new i(e,n).inc(t).version}catch(r){return null}}function a(e,t){var n=kt.test(e),r=kt.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:t>e?-1:e>t?1:0}function s(e,t){return a(t,e)}function l(e,t,n){return new i(e,n).compare(t)}function c(e,t){return l(e,t,!0)}function u(e,t,n){return l(t,e,n)}function d(t,n){return t.sort(function(t,r){return e.compare(t,r,n)})}function p(t,n){return t.sort(function(t,r){return e.rcompare(t,r,n)})}function f(e,t,n){return l(e,t,n)>0}function h(e,t,n){return l(e,t,n)<0}function m(e,t,n){return 0===l(e,t,n)}function g(e,t,n){return 0!==l(e,t,n)}function v(e,t,n){return l(e,t,n)>=0}function y(e,t,n){return l(e,t,n)<=0}function _(e,t,n,r){var i;switch(t){case"===":i=e===n;break;case"!==":i=e!==n;break;case"":case"=":case"==":i=m(e,n,r);break;case"!=":i=g(e,n,r);break;case">":i=f(e,n,r);break;case">=":i=v(e,n,r);break;case"<":i=h(e,n,r);break;case"<=":i=y(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return i}function b(e,t){if(e instanceof b){if(e.loose===t)return e;e=e.value}return this instanceof b?(this.loose=t,this.parse(e),void(this.value=this.semver===xt?"":this.operator+this.semver.version)):new b(e,t)}function E(e,t){if(e instanceof E&&e.loose===t)return e;if(!(this instanceof E))return new E(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function w(e,t){return new E(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function S(e,t){return e=x(e,t),e=I(e,t),e=D(e,t),e=O(e,t)}function C(e){return!e||"x"===e.toLowerCase()||"*"===e}function I(e,t){return e.trim().split(/\s+/).map(function(e){return k(e,t)}).join(" ")}function k(e,t){var n=t?F[pt]:F[dt];return e.replace(n,function(e,t,n,r,i){var o;return C(t)?o="":C(n)?o=">="+t+".0.0-0 <"+(+t+1)+".0.0-0":C(r)?o=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0":i?("-"!==i.charAt(0)&&(i="-"+i),o=">="+t+"."+n+"."+r+i+" <"+t+"."+(+n+1)+".0-0"):o=">="+t+"."+n+"."+r+"-0 <"+t+"."+(+n+1)+".0-0",o})}function x(e,t){return e.trim().split(/\s+/).map(function(e){return T(e,t)}).join(" ")}function T(e,t){var n=t?F[vt]:F[gt];return e.replace(n,function(e,t,n,r,i){var o;return C(t)?o="":C(n)?o=">="+t+".0.0-0 <"+(+t+1)+".0.0-0":C(r)?o="0"===t?">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0":">="+t+"."+n+".0-0 <"+(+t+1)+".0.0-0":i?("-"!==i.charAt(0)&&(i="-"+i),o="0"===t?"0"===n?"="+t+"."+n+"."+r+i:">="+t+"."+n+"."+r+i+" <"+t+"."+(+n+1)+".0-0":">="+t+"."+n+"."+r+i+" <"+(+t+1)+".0.0-0"):o="0"===t?"0"===n?"="+t+"."+n+"."+r:">="+t+"."+n+"."+r+"-0 <"+t+"."+(+n+1)+".0-0":">="+t+"."+n+"."+r+"-0 <"+(+t+1)+".0.0-0",o})}function D(e,t){return e.split(/\s+/).map(function(e){return M(e,t)}).join(" ")}function M(e,t){e=e.trim();var n=t?F[st]:F[at];return e.replace(n,function(e,t,n,r,i){var o=C(n),a=o||C(r),s=a||C(i),l=s;return"="===t&&l&&(t=""),t&&l?(o&&(n=0),a&&(r=0),s&&(i=0),">"===t&&(t=">=",o||(a?(n=+n+1,r=0,i=0):s&&(r=+r+1,i=0))),e=t+n+"."+r+"."+i+"-0"):o?e="*":a?e=">="+n+".0.0-0 <"+(+n+1)+".0.0-0":s&&(e=">="+n+"."+r+".0-0 <"+n+"."+(+r+1)+".0-0"),e})}function O(e){return e.trim().replace(F[Ct],"")}function L(e,t,n,r,i,o,a,s,l,c,u,d){return t=C(n)?"":C(r)?">="+n+".0.0-0":C(i)?">="+n+"."+r+".0-0":">="+t,s=C(l)?"":C(c)?"<"+(+l+1)+".0.0-0":C(u)?"<"+l+"."+(+c+1)+".0-0":d?"<="+l+"."+c+"."+u+"-"+d:"<="+s,(t+" "+s).trim()}function R(e,t){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;return!0}function A(e,t,n){try{t=new E(t,n)}catch(r){return!1}return t.test(e)}function N(e,t,n){return e.filter(function(e){return A(e,t,n)}).sort(function(e,t){return u(e,t,n)})[0]||null}function P(e,t){try{return new E(e,t).range||"*"}catch(n){return null}}"object"==typeof module&&module.exports===e&&(e=module.exports=i),e.SEMVER_SPEC_VERSION="2.0.0";var F=e.re=[],$=e.src=[],U=0,j=U++;$[j]="0|[1-9]\\d*";var V=U++;$[V]="[0-9]+";var B=U++;$[B]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var W=U++;$[W]="("+$[j]+")\\.("+$[j]+")\\.("+$[j]+")";var H=U++;$[H]="("+$[V]+")\\.("+$[V]+")\\.("+$[V]+")";var q=U++;$[q]="(?:"+$[j]+"|"+$[B]+")";var z=U++;$[z]="(?:"+$[V]+"|"+$[B]+")";var G=U++;$[G]="(?:-("+$[q]+"(?:\\."+$[q]+")*))";var K=U++;$[K]="(?:-?("+$[z]+"(?:\\."+$[z]+")*))";var X=U++;$[X]="[0-9A-Za-z-]+";var Y=U++;$[Y]="(?:\\+("+$[X]+"(?:\\."+$[X]+")*))";var Q=U++,J="v?"+$[W]+$[G]+"?"+$[Y]+"?";$[Q]="^"+J+"$";var Z="[v=\\s]*"+$[H]+$[K]+"?"+$[Y]+"?",et=U++;$[et]="^"+Z+"$";var tt=U++;$[tt]="((?:<|>)?=?)";var nt=U++;$[nt]=$[V]+"|x|X|\\*";var rt=U++;$[rt]=$[j]+"|x|X|\\*";var it=U++;$[it]="[v=\\s]*("+$[rt]+")(?:\\.("+$[rt]+")(?:\\.("+$[rt]+")(?:("+$[G]+"))?)?)?";var ot=U++;$[ot]="[v=\\s]*("+$[nt]+")(?:\\.("+$[nt]+")(?:\\.("+$[nt]+")(?:("+$[K]+"))?)?)?";var at=U++;$[at]="^"+$[tt]+"\\s*"+$[it]+"$";var st=U++;$[st]="^"+$[tt]+"\\s*"+$[ot]+"$";var lt=U++;$[lt]="(?:~>?)";var ct=U++;$[ct]="(\\s*)"+$[lt]+"\\s+",F[ct]=new RegExp($[ct],"g");var ut="$1~",dt=U++;$[dt]="^"+$[lt]+$[it]+"$";var pt=U++;$[pt]="^"+$[lt]+$[ot]+"$";var ft=U++;$[ft]="(?:\\^)";var ht=U++;$[ht]="(\\s*)"+$[ft]+"\\s+",F[ht]=new RegExp($[ht],"g");var mt="$1^",gt=U++;$[gt]="^"+$[ft]+$[it]+"$";var vt=U++;$[vt]="^"+$[ft]+$[ot]+"$";var yt=U++;$[yt]="^"+$[tt]+"\\s*("+Z+")$|^$";var _t=U++;$[_t]="^"+$[tt]+"\\s*("+J+")$|^$";var bt=U++;$[bt]="(\\s*)"+$[tt]+"\\s*("+Z+"|"+$[it]+")",F[bt]=new RegExp($[bt],"g");var Et="$1$2$3",wt=U++;$[wt]="^\\s*("+$[it]+")\\s+-\\s+("+$[it]+")\\s*$";var St=U++;$[St]="^\\s*("+$[ot]+")\\s+-\\s+("+$[ot]+")\\s*$";var Ct=U++;$[Ct]="(<|>)?=?\\s*\\*";for(var It=0;U>It;It++)F[It]||(F[It]=new RegExp($[It]));e.parse=t,e.valid=n,e.clean=r,e.SemVer=i,i.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},i.prototype.inspect=function(){return'<SemVer "'+this+'">'},i.prototype.toString=function(){return this.version},i.prototype.compare=function(e){return e instanceof i||(e=new i(e,this.loose)),this.compareMain(e)||this.comparePre(e)},i.prototype.compareMain=function(e){return e instanceof i||(e=new i(e,this.loose)),a(this.major,e.major)||a(this.minor,e.minor)||a(this.patch,e.patch)},i.prototype.comparePre=function(e){if(e instanceof i||(e=new i(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],r=e.prerelease[t];if(void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return a(n,r)}while(++t)},i.prototype.inc=function(e){switch(e){case"major":this.major++,this.minor=-1;case"minor":this.minor++,this.patch=-1;case"patch":this.patch++,this.prerelease=[];break;case"prerelease":if(0===this.prerelease.length)this.prerelease=[0];else{for(var t=this.prerelease.length;--t>=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this},e.inc=o,e.compareIdentifiers=a;var kt=/^[0-9]+$/;e.rcompareIdentifiers=s,e.compare=l,e.compareLoose=c,e.rcompare=u,e.sort=d,e.rsort=p,e.gt=f,e.lt=h,e.eq=m,e.neq=g,e.gte=v,e.lte=y,e.cmp=_,e.Comparator=b;var xt={};b.prototype.parse=function(e){var t=this.loose?F[yt]:F[_t],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],n[2]?(this.semver=new i(n[2],this.loose),"<"!==this.operator||this.semver.prerelease.length||(this.semver.prerelease=["0"],this.semver.format())):this.semver=xt},b.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'},b.prototype.toString=function(){return this.value},b.prototype.test=function(e){return this.semver===xt?!0:_(e,this.operator,this.semver,this.loose)},e.Range=E,E.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'},E.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?F[St]:F[wt];e=e.replace(n,L),e=e.replace(F[bt],Et),e=e.replace(F[ct],ut),e=e.replace(F[ht],mt),e=e.split(/\s+/).join(" ");var r=t?F[yt]:F[_t],i=e.split(" ").map(function(e){return S(e,t)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(e){return!!e.match(r)})),i=i.map(function(e){return new b(e,t)})},e.toComparators=w,E.prototype.test=function(e){if(!e)return!1;for(var t=0;t<this.set.length;t++)if(R(this.set[t],e))return!0;return!1},e.satisfies=A,e.maxSatisfying=N,e.validRange=P,"function"==typeof define&&define.amd&&define("extensibility/node/node_modules/semver/semver.browser",e)}("object"==typeof exports?exports:"function"==typeof define&&define.amd?{}:semver={}),define("extensibility/ExtensionManager",["require","exports","module","thirdparty/lodash","extensibility/Package","utils/Async","utils/ExtensionLoader","utils/ExtensionUtils","filesystem/FileSystem","strings","utils/StringUtils","view/ThemeManager","extensibility/node/node_modules/semver/semver.browser"],function(e,t){function n(e){var n=H[e];if(n&&n.installInfo&&n.registryInfo){n.installInfo.owner=n.registryInfo.owner,n.installInfo.updateAvailable=!1,n.registryInfo.updateAvailable=!1,n.installInfo.updateCompatible=!1,n.registryInfo.updateCompatible=!1;var r=n.installInfo.metadata?n.installInfo.metadata.version:null;
28if(r&&N.lt(r,n.registryInfo.metadata.version)){n.registryInfo.updateAvailable=!0,n.installInfo.updateAvailable=!0;var i=k.findLast(n.registryInfo.versions,function(e){return N.satisfies(brackets.metadata.apiVersion,e.brackets)});i&&i.version&&N.lt(r,i.version)&&(n.installInfo.updateCompatible=!0,n.registryInfo.updateCompatible=!0,n.installInfo.lastCompatibleVersion=i.version,n.registryInfo.lastCompatibleVersion=i.version)}$(t).triggerHandler("registryUpdate",[e])}}function r(e){var t=H[e];t.installInfo&&t.installInfo.metadata&&t.installInfo.metadata.theme&&A.loadPackage(t.installInfo)}function i(e){t.extensions=H=e,Object.keys(H).forEach(function(e){n(e)})}function o(){t.extensions=H={},q=[],z=[]}function a(){return P?P.promise():(P=new $.Deferred,$.ajax({url:brackets.config.extension_registry,dataType:"json",cache:!1}).done(function(e){Object.keys(e).forEach(function(t){H[t]||(H[t]={}),H[t].registryInfo=e[t],n(t)}),$(t).triggerHandler("registryDownload"),P.resolve()}).fail(function(){P.reject()}).always(function(){P=null}),P.promise())}function s(e,i){function o(o,a){var s,l=D.getUserExtensionPath();if(0===i.indexOf(l))s=B;else{var c,u=i.split("/");u.length>2&&(c=u[u.length-2]),s="dev"===c?V:"default"===c?j:W}H[o]||(H[o]={}),H[o].installInfo={metadata:a,path:i,locationType:s,status:"loadFailed"===e.type?U:F},n(o),r(o),$(t).triggerHandler("statusChange",[o])}M.loadPackageJson(i).done(function(e){o(e.name,e)}).fail(function(){var e=i.match(/\/([^\/]+)$/),t=e&&e[1]||i,n={name:t,title:t};o(t,n)})}function l(e,t){var n=e.brackets||e.engines&&e.engines.brackets,r={};if(r.isCompatible=!n||N.satisfies(t,n),r.isCompatible)r.compatibleVersion=e.version;else if("<"===n.charAt(0))r.requiresNewer=!1;else if(">"===n.charAt(0))r.requiresNewer=!0;else if("~"===n.charAt(0)){var i=n.slice(1);i.match(/^[0-9]+$/)?i+=".0.0":i.match(/^[0-9]+\.[0-9]+$/)&&(i+=".0"),r.requiresNewer=N.lt(t,i)}return r}function c(e,t){if(!e.versions){var n=l(e.metadata,t);return n.isCompatible&&(n.isLatestVersion=!0),n}var r=e.versions.length-1,i=l(e.versions[r],t);if(i.isCompatible)return i.isLatestVersion=!0,i;for(r--;r>=0;r--){var o=l(e.versions[r],t);if(o.isCompatible)return o.isLatestVersion=!1,o.requiresNewer=i.requiresNewer,o}return i}function u(e,t){return R.format(brackets.config.extension_url,e,t)}function d(e){var n=new $.Deferred;return H[e]&&H[e].installInfo?x.remove(H[e].installInfo.path).done(function(){H[e].installInfo=null,n.resolve(),$(t).triggerHandler("statusChange",[e])}).fail(function(e){n.reject(e)}):n.reject(R.format(L.EXTENSION_NOT_INSTALLED,e)),n.promise()}function p(e,t,n){return x.installUpdate(t,e).done(function(){n||O.getFileForPath(t).unlink()})}function f(){Object.keys(z).forEach(function(e){var t=z[e],n=t.keepFile,r=t.localPath;r&&!n&&O.getFileForPath(r).unlink()}),z={}}function h(){q={}}function m(e,n){n?q[e]=!0:delete q[e],$(t).triggerHandler("statusChange",[e])}function g(e){return!!q[e]}function v(){return Object.keys(q).length>0}function y(e){void 0===e.keepFile&&(e.keepFile=!1);var n=e.installationStatus;if(n===x.InstallationStatuses.ALREADY_INSTALLED||n===x.InstallationStatuses.NEEDS_UPDATE||n===x.InstallationStatuses.SAME_VERSION||n===x.InstallationStatuses.OLDER_VERSION){var r=e.name;delete q[r],z[r]=e,$(t).triggerHandler("statusChange",[r])}}function _(e){var n=z[e];n&&(n.localPath&&!n.keepFile&&O.getFileForPath(n.localPath).unlink(),delete z[e],$(t).triggerHandler("statusChange",[e]))}function b(e){return!!z[e]}function E(){return Object.keys(z).length>0}function w(){return T.doInParallel_aggregateErrors(Object.keys(q),function(e){return d(e)})}function S(){return T.doInParallel_aggregateErrors(Object.keys(z),function(e){var t=z[e];return p(t.name,t.localPath,t.keepFile)})}function C(){var e=[];return Object.keys(H).forEach(function(t){var n=H[t];n.installInfo&&n.registryInfo&&n.registryInfo.updateCompatible&&e.push({id:t,installVersion:n.installInfo.metadata.version,registryVersion:n.registryInfo.lastCompatibleVersion})}),e}function I(e){return e.reduce(function(e,t){var n=H[t.id];if(!n||!n.installInfo)return e;var r=n.installInfo.metadata.version;return N.lt(r,t.registryVersion)&&e.push(t),e},[])}var k=e("thirdparty/lodash"),x=e("extensibility/Package"),T=e("utils/Async"),D=e("utils/ExtensionLoader"),M=e("utils/ExtensionUtils"),O=e("filesystem/FileSystem"),L=e("strings"),R=e("utils/StringUtils"),A=e("view/ThemeManager"),N=e("extensibility/node/node_modules/semver/semver.browser"),P=null,F="enabled",U="startFailed",j="default",V="dev",B="user",W="unknown",H={},q=[],z=[];$(D).on("load",s).on("loadFailed",s),t.downloadRegistry=a,t.getCompatibilityInfo=c,t.getExtensionURL=u,t.remove=d,t.update=p,t.extensions=H,t.cleanupUpdates=f,t.markForRemoval=m,t.isMarkedForRemoval=g,t.unmarkAllForRemoval=h,t.hasExtensionsToRemove=v,t.updateFromDownload=y,t.removeUpdate=_,t.isMarkedForUpdate=b,t.hasExtensionsToUpdate=E,t.removeMarkedExtensions=w,t.updateExtensions=S,t.getAvailableUpdates=C,t.cleanAvailableUpdates=I,t.ENABLED=F,t.START_FAILED=U,t.LOCATION_DEFAULT=j,t.LOCATION_DEV=V,t.LOCATION_USER=B,t.LOCATION_UNKNOWN=W,t._reset=o,t._setExtensions=i}),define("utils/NativeApp",["require","exports","module","utils/Async","filesystem/FileSystemError"],function(e,t){function n(e){return e===brackets.fs.ERR_NOT_FOUND?l.NOT_FOUND:l.UNKNOWN}function r(e,t){var r=new $.Deferred;return brackets.app.openLiveBrowser(e,!!t,function(e,t){e?r.reject(n(e)):(void 0!==t&&c.push(t),r.resolve(t))}),r.promise()}function i(e){var t=new $.Deferred;return isNaN(e)&&(e=0),brackets.app.closeLiveBrowser(function(r){if(r)t.reject(n(r));else{var i=c.indexOf(e);-1!==i&&c.splice(i,1),t.resolve()}},e),t.promise()}function o(){var e=c.concat();return s.doSequentially(e,i,!1)}function a(e){brackets.app.openURLInDefaultBrowser(e)}var s=e("utils/Async"),l=e("filesystem/FileSystemError"),c=[];t.openLiveBrowser=r,t.closeLiveBrowser=i,t.closeAllLiveBrowsers=o,t.openURLInDefaultBrowser=a}),define("text!htmlContent/update-dialog.html",[],function(){return'<div class="update-dialog modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{UPDATE_AVAILABLE_TITLE}}</h1>\n </div>\n <div class="modal-body no-padding">\n <img class="update-icon" src="styles/images/update_large_icon.svg">\n <div class="update-text">\n <p class="dialog-message">{{UPDATE_MESSAGE}}</p>\n <div class="update-info">\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <button class="dialog-button btn left" data-button-id="cancel">{{CANCEL}}</button>\n <button class="dialog-button btn primary" data-button-id="download">{{GET_IT_NOW}}</button>\n </div>\n</div>\n'}),define("text!htmlContent/update-list.html",[],function(){return'{{#.}}\n<div>\n <h3>{{versionString}} - {{dateString}} (<a href="{{releaseNotesURL}}" title="{{releaseNotesURL}}">{{Strings.RELEASE_NOTES}}</a>)</h3>\n <ul>\n {{#newFeatures}}\n <li><b>{{name}}</b> - {{description}}</li>\n {{/newFeatures}}\n </ul>\n</div>\n{{/.}}'}),define("utils/UpdateNotification",["require","exports","module","widgets/Dialogs","widgets/DefaultDialogs","extensibility/ExtensionManager","preferences/PreferencesManager","utils/NativeApp","strings","text!htmlContent/update-dialog.html","text!htmlContent/update-list.html","utils/Global"],function(e,t,n){function r(e,t){return e=e||brackets.getLocale(),t&&(e=e.substring(0,2)),brackets.config.update_info_url+e+".json"}function i(e,t,n){var i,o=h.getViewState("lastInfoURLFetchTime"),a=new $.Deferred,s=!1;if(e&&(s=!0),i=h.getViewState("updateInfo"),i||(s=!0),(new Date).getTime()>o+_&&(s=!0),s){var l,c=new $.Deferred,u=brackets.getLocale().toLowerCase();"en"!==u&&"en-us"!==u?(l=n||r(),$.ajax({url:l,cache:!1,type:"HEAD"}).fail(function(){var e=r(brackets.getLocale(),!0);e!==l?$.ajax({url:e,cache:!1,type:"HEAD"}).fail(function(){l=r("en")}).done(function(){l=e}).always(function(){c.resolve()}):(l=r("en"),c.resolve())}).done(function(){c.resolve()})):(l=n||r("en"),c.resolve()),c.done(function(){$.ajax({url:l,dataType:"json",cache:!1}).done(function(e){t||(o=(new Date).getTime(),h.setViewState("lastInfoURLFetchTime",o),h.setViewState("updateInfo",e)),a.resolve(e)}).fail(function(e){if(!e.responseText)return void a.reject();try{i=JSON.parse(e.responseText),a.resolve(i)}catch(t){a.reject()}})})}else a.resolve(i);return a.promise()}function o(e,t){for(var n=0,r=e.length;r>n&&!(e[n].buildNumber<=t);)n++;return n>0?e.slice(0,n):null}function a(e){d.showModalDialogUsingTemplate(Mustache.render(v,g)).done(function(t){t===d.DIALOG_BTN_DOWNLOAD&&m.openURLInDefaultBrowser(e[0].downloadURL)});var t=$(".update-dialog.instance"),n=t.find(".update-info");e.Strings=g,n.html(Mustache.render(y,e))}function s(){var e=f.getAvailableUpdates();h.setViewState("extensionUpdateInfo",e),h.setViewState("lastExtensionRegistryCheckTime",(new Date).getTime()),$("#toolbar-extension-manager").toggleClass("updatesAvailable",e.length>0)}function l(){var e=h.getViewState("lastExtensionRegistryCheckTime"),t=e+_,n=(new Date).getTime(),r=h.getViewState("extensionUpdateInfo");r=f.cleanAvailableUpdates(r),$("#toolbar-extension-manager").toggleClass("updatesAvailable",r.length>0),0===r.length&&(n>t?f.downloadRegistry().done(function(){setTimeout(l,_+b)}):setTimeout(l,t-n+b))}function c(e,t){var n,r,s=h.getViewState("lastNotifiedBuildNumber"),l=!1,u=new $.Deferred;return t&&(n={},t.hasOwnProperty("_buildNumber")&&(n._buildNumber=E,E=t._buildNumber,l=!0),t.hasOwnProperty("lastNotifiedBuildNumber")&&(n.lastNotifiedBuildNumber=s,s=t.lastNotifiedBuildNumber,l=!0),t.hasOwnProperty("_versionInfoURL")&&(r=t._versionInfoURL,l=!0)),i(e||l,l,r).done(function(t){var r=o(t,E);if(0===E&&!e)return void u.resolve();if(r){var i=$("#update-notification");i.css("display","block"),w||(w=!0,i.on("click",function(){c(!0)})),(e||r[0].buildNumber>s)&&(a(r),s=r[0].buildNumber,l||h.setViewState("lastNotifiedBuildNumber",s))}else e&&d.showModalDialog(p.DIALOG_ID_ERROR,g.NO_UPDATE_TITLE,g.NO_UPDATE_MESSAGE);n&&(n.hasOwnProperty("_buildNumber")&&(E=n._buildNumber),n.hasOwnProperty("lastNotifiedBuildNumber")&&(s=n.lastNotifiedBuildNumber)),u.resolve()}).fail(function(){e&&d.showModalDialog(p.DIALOG_ID_ERROR,g.ERROR_FETCHING_UPDATE_INFO_TITLE,g.ERROR_FETCHING_UPDATE_INFO_MSG),u.reject()}),u.promise()}function u(){c(),l(),window.setInterval(c,_+b)}var d=e("widgets/Dialogs"),p=e("widgets/DefaultDialogs"),f=e("extensibility/ExtensionManager"),h=e("preferences/PreferencesManager"),m=e("utils/NativeApp"),g=e("strings"),v=e("text!htmlContent/update-dialog.html"),y=e("text!htmlContent/update-list.html");e("utils/Global");var _=864e5,b=12e4,E=Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);h.stateManager.definePreference("lastNotifiedBuildNumber","number",0),h.stateManager.definePreference("lastInfoURLFetchTime","number",0),h.stateManager.definePreference("lastExtensionRegistryCheckTime","number",0),h.stateManager.definePreference("extensionUpdateInfo","Array",[]),h.convertPreferences(n,{lastNotifiedBuildNumber:"user",lastInfoURLFetchTime:"user",updateInfo:"user"},!0);var w=!1;$(f).on("registryDownload",s),t.launchAutomaticUpdate=u,t.checkForUpdate=c}),define("utils/DragAndDrop",["require","exports","module","utils/Async","command/CommandManager","command/Commands","widgets/Dialogs","widgets/DefaultDialogs","view/MainViewManager","filesystem/FileSystem","file/FileUtils","project/ProjectManager","strings","utils/StringUtils"],function(e,t){function n(e){var t,n=e.length;for(t=0;n>t;t++)if("file"===e[t].kind){var r=e[t].webkitGetAsEntry();if(r.isFile)return!0;if(1===n)return!0}return!1}function r(e){var t=[],n={};return i.doInParallel(e,function(r,i){var s=new $.Deferred;return u.resolve(r,function(l,u){if(!l&&u.isFile){if(i<e.length-1&&-1!==c.findInWorkingSet(c.ALL_PANES,r))return void s.resolve();o.execute(a.CMD_ADD_TO_WORKINGSET_AND_OPEN,{fullPath:r,silent:!0}).done(function(){s.resolve()}).fail(function(e){t.push({path:r,error:e}),s.reject()})}else!l&&u.isDirectory&&1===e.length?p.openProject(r).done(function(){s.resolve()}).fail(function(){s.reject()}):(t.push({path:r,error:l||n}),s.reject())}),s.promise()},!1).fail(function(){function e(e){return e===n?f.ERROR_MIXED_DRAGDROP:d.getFileErrorString(e)}if(t.length>0){var r=f.ERROR_OPENING_FILES;r+="<ul class='dialog-list'>",t.forEach(function(t){r+="<li><span class='dialog-filename'>"+h.breakableUrl(p.makeProjectRelativeIfPossible(t.path))+"</span> - "+e(t.error)+"</li>"}),r+="</ul>",s.showModalDialog(l.DIALOG_ID_ERROR,f.ERROR_OPENING_FILE_TITLE,r)}})}var i=e("utils/Async"),o=e("command/CommandManager"),a=e("command/Commands"),s=e("widgets/Dialogs"),l=e("widgets/DefaultDialogs"),c=e("view/MainViewManager"),u=e("filesystem/FileSystem"),d=e("file/FileUtils"),p=e("project/ProjectManager"),f=e("strings"),h=e("utils/StringUtils");o.register(f.CMD_OPEN_DROPPED_FILES,a.FILE_OPEN_DROPPED_FILES,r),t.isValidDrop=n,t.openDroppedFiles=r}),define("text!htmlContent/problems-panel.html",[],function(){return'<div id="problems-panel" class="bottom-panel vert-resizable top-resizer">\n <div class="toolbar simple-toolbar-layout">\n <div class="title"><!-- filled in programmatically --></div>\n <a href="#" class="close">&times;</a>\n </div>\n <div class="table-container resizable-content"></div>\n</div>'}),define("text!htmlContent/problems-panel-table.html",[],function(){return'<table class="bottom-panel-table table table-striped table-condensed row-highlight">\n <tbody>\n {{#reportList}}\n <tr class="inspector-section">\n <td colspan="3"><span class="disclosure-triangle expanded"></span>{{providerName}} ({{results.length}})</td>\n </tr>\n {{#results}}\n <tr>\n <td class="line-number" data-character="{{pos.ch}}">{{friendlyLine}}</td>\n <td class="line-text">{{message}}</td>\n <td class="line-snippet">{{codeSnippet}}</td>\n </tr>\n {{/results}}\n {{/reportList}}\n </tbody>\n</table>\n'}),define("language/CodeInspection",["require","exports","module","thirdparty/lodash","command/Commands","view/WorkspaceManager","command/CommandManager","document/DocumentManager","editor/EditorManager","view/MainViewManager","language/LanguageManager","preferences/PreferencesManager","utils/PerfUtils","strings","utils/StringUtils","utils/AppInit","utils/Resizer","widgets/StatusBar","utils/Async","text!htmlContent/problems-panel.html","text!htmlContent/problems-panel-table.html"],function(e,t,n){function r(e){v.get(m.NAVIGATE_GOTO_FIRST_PROBLEM).setEnabled(e),H=e}function i(){q={}}function o(e){return q[E.getLanguageForPath(e).getId()]}function a(e,t){var n=new $.Deferred,r=[];return t=t||o(e.fullPath)||[],t.length?(y.getDocumentText(e).done(function(i){var o,a=S.markStart("CodeInspection: "+e.fullPath);o=D.doInParallel(t,function(t){var n=S.markStart("CodeInspection '"+t.name+"': "+e.fullPath),o=new $.Deferred;if(o.done(function(e){r.push({provider:t,result:e})}),t.scanFileAsync)window.setTimeout(function(){var e={pos:{line:-1,col:0},message:I.format(C.LINTER_TIMED_OUT,t.name,F.get(P)),type:R.ERROR};o.resolve({errors:[e]})},F.get(P)),t.scanFileAsync(i,e.fullPath).done(function(e){S.addMeasurement(n),o.resolve(e)}).fail(function(e){var n={pos:{line:-1,col:0},message:I.format(C.LINTER_FAILED,t.name,e),type:R.ERROR};console.error("[CodeInspection] Provider "+t.name+" (async) failed: "+e),o.resolve({errors:[n]})});else try{var a=t.scanFile(i,e.fullPath);S.addMeasurement(n),o.resolve(a)}catch(s){var l={pos:{line:-1,col:0},message:I.format(C.LINTER_FAILED,t.name,s),type:R.ERROR};console.error("[CodeInspection] Provider "+t.name+" (sync) threw an error: "+s),o.resolve({errors:[l]})}return o.promise()},!1),o.then(function(){r.sort(function(e,n){return t.indexOf(e.provider)-t.indexOf(n.provider)}),S.addMeasurement(a),n.resolve(r)})}).fail(function(t){console.error("[CodeInspection] Could not read file for inspection: "+e.fullPath),n.reject(t)}),n.promise()):(n.resolve(null),n.promise())}function s(e,t,n){var r,i;if(1===t.length)j.find(".inspector-section").hide(),1!==e||n?(n&&(e+="+"),r=I.format(C.MULTIPLE_ERRORS,t[0].name,e)):r=I.format(C.SINGLE_ERROR,t[0].name);else{if(!(t.length>1))return;j.find(".inspector-section").show(),n&&(e+="+"),r=I.format(C.ERRORS_PANEL_TITLE_MULTIPLE,e)}U.find(".title").text(r),i=I.format(C.STATUSBAR_CODE_INSPECTION_TOOLTIP,r),T.updateIndicator(L,!0,"inspection-errors",i)}function l(){if(!B)return V=!1,z=null,x.hide(U),T.updateIndicator(L,!0,"inspection-disabled",C.LINT_DISABLED),void r(!1);var e=y.getCurrentDocument(),t=e&&o(e.file.fullPath);if(t&&t.length){var n,i=0,l=!1,c=[],u=[];(z=a(e.file,t)).then(function(o){if(this===z){var a=o.reduce(function(e,t){return e+(t.result?t.result.errors.length:0)},0);if(V=Boolean(a),!a){x.hide(U);var d=C.NO_ERRORS_MULTIPLE_PROVIDER;return 1===t.length&&(d=I.format(C.NO_ERRORS,t[0].name)),T.updateIndicator(L,!0,"inspection-valid",d),void r(!1)}var p=S.markStart("ProblemsPanel render: "+e.file.fullPath);o.forEach(function(t){var n=t.provider;t.result&&(t.result.errors.forEach(function(t){!isNaN(t.pos.line)&&t.pos.line+1>0&&void 0!==(t.codeSnippet=e.getLine(t.pos.line))&&(t.friendlyLine=t.pos.line+1,t.codeSnippet=t.codeSnippet.substr(0,Math.min(175,t.codeSnippet.length))),t.type!==R.META&&i++}),t.result.aborted&&(l=!0),t.result.errors.length&&(c.push({providerName:n.name,results:t.result.errors}),u.push(n)))}),n=Mustache.render(O,{reportList:c}),j.empty().append(n).scrollTop(0),W||x.show(U),s(i,u,l),r(!0),S.addMeasurement(p)}})}else{V=!1,z=null,x.hide(U);var d=e&&E.getLanguageForPath(e.file.fullPath);d?T.updateIndicator(L,!0,"inspection-disabled",I.format(C.NO_LINT_AVAILABLE,d.getName())):T.updateIndicator(L,!0,"inspection-disabled",C.NOTHING_TO_LINT),r(!1)}}function c(e,t){q[e]||(q[e]=[]),"javascript"===e&&h.remove(q[e],function(e){return"JSLint"===e.name}),q[e].push(t),l()}function u(){B?($(b).on("currentFileChange.codeInspection",function(){l()}),$(y).on("currentDocumentLanguageChanged.codeInspection",function(){l()}).on("documentSaved.codeInspection documentRefreshed.codeInspection",function(e,t){t===y.getCurrentDocument()&&l()})):($(y).off(".codeInspection"),$(b).off(".codeInspection"))}function d(e,t){void 0===e&&(e=!B),e!==B&&(B=e,v.get(m.VIEW_TOGGLE_INSPECTION).setChecked(B),u(),t||(F.set(A,B),F.save()),l())}function p(e,t){void 0===e&&(e=!W),e!==W&&(W=e,t||(F.set(N,W),F.save()),W?x.hide(U):V&&x.show(U))}function f(){l(),H&&U.find("tr:not(.inspector-section)").first().trigger("click")}var h=e("thirdparty/lodash"),m=e("command/Commands"),g=e("view/WorkspaceManager"),v=e("command/CommandManager"),y=e("document/DocumentManager"),_=e("editor/EditorManager"),b=e("view/MainViewManager"),E=e("language/LanguageManager"),w=e("preferences/PreferencesManager"),S=e("utils/PerfUtils"),C=e("strings"),I=e("utils/StringUtils"),k=e("utils/AppInit"),x=e("utils/Resizer"),T=e("widgets/StatusBar"),D=e("utils/Async"),M=e("text!htmlContent/problems-panel.html"),O=e("text!htmlContent/problems-panel-table.html"),L="status-inspection",R={ERROR:"problem_type_error",WARNING:"problem_type_warning",META:"problem_type_meta"},A="enabled",N="collapsed",P="asyncTimeout",F=w.getExtensionPrefs("linting");w.convertPreferences(n,{enabled:"user linting.enabled",collapsed:"user linting.collapsed"});var U,j,V,B=!1,W=!1,H=!1,q={},z=null;v.register(C.CMD_VIEW_TOGGLE_INSPECTION,m.VIEW_TOGGLE_INSPECTION,d),v.register(C.CMD_GOTO_FIRST_PROBLEM,m.NAVIGATE_GOTO_FIRST_PROBLEM,f),F.definePreference(A,"boolean",brackets.config["linting.enabled_by_default"]).on("change",function(){d(F.get(A),!0)}),F.definePreference(N,"boolean",!1).on("change",function(){p(F.get(N),!0)}),F.definePreference(P,"number",1e4),k.htmlReady(function(){var e=Mustache.render(M,C);g.createBottomPanel("errors",$(e),100),U=$("#problems-panel");var t;j=U.find(".table-container").on("click","tr",function(e){if(t&&t.removeClass("selected"),t=$(e.currentTarget),t.addClass("selected"),t.hasClass("inspector-section")){t.nextUntil(".inspector-section").toggle();var n=$(".disclosure-triangle",t);n.toggleClass("expanded").toggleClass("collapsed")}else{var r=t.find(".line-number"),i=parseInt(r.text(),10)-1;if(!isNaN(i)){var o=r.data("character"),a=_.getCurrentFullEditor();a.setCursorPos(i,o,!0),b.focusActivePane()}}}),$("#problems-panel .close").click(function(){p(!0)});var n=Mustache.render('<div id="status-inspection">&nbsp;</div>',C);T.addIndicator(L,$(n),!0,"","","status-indent"),$("#status-inspection").click(function(){V&&p()}),d(F.get(A),!0),p(F.get(N),!0)}),t._unregisterAll=i,t._PREF_ASYNC_TIMEOUT=P,t.register=c,t.Type=R,t.toggleEnabled=d,t.inspectFile=a,t.requestRun=l}),define("language/HTMLUtils",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror","utils/TokenUtils"],function(e,t){function n(e){var t=e.token.string,n=t.charAt(0),r=t.charAt(t.length-1),i=p.offsetInToken(e),o=!1;if(t.length>1&&("'"===n||'"'===n)&&r===n&&(o=null!==t.match(/\=\s*['"]$/),!o))return t=t.substring(1,t.length-1),i=i-1>t.length?t.length:i-1,{val:t,offset:i,quoteChar:n,hasEndQuote:!0};if(o){var a=t.indexOf(" "),s=t.indexOf(">"),l=-1!==a&&s>a?a:s;t=t.substring(0,l>i?l:i)}else i>0&&("'"===n||'"'===n)&&(t=t.substring(0,i));return n=t.charAt(0),"'"===n||'"'===n?(t=t.substring(1),i--):(n="",">"===r&&(t="",i=0)),{val:t,offset:i,quoteChar:n,hasEndQuote:!1}}function r(e){var t=e.editor.getMode(),n=d.innerMode(t,e.token.state);return"tag bracket"===e.token.type?n.state.tagName:n.state.tagName||e.token.string}function i(e,t){var n=[],r=p.getInitialContext(e._codeMirror,t),i=$.extend({},r);if("html"===e.getModeForSelection()&&r.token&&!v.test(r.token.type)){for(;p.movePrevToken(r)&&!v.test(r.token.type)&&("error"!==r.token.type||0!==r.token.string.indexOf("<"));)"attribute"===r.token.type&&n.push(r.token.string);for(;p.moveNextToken(i)&&!v.test(i.token.type);)if("attribute"===i.token.type){if(0===i.token.string.indexOf("<"))break;n.push(i.token.string)}else if("error"===i.token.type){if(0===i.token.string.indexOf("<")||0===i.token.string.indexOf(">"))break;/\S/.test(i.token.string)&&-1===i.token.string.indexOf('"')&&-1===i.token.string.indexOf("'")&&-1===i.token.string.indexOf("=")&&n.push(i.token.string)}}return n}function o(e,t,n,r,i,o,a,s){return{tagName:n||"",attr:{name:r||"",value:i||"",valueAssigned:o||!1,quoteChar:a||"",hasEndQuote:s||!1},position:{tokenType:e||"",offset:t||0}}}function a(e){var t=n(e),i=t.val,a=t.offset,s=t.quoteChar,l=t.hasEndQuote,c=e.token.string.length;if(("string"===e.token.type||"error"===e.token.type)&&e.pos.ch===e.token.end&&c>1){var u=e.token.string[0],d=e.token.string[c-1];if(u===d&&("'"===u||'"'===u))return o()}if(!p.moveSkippingWhitespace(p.movePrevToken,e)||"="!==e.token.string)return o();if(!p.moveSkippingWhitespace(p.movePrevToken,e)||"attribute"!==e.token.type)return o();var f=e.token.string,h=r(e);return o(g,a,h,f,i,!0,s,l)}function s(e,t){if(t===!1&&"attribute"!==e.token.type)return o();var i=r(e),a=e.token.string,s=p.offsetInToken(e);if(!p.moveSkippingWhitespace(p.moveNextToken,e)||"="!==e.token.string)return t&&(!e.token.type||e.token.type&&"attribute"!==e.token.type&&-1===e.token.type.indexOf("error")&&-1!==e.token.string.indexOf("<"))?o():o(m,s,i,a);if(!p.moveSkippingWhitespace(p.moveNextToken,e))return o(m,s,i,a);var l=n(e),c=l.val,u=l.quoteChar,d=l.hasEndQuote;return o(m,s,i,a,c,!0,u,d)}function l(e,t){var n,i,l=$.extend({},t),c=p.getInitialContext(e._codeMirror,l),u=p.offsetInToken(c);if("html"!==e.getModeForSelection())return o();if(c.token.string.length>0&&!/\S/.test(c.token.string)){var d={ch:c.pos.ch+1,line:c.pos.line},y=e._codeMirror.getTokenAt(d,!0);if(y.string.length>0&&/\S/.test(y.string)&&">"!==y.string.charAt(0))if(c.token=y,v.test(c.token.type)){if("<"===c.token.string.charAt(0))return o()}else{if("attribute"===c.token.type)return s(c,!1);if("="===c.token.string)return o()}else{if(!p.movePrevToken(c))return o();if("comment"===c.token.type)return o();if(!v.test(c.token.type)&&"="!==c.token.string)return n=a(c),"comment"===c.token.type||v.test(c.token.type)&&(">"===c.token.string||"/>"===c.token.string||"</"===c.token.string)?o():(n.tagName||(n=s(c,!0)),n.tagName?o(m,0,n.tagName):o());i=m,u=0}}if(v.test(c.token.type)){if("tag bracket"!==c.token.type){if(p.movePrevToken(c)&&!/\S/.test(c.token.string))return o();"tag bracket"===c.token.type&&"</"===c.token.string&&(i=h),p.moveNextToken(c)}if(">"===c.token.string||"/>"===c.token.string)return o();if("="!==c.token.string&&null===c.token.string.match(/^["']/))return i||(i=f,"tag bracket"===c.token.type&&("</"===c.token.string?(i=h,u-=2):u=0,0===u&&p.moveNextToken(c))),o(i,u,r(c))}if("="===c.token.string){if(!p.moveSkippingWhitespace(p.movePrevToken,c)||"attribute"!==c.token.type)return o();i=g,u=0}return"attribute"===c.token.type?(n=s(c,!1),n.attr.quoteChar?u=t.ch-c.pos.ch:i===g&&t.ch+1<c.pos.ch&&(n.attr.value="")):n=a(c),i&&n.tagName&&(n.position.tokenType=i,n.position.offset=u),n}function c(e,t){for(var n,r,i=p.getInitialContext(e._codeMirror,{line:0,ch:0}),o=[],a=null,s=!1,l=e._codeMirror.getMode();p.moveNextToken(i,!1);)n=d.innerMode(l,i.token.state).mode.name,s?(a.end||(a.end=a.start),n===r?(a.text=e.document.getRange(a.start,a.end),s=!1):a.end={line:i.pos.line,ch:i.pos.ch}):n===t?(a={start:{line:i.pos.line,ch:i.pos.ch}},o.push(a),s=!0):r=n;return o}function u(e){return c(e,"css")}var d=e("thirdparty/CodeMirror2/lib/codemirror"),p=e("utils/TokenUtils"),f="tagName",h="closingTag",m="attr.name",g="attr.value",v=/^tag/;t.TAG_NAME=f,t.CLOSING_TAG=h,t.ATTR_NAME=m,t.ATTR_VALUE=g,t.getTagInfo=l,t.getTagAttributes=i,t.createTagInfo=o,t.findStyleBlocks=u,t.findBlocks=c}),define("language/CSSUtils",["require","exports","module","thirdparty/CodeMirror2/lib/codemirror","utils/Async","document/DocumentManager","editor/EditorManager","file/FileUtils","language/HTMLUtils","project/ProjectManager","utils/TokenUtils","thirdparty/lodash"],function(e,t){function n(e){return/\S/.test(e)}function r(e){var t,n;return e&&e.token&&e.token.state&&"comment"!==e.token.type?(t=e.token.state.localState||e.token.state,t.context?(n=t.context.type,"{"===n||"rule"===n||"block"===n):!1):!1}function i(e){function t(e){return"parens"===e.type&&e.prev?"prop"===e.prev.type?!0:t(e.prev):!1}var n;return e&&e.token&&e.token.state&&"comment"!==e.token.type?(n=e.token.state.localState||e.token.state,n.context&&n.context.prev?"prop"===n.context.type&&("rule"===n.context.prev.type||"block"===n.context.prev.type)||t(n.context):!1):!1}function o(e){var t;return e&&e.token&&e.token.state?(t=e.token.state.localState||e.token.state,t.context?"at"===t.context.type:!1):!1}function a(e,t,n,r,i,o,a){var s={context:e||"",offset:t||0,name:n||"",index:-1,values:[],isNewItem:o===!0,range:a};return(e===H||e===B||e===q)&&(s.index=r,s.values=i),s}function s(e){var t="",r=j.offsetInToken(e),i=e.token.string,o=[";","{","}"];if("property"===e.token.type||"property error"===e.token.type||"tag"===e.token.type)t=i,j.movePrevToken(e)&&n(e.token.string)&&-1===o.indexOf(e.token.string)&&(t=e.token.string+i,r+=e.token.string.length);else if("meta"===e.token.type||"-"===i)t=i,!j.moveNextToken(e)||"property"!==e.token.type&&"property error"!==e.token.type&&"tag"!==e.token.type||(t+=e.token.string);else{if(n(i)&&-1===o.indexOf(i))return a();var l={ch:e.pos.ch+1,line:e.pos.line},c=e.editor.getTokenAt(l,!0);if("property"===c.type||"property error"===c.type||"tag"===c.type)t=c.string,r=0;else if("meta"===c.type||"-"===c.string)return e.pos=l,e.token=c,s(e)}return""===t&&(r=0),a(W,r,t)}function l(e){var t=$.extend({},e),n="";do if(":"!==t.token.string&&!i(t))return"";while(":"!==t.token.string&&j.moveSkippingWhitespace(j.movePrevToken,t));return":"!==t.token.string||!j.moveSkippingWhitespace(j.movePrevToken,t)||"property"!==t.token.type&&"property error"!==t.token.type||(n=t.token.string,j.movePrevToken(t)&&"meta"===t.token.type&&(n=t.token.string+n)),n}function c(e){for(var t,n="",r=[];":"!==e.token.string&&j.movePrevToken(e)&&":"!==e.token.string&&i(e);)t=e.token.string,""!==n&&(t+=n),e.token.string.length>0&&!e.token.string.match(/\S/)||","===e.token.string?n=t:(n="",0===r.length||t.match(/,\s*$/)?r.push(t):r[r.length-1]=t+r[r.length-1]);return r.length>0&&r.reverse(),r}function u(e,t){for(var n=t,r=[];";"!==e.token.string&&"}"!==e.token.string&&j.moveNextToken(e)&&";"!==e.token.string&&"}"!==e.token.string;){if(!i(e)){n="";break}""===n?n=e.token.string.trim():n.length>0&&(e.token.string.length>0&&!e.token.string.match(/\S/)?(n+=e.token.string,r.push(n),n=""):","===e.token.string?n+=e.token.string:n&&n.match(/,$/)?(r.push(n),n=e.token.string.length>0?e.token.string:""):n+=e.token.string)}return n.length>0&&r.push(n),r}function d(e,t){for(var r={start:{},end:{}};j.moveNextToken(e)&&!n(e.token.string););for(;";"===t.token.string||"}"===t.token.string||!n(t.token.string);)j.movePrevToken(t);return r.start=V.clone(e.pos),r.start.ch=e.token.start,r.end=V.clone(t.pos),r.end.ch=t.token.end,r}function p(e,t){var n,r,i,o,s=$.extend({},e.pos),p=$.extend({},e.pos),f=$.extend({},e.pos),h=j.getInitialContext(t._codeMirror,s),m="",g=[],v=-1,y=j.offsetInToken(e),_=!1,b={ch:e.pos.ch+1,line:e.pos.line},E=t._codeMirror.getTokenAt(b,!0);return(i=l(h))?(n=j.getInitialContext(t._codeMirror,p),g=c(n),m="",":"===e.token.string?(v=0,_=!0):(v=g.length-1,","===e.token.string?(g[v]+=e.token.string,v++,_=!0):(v=0>v?0:v+1,e.token.string.match(/\S/)?m=e.token.string:(_=!0,v>0&&(g[v-1]+=e.token.string.substr(0,y))))),_&&(y=0,t.document.getLine(e.pos.line).length>e.pos.ch&&(0===E.string.length||E.string.match(/\S/))&&(_=!1)),r=j.getInitialContext(t._codeMirror,f),g=g.concat(u(r,m)),o=g.length?d(n,r):{start:V.clone(e.pos),end:V.clone(e.pos)},v===g.length&&(_=!0),a(H,y,i,v,g,_,o)):a()}function f(e,t){var n,r,i=$.extend({},e.pos),o=$.extend({},e.pos),s=0,l=[],c=j.offsetInToken(e);if(e.token.type&&"string"!==e.token.type)return a();for(n=j.getInitialContext(t._codeMirror,i),l[0]=n.token.string;!(!j.movePrevToken(n)||"def"===n.token.type&&"@import"===n.token.string||n.token.type&&"tag"!==n.token.type&&"url"!==n.token.string);)l[0]=n.token.string+l[0],c+=n.token.string.length;if("def"!==n.token.type||"@import"!==n.token.string)return a();r=j.getInitialContext(t._codeMirror,o);do{if(!j.moveNextToken(r)){if("("===r.token.string)break;return a()}l[0]+=r.token.string}while(")"!==r.token.string&&""!==r.token.string);return a(q,c,"",s,l,!1)}function h(e,t){var n=$.extend({},t),l=j.getInitialContext(e._codeMirror,n),c=e.getModeForSelection();return"css"!==c&&"text/x-scss"!==c&&"text/x-less"!==c?a():r(l)?s(l,e):i(l)?p(l,e):o(l)?f(l,e):a()}function m(e,t){if(e.parentSelectors){var n=e.parentSelectors+" / ";return n+=t&&e.selectorGroup?e.selectorGroup:e.selector}return t&&e.selectorGroup?e.selectorGroup:e.selector}function g(e,t){function r(){for(;M.eol();){if(O++,O>=x)return!1;n(P)&&(P+=" "),M=new L.StringStream(k[O])}return!0}function i(){return I=L.startState(N),k=L.splitLines(e),x=k.length,0===x?!1:(O=0,M=new L.StringStream(k[O]),r()?(D=N.token(M,I),T=M.current(),!0):!1)}function o(){return M.start=M.pos,r()?(D=N.token(M,I),T=M.current(),!0):!1}function a(){if(!i())return!1;for(;!n(T);)if(!o())return!1;return!0}function s(){if(!o())return!1;for(;!n(T);)if(!o())return!1;return!0}function l(){return/^\/[\/\*]/.test(T)}function c(){if(!/^\/\//.test(T))for(;!/\*\/$/.test(T)&&o(););}function u(){if(!o())return!1;for(;l();)if(c(),!o())return!1;return!0}function d(e){var t="",n=0;for(e||(e="{");;){if(-1!==T.indexOf(e)&&-1===T.indexOf(X[e]))n++;else if(T===X[e]&&(n--,0>=n))return t+=T;if(t+=T,!u())return t}}function p(){return/^-(moz|ms|o|webkit)-$/.test(T)||"top"!==I.state&&"block"!==I.state&&-1!==M.string.indexOf(";")&&!/\([^)]+;/.test(M.string)}function f(){for(var e="";";"!==T&&(!(/#\{$/.test(T)||"{"===T&&/[#@]$/.test(e))||(d("{"),"}"===T&&o(),";"!==T));){if("{"===T||"}"===T)return!1;if(e=T,!u())break}return!0}function h(){var e;for(e=A.length-1;e>=0;e--)if(-1===A[e].declListEndLine&&A[e].level<F)return m(A[e],!0);
29return""}function g(e,t){for(P="",j=e,V=O;","!==T&&"{"!==T||"{"===T&&/[#@]$/.test(P)||","===T&&!n(P);){if("{"===T)P+=d("{"),o();else if("}"===T&&(!P||/:\s*\S/.test(P)||!/#\{.+/.test(P)))return!1;if(";"===T&&"parens"!==I.state||"prop"===I.state&&!/\{/.test(M.string)?P="":"("===T?n(P)?P+=d("("):d("("):(n(T)||n(P))&&(P+=T),!u())return!1}if(!P)return!1;/\\/.test(P)&&(P=P.replace(z,function(e){return e.replace(G,function(e){return e=e.substr(1),1===e.length?e:String.fromCharCode(parseInt(e,16)<1114111?parseInt(e,16):65533)})})),P=P.trim();var r=-1===B?j:j+1,i=-1!==M.string.indexOf(P,j)?M.string.indexOf(P,j-P.length):r;if(""!==P){t>F&&F++,-1===U&&(U=O,$=M.start-P.length);var a=h();A.push({selector:P,ruleStartLine:U,ruleStartChar:$,selectorStartLine:V,selectorStartChar:i,declListEndLine:-1,selectorEndLine:O,selectorEndChar:i+P.length,selectorGroupStartLine:B,selectorGroupStartChar:W,level:F,parentSelectors:a}),P=""}return j=-1,!0}function v(e){if(B=-1!==M.string.indexOf(",")?O:-1,W=M.start,!g(M.start,e))return!1;for(;","===T;){if(!u())return!1;if(!g(M.start,e))return!1}return!0}function y(e){var t;H=Math.min(O,x-1),q=M.start;var n,r;if(-1!==B){for(n="",r=B;H>=r;r++){var i=0,o=k[r].length;r===B?i=W:n+=" ",r===H&&(o=q),n+=k[r].substring(i,o).trim()}n=n.trim()}for(t=A.length-1;t>=0;t--)if(A[t].level===e){if(-1!==A[t].declListEndLine)break;A[t].declListStartLine=H,A[t].declListStartChar=q,n&&(A[t].selectorGroup=n)}var a=!0;do for(B=-1,W=-1,U=-1,$=-1,a||F>0&&F===e&&(F--,"}"===T&&s()),"{"===T&&s(),a=R(void 0,F+1),t=A.length-1;t>=0&&!(A[t].level<F);t--)-1===A[t].declListEndLine&&(A[t].declListEndLine=O,A[t].declListEndChar=M.pos-1);while(F>0&&F===e)}function _(){return-1!==$?!1:M.start>0&&-1!==k[O].substr(0,M.start).indexOf("}")?!1:!0}function b(){return/^@/.test(T)&&!/^@mixin/i.test(T)&&"@"!==T}function E(){return/\}:(enabled|disabled|checked|indeterminate|link|visited|hover|active|focus|target|lang|root|nth-|first-|last-|only-|empty|not)/.test(M.string)}function w(){return/[@#]\{\S+\}(\s*:|.*;)/.test(M.string)&&!E()}function S(e){if(U=-1,$=-1,V=-1,j=-1,B=-1,W=-1,/@media/i.test(T)){for(;"{"!==T;)if(!u())return;if(!s())return;e>=F&&F++,R("}",F+1),F>0&&F--}else for(;";"!==T;){if("{"===T)return void d("{");if(!u())return}}function C(e){return v(e)?(y(e),!0):!1}var I,k,x,T,D,M,O,R,A=[],N=L.getMode({indentUnit:2},t||"css"),P="",F=0,$=-1,U=-1,j=-1,V=-1,B=-1,W=-1,H=-1,q=-1,z=new RegExp("\\\\[^\\\\]+","g"),G=new RegExp("\\\\([a-f0-9]{6}|[a-f0-9]{4}(\\s|\\\\|$)|[a-f0-9]{2}(\\s|\\\\|$)|.)","i");return R=function(e,t){for(;!e||T!==e;){if(w()){if(!f())return!1}else if(b())S(t);else if(l())_()&&($=M.start,U=O),c();else if(p()){if(!f())return!1}else{if(!C(void 0===t?0:t)&&t>0)return!1;if(t>0)return!0;$=-1,U=-1}if(!s())break}return!0},a()&&R(),A}function v(e){return e=e.trim(),0===e.indexOf("@")?"":e}function y(e){var t=[""],n=[],r=[];return V.forEach(e,function(e){e=v(e),r=e.split(","),n=[],V.forEach(r,function(e){var r=e.indexOf("&");V.forEach(t,function(t){-1===r?(e=v(e),t.length&&e.length&&(t+=" "),t+=e):t=v(e.replace(/&/g,t)),n.push(t)})}),t=n}),t.join(", ")}function _(e,t,n){var r=g(e,n),i=[],o="."===t[0]||"#"===t[0];"."===t[0]&&(t="\\"+t),o||(t="(^|[\\s>+~])"+t);var a=new RegExp(t+"(\\[[^\\]]*\\]|:{1,2}[\\w-()]+|\\.[\\w-]+|#[\\w-]+)*\\s*$",o?"":"i");return r.forEach(function(e){var t=e.selector;if(-1!==e.selector.indexOf("&")&&e.parentSelectors){var n=e.parentSelectors.split(" / ");n.push(e.selector),t=y(n)}-1!==t.search(a)?i.push(e):o||/\*\s*$/.test(t)&&i.push(e)}),i}function b(e,t,n,r){t.forEach(function(t){e.push({name:m(t),document:n,lineStart:t.ruleStartLine+r,lineEnd:t.declListEndLine+r,selectorGroup:t.selectorGroup})})}function E(e,t){function n(e,n){var r=new $.Deferred;return A.getDocumentForPath(e).done(function(e){var i=_(e.getText(),n,e.getLanguage().getMode());b(t,i,e,0),r.resolve()}).fail(function(e){r.reject(e)}),r.promise()}var r=new $.Deferred;return U.getAllFiles(U.getLanguageFilter(["css","less","scss"])).done(function(t){R.doInParallel(t,function(t){return n(t.fullPath,e)}).then(r.resolve,r.reject)}),r.promise()}function w(e,t,n){var r=N.getCurrentFullEditor();if(r.document!==e)return void console.error("Cannot search for <style> blocks in HTML file other than current editor");var i=F.findStyleBlocks(r);i.forEach(function(r){var i=_(r.text,t);b(n,i,e,r.start.line)})}function S(e,t){var n=new $.Deferred,r=[];return t&&w(t,e,r),E(e,r).done(function(){n.resolve(r)}).fail(function(e){n.reject(e)}),n.promise()}function C(e,t){function r(e,t){var n=0;for(t||(t="}");;){if(t===e.token.string)n++;else if(e.token.string.match(Y[t])&&(n--,0>=n))return;if(!j.movePrevToken(e))return}}function i(e){var t="";for(j.movePrevToken(e);;){if("comment"!==e.token.type){if(/[\{\}\;]/.test(e.token.string))break;if("style"===e.token.string&&"tag"===e.token.type){var n=t.indexOf(">");-1!==n&&(t=t.substring(n+1));break}t=e.token.string+t}if(!j.movePrevToken(e))break}return t}var o=e._codeMirror,a=j.getInitialContext(o,$.extend({},t)),s="",l=!1,c=P.isCSSPreprocessorFile(e.document.file.fullPath),u=[],d=!1;c&&n(a.token.string)&&"{"!==a.token.string&&("block"===a.token.state.state||"top"===a.token.state.state)&&(l=!0);do if("comment"!==a.token.type)if("}"===a.token.string){if(!c)break;if("top"===a.token.state.state)break;d=!0,r(a,"}")}else if("{"===a.token.string){if(s=i(a),!c)break;d||/^\s*@/.test(s)||u.unshift(s),d&&(d=!1)}else!c&&n(a.token.string)&&(l=!0),j.movePrevToken(a);else j.movePrevToken(a);while(!j.isAtStart(a));if(s=v(s),a=j.getInitialContext(o,$.extend({},t)),(!s&&!l&&!c||c&&(""===a.token.string||/\s+/.test(a.token.string)))&&j.moveNextToken(a)&&"comment"!==a.token.type&&n(a.token.string)&&(l=!0,a=j.getInitialContext(o,$.extend({},t))),(!s||c)&&l)for(;;){if("comment"!==a.token.type){if("{"===a.token.string){s=i(a),c&&!/^\s*@/.test(s)&&u.push(s);break}if("}"===a.token.string||";"===a.token.string)break}if(!j.moveNextToken(a))break}return c?y(u):v(s)}function I(e){return e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g,"")}function k(e){return e.replace(/[^\\]\"(.*)[^\\]\"|[^\\]\'(.*)[^\\]\'+/g,"")}function x(e){return k(I(e))}function T(e){var t,n=/(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi,r=[],i={};for(e=x(e),t=n.exec(e);t;){var o=t[2];-1!==K.indexOf(o)||i.hasOwnProperty(o)||(i[o]=r.push(o)),t=n.exec(e)}return r}function D(e,t,n,r){var i,o="\n"+t+" {\n";if(n)o+=" ",i=1;else{var a;for(a=0;r>a;a++)o+=" ";i=r}o+="\n}\n";var s=e.getText().split("\n"),l=s.length-1,c=s[s.length-1].length;return e.replaceRange(o,{line:l,ch:c}),{range:{from:{line:l+1,ch:0},to:{line:l+3,ch:1}},pos:{line:l+2,ch:i}}}function M(e){var t,n=[];return e.forEach(function(e){e.selectorGroup&&(e.name=e.selectorGroup),t&&e.document===t.document&&e.lineStart===t.lineStart&&e.lineEnd===t.lineEnd&&e.selectorGroup===t.selectorGroup||n.push(e),t=e}),n}function O(e){var t,n,r=0,i=e.document.getText();for(t=0;t<e.startLine;t++)r=i.indexOf("\n",r)+1;for(n=r,t=e.startLine+1;t<=e.endLine+1;t++)n=i.indexOf("\n",n)+1;var o=g(i.substring(r,n));return o.length?o[0].selectorGroup||o[0].selector:""}var L=e("thirdparty/CodeMirror2/lib/codemirror"),R=e("utils/Async"),A=e("document/DocumentManager"),N=e("editor/EditorManager"),P=e("file/FileUtils"),F=e("language/HTMLUtils"),U=e("project/ProjectManager"),j=e("utils/TokenUtils"),V=e("thirdparty/lodash"),B="selector",W="prop.name",H="prop.value",q="import.url",z=["content","element"],G=["none","inherit","default","auto","initial"],K=z.concat(G),X={"{":"}","[":"]","(":")"},Y=V.invert(X);t._findAllMatchingSelectorsInText=_,t.findMatchingRules=S,t.extractAllSelectors=g,t.extractAllNamedFlows=T,t.findSelectorAtDocumentPos=C,t.reduceStyleSheetForRegExParsing=x,t.addRuleToDocument=D,t.consolidateRules=M,t.getRangeSelectors=O,t.getCompleteSelectors=m,t.SELECTOR=B,t.PROP_NAME=W,t.PROP_VALUE=H,t.IMPORT_URL=q,t.getInfoAtPos=h,t.createInfo=a}),define("utils/DropdownEventHandler",["require","exports","module","command/KeyBindingManager","utils/KeyEvent","widgets/PopUpManager","utils/ViewUtils"],function(e,t){function n(e,t,n){this.$list=e,this.$items=e.find("li"),this.selectionCallback=t,this.closeCallback=n,this.scrolling=!1,this._selectedIndex=-1}var r=e("command/KeyBindingManager"),i=e("utils/KeyEvent"),o=e("widgets/PopUpManager"),a=e("utils/ViewUtils");n.prototype.open=function(){function e(e){var t;if("keydown"===e.type){if(t=e.keyCode,t===i.DOM_VK_TAB)n.close();else if(t===i.DOM_VK_UP)n._tryToSelect(-1===n._selectedIndex?-1:n._selectedIndex-1,-1);else if(t===i.DOM_VK_DOWN)n._tryToSelect(-1===n._selectedIndex?0:n._selectedIndex+1,1);else if(t===i.DOM_VK_PAGE_UP)n._tryToSelect((n._selectedIndex||0)-n._itemsPerPage(),-1,!0);else if(t===i.DOM_VK_PAGE_DOWN)n._tryToSelect((n._selectedIndex||0)+n._itemsPerPage(),1,!0);else if(t===i.DOM_VK_HOME)n._tryToSelect(0,1);else if(t===i.DOM_VK_END)n._tryToSelect(n.$items.length-1,-1);else{if(-1===n._selectedIndex||t!==i.DOM_VK_RETURN)return!1;n._selectionHandler()}return e.stopImmediatePropagation(),e.preventDefault(),!0}return!1}function t(){r.removeGlobalKeydownHook(e),n._cleanup()}var n=this;r.addGlobalKeydownHook(e),this.$list&&(this._registerMouseEvents(),o.addPopUp(this.$list,t,!0))},n.prototype.close=function(){this.$list&&o.removePopUp(this.$list)},n.prototype._cleanup=function(){this.$list&&this.$list.off(".dropdownEventHandler"),this.closeCallback&&this.closeCallback()},n.prototype._tryToSelect=function(e,t,n){var r=this.$items.length;n?0>e?(e=0,t=1):e>=r&&(e=r-1,t=-1):(e%=r,0>e&&(e+=r));var i=this.$items.eq(e);i.hasClass("divider")||i.find("a.disabled").length?this._tryToSelect(e+t,t,n):this._setSelectedIndex(e,!0)},n.prototype._itemsPerPage=function(){var e,t=1;return 0!==this.$items.length&&(e=$(this.$items[0]).height(),e&&(t=Math.floor(this.$list.height()/e),t=Math.max(1,Math.min(t,this.$items.length)))),t},n.prototype._selectionHandler=function(){if(-1!==this._selectedIndex){var e=this.$items.eq(this._selectedIndex).find("a");this._clickHandler(e)}},n.prototype._clickHandler=function(e){this.selectionCallback&&this.$list&&e&&(e.hasClass("disabled")||(this.selectionCallback(e),o.removePopUp(this.$list)))},n.prototype._setSelectedIndex=function(e,t){if(e=Math.max(-1,Math.min(e,this.$items.length-1)),-1!==this._selectedIndex&&this.$items.eq(this._selectedIndex).find("a").removeClass("selected"),this._selectedIndex=e,-1!==this._selectedIndex){var n=this.$items.eq(this._selectedIndex);n.find("a").addClass("selected"),t&&(this.scrolling=!0,a.scrollElementIntoView(this.$list,n,!1))}},n.prototype._registerMouseEvents=function(){var e=this;this.$list.on("click.dropdownEventHandler","a",function(){e._clickHandler($(this))}).on("mouseover.dropdownEventHandler","a",function(t){if(e.scrolling)return void(e.scrolling=!1);var n=$(t.currentTarget),r=n.closest("li"),i=e.$list.offset(),o=r.offset();n.hasClass("disabled")||o.top<i.top+e.$list.height()&&i.top<=o.top&&e._setSelectedIndex(e.$items.index(r),!1)})},n.prototype.reRegisterMouseHandlers=function(e){this.$list&&(this.$list.off(".dropdownEventHandler"),this.$list=e,this.$items=e.find("li"),this._registerMouseEvents())},t.DropdownEventHandler=n}),define("widgets/DropdownButton",["require","exports","module","utils/DropdownEventHandler","view/WorkspaceManager","command/Menus","utils/ViewUtils","thirdparty/lodash"],function(e,t){function n(e,t,n){this.items=t,this.itemRenderer=n||this.itemRenderer,this._onClick=this._onClick.bind(this),this.closeDropdown=this.closeDropdown.bind(this),this._onClickOutside=this._onClickOutside.bind(this),this.$button=$("<button class='btn btn-dropdown'/>").text(e).on("click",this._onClick)}var r=e("utils/DropdownEventHandler").DropdownEventHandler,i=e("view/WorkspaceManager"),o=e("command/Menus"),a=e("utils/ViewUtils"),s=e("thirdparty/lodash");n.prototype.items=null,n.prototype.$button=null,n.prototype.$dropdown=null,n.prototype.dropdownExtraClasses=null,n.prototype._lastFocus=null,n.prototype._dropdownEventHandler=null,n.prototype._onClick=function(e){this.$button.hasClass("disabled")||this.toggleDropdown(),e.stopPropagation()},n.prototype.setButtonLabel=function(e){this.$button&&$(this.$button).text(e)},n.prototype.itemRenderer=function(e){return s.escape(String(e))},n.prototype._renderList=function(e){if(!e)return null;var t="";return this.items.forEach(function(e,n){if("---"===e)t+="<li class='divider'></li>";else{var r=this.itemRenderer(e,n),i=r.html||r,o=r.html&&!r.enabled?"disabled":"";t+="<li><a class='stylesheet-link "+o+"' data-index='"+n+"'>",t+=i,t+="</a></li>"}}.bind(this)),e.append(t),$(this).triggerHandler("listRendered",[e]),this._dropdownEventHandler&&this._dropdownEventHandler.reRegisterMouseHandlers(e),e},n.prototype.refresh=function(){this.$dropdown&&($("li",this.$dropdown).remove(),this._renderList(this.$dropdown))},n.prototype.setChecked=function(e,t){if(this.$dropdown){var n=$("li",this.$dropdown),r=n.length;e>-1&&r>e&&$("a",n[e]).toggleClass("checked",t)}},n.prototype.showDropdown=function(){if(this.items.length&&!this.$dropdown){o.closeAll();var e=$("<ul class='dropdown-menu dropdownbutton-popup' tabindex='-1'>").addClass(this.dropdownExtraClasses).css("min-width",this.$button.outerWidth());this.$dropdown=e,this._renderList(this.$dropdown).appendTo($("body")).data("attached-to",this.$button[0]);var t=this.$button.offset(),n=t.left,s=t.top+this.$button.outerHeight(),l={top:s,left:n,height:e.height(),width:e.width()},c=a.getElementClipSize($(window),l);c.bottom>0&&(s=Math.max(0,t.top-e.height()-4)),c.right>0&&(n=Math.max(0,n-c.right)),e.css({left:n,top:s}),this._dropdownEventHandler=new r(e,this._onSelect.bind(this),this._onDropdownClose.bind(this)),this._dropdownEventHandler.open(),window.document.body.addEventListener("mousedown",this._onClickOutside,!0),$(i).on("workspaceUpdateLayout",this.closeDropdown),this._lastFocus=window.document.activeElement,e.focus()}},n.prototype._onDropdownClose=function(){window.document.body.removeEventListener("mousedown",this._onClickOutside,!0),$(i).off("workspaceUpdateLayout",this.closeDropdown),window.document.activeElement===this.$dropdown[0]&&this._lastFocus.focus(),this._dropdownEventHandler=null,this.$dropdown=null},n.prototype.closeDropdown=function(){this._dropdownEventHandler&&this._dropdownEventHandler.close()},n.prototype._onClickOutside=function(e){var t=$(e.target).closest(".dropdownbutton-popup");$(e.target).is(this.$button)||0!==t.length&&t[0]===this.$dropdown[0]||(this.closeDropdown(),e.stopPropagation(),e.preventDefault())},n.prototype.toggleDropdown=function(){this.$dropdown?this.closeDropdown():this.showDropdown()},n.prototype._onSelect=function(e){var t=Number(e.data("index"));$(this).triggerHandler("select",[this.items[t],t])},t.DropdownButton=n}),define("editor/MultiRangeInlineEditor",["require","exports","module","thirdparty/lodash","document/TextRange","editor/InlineTextEditor","editor/EditorManager","command/Commands","strings","command/CommandManager"],function(e,t){function n(e,t){return parseInt(e.css(t),10)}function r(e){this.name=e.name,this.textRange=new p(e.document,e.lineStart,e.lineEnd)}function i(e,t,n){n&&(t.name=n(t.textRange));var r=d.escape(t.name)+" <span class='related-file'>— "+d.escape(t.textRange.document.file.name)+" : "+(t.textRange.startLine+1)+"</span>";e.html(r),e.attr("title",e.text())}function o(e,t,n){f.call(this),this._ranges=e.map(function(e){return new r(e)}),this._messageCB=t,this._labelCB=n,this._selectedRangeIndex=-1}function a(){var e=h.getFocusedInlineWidget();return e instanceof o?e:null}function s(){var e=a();e&&e._selectPreviousRange()}function l(){var e=a();e&&e._selectNextRange()}var c,u,d=e("thirdparty/lodash"),p=e("document/TextRange").TextRange,f=e("editor/InlineTextEditor").InlineTextEditor,h=e("editor/EditorManager"),m=e("command/Commands"),g=e("strings"),v=e("command/CommandManager");r.prototype.name=null,r.prototype.textRange=null,r.prototype.$listItem=null,o.prototype=Object.create(f.prototype),o.prototype.constructor=o,o.prototype.parentClass=f.prototype,o.prototype.$messageDiv=null,o.prototype.$relatedContainer=null,o.prototype.$related=null,o.prototype.$selectedMarker=null,o.prototype.$rangeList=null,o.prototype._ranges=null,o.prototype._selectedRangeIndex=null,o.prototype._messageCB=null,o.prototype._labelCB=null,o.prototype._createListItem=function(e,t){var n=this,r=$("<li/>"),o=this.$rangeList.children();void 0===t||t===o.length?r.appendTo(this.$rangeList):r.insertBefore(o.get(t)),i(r,e),r.mousedown(function(){n.setSelectedIndex(n._ranges.indexOf(e))}),e.$listItem=r,$(e.textRange).on("change",function(){i(r,e)}).on("contentChange",function(){i(r,e,n._labelCB)}),$(e.textRange).on("lostSync",function(){n._removeRange(e)})},o.prototype.load=function(){o.prototype.parentClass.load.apply(this,arguments),this.$messageDiv=$("<div/>").addClass("inline-editor-message"),this.$editorHolder.on("mousewheel.MultiRangeInlineEditor",function(e){e.stopPropagation()}),this.$relatedContainer=$("<div/>").addClass("related-container"),this.$selectedMarker=$("<div/>").appendTo(this.$relatedContainer).addClass("selection"),this.$related=$("<div/>").appendTo(this.$relatedContainer).addClass("related"),this.$rangeList=$("<ul/>").appendTo(this.$related),this._ranges.forEach(this._createListItem,this),this._ranges.length>1&&this.$wrapper.before(this.$relatedContainer),this.setSelectedIndex(this._ranges.length?0:-1);var e=this._onClick.bind(this);this.$htmlContent.on("click.MultiRangeInlineEditor",e),this.$htmlContent.on("mouseup.MultiRangeInlineEditor",e),this.$htmlContent.on("focusin.MultiRangeInlineEditor",this._updateCommands.bind(this)).on("focusout.MultiRangeInlineEditor",this._updateCommands.bind(this))},o.prototype._updateCommands=function(){var e=this.hasFocus()&&this._ranges.length>1;c.setEnabled(e&&this._selectedRangeIndex>0),u.setEnabled(e&&-1!==this._selectedRangeIndex&&this._selectedRangeIndex<this._ranges.length-1)},o.prototype.onAdded=function(){this.$relatedContainer.height(this.$related.height()),this._updateSelectedMarker(!1),o.prototype.parentClass.onAdded.apply(this,arguments),this._updateEditorMinHeight(),this.sizeInlineWidgetToContents(!0,!1),this._updateCommands()},o.prototype.setSelectedIndex=function(e,t){var n=Math.min(Math.max(-1,e),this._ranges.length-1),r=this;if(t||-1===n||n!==this._selectedRangeIndex){var i=this._selectedRangeIndex>=0?this._ranges[this._selectedRangeIndex].$listItem:null;if(i&&i.removeClass("selected"),this.editor&&$(this.editor).off(".MultiRangeInlineEditor"),this._selectedRangeIndex=n,-1===n)this.setInlineContent(null),this._messageCB?this._messageCB().done(function(e){r.$messageDiv.html(e)}):this.$messageDiv.text(g.INLINE_EDITOR_NO_MATCHES),this.$htmlContent.append(this.$messageDiv),this.sizeInlineWidgetToContents(!0,!1);else{this.$messageDiv.remove();var o=this._getSelectedRange();o.$listItem.addClass("selected"),this.setInlineContent(o.textRange.document,o.textRange.startLine,o.textRange.endLine),this.editor.focus(),this._updateEditorMinHeight(),this.editor.refresh(),$(this.editor).on("cursorActivity.MultiRangeInlineEditor",this._ensureCursorVisible.bind(this)),this.sizeInlineWidgetToContents(!0,!1),this._updateSelectedMarker(!0)}this._updateCommands()}},o.prototype._updateEditorMinHeight=function(){if(this.editor){var e=this.$related.outerHeight(),t=$(".inline-editor-header",this.$htmlContent).outerHeight();e&&t&&$(this.editor.getScrollerElement()).css("min-height",e-t+"px")}},o.prototype._removeRange=function(e){if(this._ranges.length<=1)return void this.close();var t=this._ranges.indexOf(e);t===this._selectedRangeIndex&&this.setSelectedIndex(t+1<this._ranges.length?t+1:t-1),e.$listItem.remove(),e.textRange.dispose(),this._ranges.splice(t,1),t<this._selectedRangeIndex&&(this._selectedRangeIndex--,this._updateSelectedMarker(!0)),1===this._ranges.length&&(this.$relatedContainer.remove(),this.editor&&this.editor.refresh()),this._updateCommands()},o.prototype.addAndSelectRange=function(e,t,n,i){var o,a=new r({name:e,document:t,lineStart:n,lineEnd:i});for(o=this._ranges.length-1;o>=0&&this._ranges[o].textRange.document!==t;o--);-1===o?o=this._ranges.length:o++,this._ranges.splice(o,0,a),this._createListItem(a,o),this.setSelectedIndex(o,!0),this._ranges.length>1&&!this.$relatedContainer.parent().length&&this.$wrapper.before(this.$relatedContainer),this._updateCommands()},o.prototype._updateSelectedMarker=function(e){if(this._selectedRangeIndex<0)return(new $.Deferred).resolve().promise();var t=new $.Deferred,r=this._ranges[this._selectedRangeIndex].$listItem,i=this;return window.setTimeout(function(){var o=i.$relatedContainer.height(),a=r.position().top,s=i.$relatedContainer.scrollTop();if(i.$selectedMarker.toggleClass("animate",e).css("top",a).height(r.outerHeight()),!(0>=o)){var l=n(r.parent(),"paddingTop");if(s>a-l)i.$relatedContainer.scrollTop(a-l);else{var c=a+r.height()+n(r.parent(),"paddingBottom");c>s+o&&i.$relatedContainer.scrollTop(c-o)}t.resolve()}},0),t.promise()},o.prototype.onClosed=function(){o.prototype.parentClass.onClosed.apply(this,arguments),this._ranges.forEach(function(e){e.textRange.dispose()}),this.$htmlContent.off(".MultiRangeInlineEditor"),this.$editorHolder.off(".MultiRangeInlineEditor")},o.prototype._onClick=function(e){function t(t){return t.find(e.target)>0||t[0]===e.target}if(this.editor){var n=this.editor,r=n.getRootElement(),i=$(r).offset();if(!t($(r))&&!t($(".filename",this.$htmlContent))&&(n.focus(),!t(this.$relatedContainer)))if(e.pageY<i.top)n.setCursorPos(0,0);else if(e.pageY>i.top+$(r).height()){var o=n.getLastVisibleLine();n.setCursorPos(o,n.document.getLine(o).length)}}},o.prototype._ensureCursorVisible=function(){if(this.editor&&$.contains(this.editor.getRootElement(),window.document.activeElement)){var e=this.hostEditor.getScrollPos(),t=this.editor._codeMirror.cursorCoords(),n=this.hostEditor.getVirtualScrollAreaTop();this.hostEditor._codeMirror.scrollIntoView({left:e.x,top:t.top-n,right:e.x,bottom:t.bottom-n})}},o.prototype._onLostContent=function(e,t){return t&&"deleted"===t.type?void 0:o.prototype.parentClass._onLostContent.apply(this,arguments)},o.prototype._getRanges=function(){return this._ranges},o.prototype._getSelectedRange=function(){return this._selectedRangeIndex>=0?this._ranges[this._selectedRangeIndex]:null},o.prototype._selectNextRange=function(){this._selectedRangeIndex<this._ranges.length-1&&this.setSelectedIndex(this._selectedRangeIndex+1)},o.prototype._selectPreviousRange=function(){this._selectedRangeIndex>0&&this.setSelectedIndex(this._selectedRangeIndex-1)},o.prototype.sizeInlineWidgetToContents=function(e,t){o.prototype.parentClass.sizeInlineWidgetToContents.call(this,e);var n=Math.max(this.$related.height(),this.$header.outerHeight()+(-1===this._selectedRangeIndex?this.$messageDiv.outerHeight():this.$editorHolder.height()));n&&this.hostEditor.setInlineWidgetHeight(this,n,t)},o.prototype.onParentShown=function(){o.prototype.parentClass.onParentShown.apply(this,arguments),this._updateSelectedMarker(!1)},o.prototype.refresh=function(){o.prototype.parentClass.refresh.apply(this,arguments),this.sizeInlineWidgetToContents(!0),this.editor&&this.editor.refresh()},c=v.register(g.CMD_QUICK_EDIT_PREV_MATCH,m.QUICK_EDIT_PREV_MATCH,s),c.setEnabled(!1),u=v.register(g.CMD_QUICK_EDIT_NEXT_MATCH,m.QUICK_EDIT_NEXT_MATCH,l),u.setEnabled(!1),t.MultiRangeInlineEditor=o,t.getFocusedMultiRangeInlineEditor=a}),define("editor/CSSInlineEditor",["require","exports","module","language/CSSUtils","widgets/DropdownButton","command/CommandManager","command/Commands","document/DocumentManager","editor/EditorManager","editor/Editor","project/ProjectManager","language/HTMLUtils","editor/MultiRangeInlineEditor","strings","utils/ViewUtils","thirdparty/lodash"],function(e){function t(){return m.getAllFiles(m.getLanguageFilter(["css","less","scss"]))}function n(e,t){var n,r=g.getTagInfo(e,t),i="";if(r.position.tokenType===g.TAG_NAME||r.position.tokenType===g.CLOSING_TAG)i=r.tagName;else if(r.position.tokenType===g.ATTR_NAME||r.position.tokenType===g.ATTR_VALUE)if("class"===r.attr.name){var o=r.attr.value;if(/\S/.test(o)){var a=o.substr(0,r.position.offset).lastIndexOf(" "),s=o.indexOf(" ",r.position.offset);i="."+o.substring(-1===a?0:a+1,-1===s?o.length:s),"."===i&&(i="",n=y.ERROR_CSSQUICKEDIT_BETWEENCLASSES)}else n=y.ERROR_CSSQUICKEDIT_CLASSNOTFOUND}else if("id"===r.attr.name){var l=r.attr.value.trim();l?i="#"+l:n=y.ERROR_CSSQUICKEDIT_IDNOTFOUND}else n=y.ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR;return{selectorName:i,reason:n}}function r(e,t,n){p.getDocumentForPath(n).done(function(r){var i=l.addRuleToDocument(r,e,h.getUseTabChar(n),h.getSpaceUnits(n));t.addAndSelectRange(e,r,i.range.from.line,i.range.to.line),t.editor.setCursorPos(i.pos.line,i.pos.ch)})}function i(){var e=v.getFocusedMultiRangeInlineEditor();if(e){var t=b.find(E,function(t){return t.inlineEditor===e});t&&t.handler()}}function o(e){var t="<span class='stylesheet-name'>"+b.escape(e.name);return e.subDirStr.length&&(t+="<span class='stylesheet-dir'> — "+b.escape(e.subDirStr)+"</span>"),t+="</span>"}function a(e){function i(e,t){r(S,b,t.fullPath)}function a(){var e=new $.Deferred;return t().done(function(t){e.resolve(t.length?y.CSS_QUICK_EDIT_NO_MATCHES:y.CSS_QUICK_EDIT_NO_STYLESHEETS)}),e}function u(){s.setEnabled(b.hasFocus()&&!w.$button.hasClass("disabled"))}function d(){w.$button.hasClass("disabled")||(1===I.length?r(S,b,I[0].fullPath):w.toggleDropdown())}function p(e,t){var n=e.name.localeCompare(t.name);return 0!==n?n:e.subDirStr.localeCompare(t.subDirStr)}function f(e){var t,n,r,i=[],o=[];for(e.forEach(function(e){e.subDirStr=""}),e.sort(p),t=1;t<e.length;t++)if(0===p(e[t-1],e[t])){for(r=t-1,o.push(e[t-1]),o.push(e[t]);++t<e.length&&0===p(o[0],e[t]);)o.push(e[t]);for(i=_.getDirNamesForDuplicateFiles(o),n=0;n<i.length;n++)e[r+n].subDirStr=i[n];o=[]}return e.sort(p),e}function h(){w.closeDropdown()}if("html"!==e.getLanguageForSelection().getId())return null;var m=e.getSelection();if(m.start.line!==m.end.line)return null;var g=n(e,m.start);if(""===g.selectorName)return g.reason||null;var b,w,S=g.selectorName,C=new $.Deferred,I=[];return l.findMatchingRules(S,e.document).done(function(n){var r=new $.Deferred;b=new v.MultiRangeInlineEditor(l.consolidateRules(n),a,l.getRangeSelectors),b.load(e),b.$htmlContent.on("focusin",u).on("focusout",u),$(b).on("add",function(){r.resolve()}),$(b).on("close",function(){w.closeDropdown(),$(e).off("scroll",h)});var s=$(".inline-editor-header",b.$htmlContent);w=new c(y.BUTTON_NEW_RULE,[],o),w.$button.addClass("disabled"),w.$button.addClass("btn-mini stylesheet-button"),s.append(w.$button),E.push({inlineEditor:b,handler:d}),$(e).on("scroll",h),C.resolve(b);var p=t();$.when(p,r.promise()).done(function(e){I=f(e),I.length>0&&(w.$button.removeClass("disabled"),n.length||w.$button.focus(),1===I.length?(w.$button.removeClass("btn-dropdown"),w.$button.on("click",d)):(w.items=I,$(w).on("select",i))),u()})}).fail(function(){console.log("Error in findMatchingRules()"),C.reject()}),C.promise()}var s,l=e("language/CSSUtils"),c=e("widgets/DropdownButton").DropdownButton,u=e("command/CommandManager"),d=e("command/Commands"),p=e("document/DocumentManager"),f=e("editor/EditorManager"),h=e("editor/Editor").Editor,m=e("project/ProjectManager"),g=e("language/HTMLUtils"),v=e("editor/MultiRangeInlineEditor"),y=e("strings"),_=e("utils/ViewUtils"),b=e("thirdparty/lodash"),E=[];f.registerInlineEditProvider(a),s=u.register(y.CMD_CSS_QUICK_EDIT_NEW_RULE,d.CSS_QUICK_EDIT_NEW_RULE,i),s.setEnabled(!1)}),define("project/WorkingSetSort",["require","exports","module","command/Commands","command/CommandManager","view/MainViewManager","preferences/PreferencesManager","file/FileUtils","utils/AppInit","strings","thirdparty/lodash"],function(e,t,n){function r(e){var t;return e?(t="string"==typeof e?e:e.getID(),S[t]):void console.error("Attempting to get a Sort method with a missing required parameter: command")}function i(e){return e?(k.hasOwnProperty(e)?(e=k[e],y.setViewState(T,e)):e=null,e):null}function o(){return I}function a(){$(v).off(".sort")}function s(e){I=e,y.setViewState("automaticSort",I),g.get(m.CMD_WORKING_SORT_TOGGLE_AUTO).setChecked(I),C.setChecked(I),I?C.sort():a()}function l(){I&&C&&C.getEvents()&&$(v).on(C.getEvents(),function(){C.sort()}).on("_workingSetDisableAutoSort.sort",function(){s(!1)})}function c(e){C!==e&&(null!==C&&C.setChecked(!1),I&&e.setChecked(!0),g.get(m.CMD_WORKING_SORT_TOGGLE_AUTO).setEnabled(!!e.getEvents()),y.setViewState(T,e.getCommandID()),C=e)}function u(e,t,n){this._commandID=e,this._compareFn=t,this._events=n}function d(e,t,n){var r="";if(!e||!t)return void console.log("Attempting to register a Sort method with a missing required parameter: command or compare function");if(r="string"==typeof e?e:e.getID(),S[r])return void console.log("Attempting to register an already-registered Sort method: "+e);n&&(n=n.split(" "),n.forEach(function(e,t){n[t]=n[t].trim()+".sort"}),n=n.join(" "));var i=new u(r,t,n);return S[r]=i,i}function p(){s(!o())}function f(e){r(e).execute()}function h(){var e=y.getViewState(T);return e||(e=i(y.getViewState(D))),e||(e=m.CMD_WORKINGSET_SORT_BY_ADDED),e}var m=e("command/Commands"),g=e("command/CommandManager"),v=e("view/MainViewManager"),y=e("preferences/PreferencesManager"),_=e("file/FileUtils"),b=e("utils/AppInit"),E=e("strings"),w=e("thirdparty/lodash"),S=[],C=null,I=!1,k={"view.sortWorkingSetByAdded":"cmd.sortWorkingSetByAdded","view.sortWorkingSetByName":"cmd.sortWorkingSetByName","view.sortWorkingSetByType":"cmd.sortWorkingSetByType"},x="workingSetAdd workingSetAddList",T="workingSetSortMethod",D="currentSort";u.prototype.getCommandID=function(){return this._commandID},u.prototype.getCompareFn=function(){return this._compareFn},u.prototype.getEvents=function(){return this._events},u.prototype.setChecked=function(e){var t=g.get(this._commandID);t&&t.setChecked(e)},u.prototype.execute=function(){c(this),this.sort()},u.prototype.sort=function(){C===this&&(a(),v._sortWorkingSet(v.ALL_PANES,this._compareFn),l())},d(m.CMD_WORKINGSET_SORT_BY_ADDED,function(e,t,n){var r=v.findInWorkingSetByAddedOrder(e,t.fullPath),i=v.findInWorkingSetByAddedOrder(e,n.fullPath);return r-i},x),d(m.CMD_WORKINGSET_SORT_BY_NAME,function(e,t,n){return _.compareFilenames(t.name,n.name,!1)},x),d(m.CMD_WORKINGSET_SORT_BY_TYPE,function(e,t,n){return _.compareFilenames(t.name,n.name,!0)},x),g.register(E.CMD_WORKINGSET_SORT_BY_ADDED,m.CMD_WORKINGSET_SORT_BY_ADDED,w.partial(f,m.CMD_WORKINGSET_SORT_BY_ADDED)),g.register(E.CMD_WORKINGSET_SORT_BY_NAME,m.CMD_WORKINGSET_SORT_BY_NAME,w.partial(f,m.CMD_WORKINGSET_SORT_BY_NAME)),g.register(E.CMD_WORKINGSET_SORT_BY_TYPE,m.CMD_WORKINGSET_SORT_BY_TYPE,w.partial(f,m.CMD_WORKINGSET_SORT_BY_TYPE)),g.register(E.CMD_WORKING_SORT_TOGGLE_AUTO,m.CMD_WORKING_SORT_TOGGLE_AUTO,p),y.stateManager.definePreference("automaticSort","boolean",!1),y.convertPreferences(n,{_LEGACY_SORT_PREF:"user",automaticSort:"user"},!0),y.stateManager.definePreference(T,"string",""),b.appReady(function(){var e=h(),t=r(e),n=y.getViewState("automaticSort");t&&c(t),n&&s(n),t&&n&&t.sort()}),t.register=d,t.get=r,t.getAutomatic=o,t.setAutomatic=s}),define("widgets/ModalBar",["require","exports","module","view/MainViewManager","utils/KeyEvent","utils/AnimationUtils","view/WorkspaceManager"],function(e,t){function n(e,t,n){if(void 0===n&&(n=!0),this._handleKeydown=this._handleKeydown.bind(this),this._handleFocusChange=this._handleFocusChange.bind(this),this._$root=$("<div class='modal-bar'/>").html(e).insertBefore("#editor-holder"),n&&(this._$root.addClass("popout offscreen"),window.getComputedStyle(this._$root.get(0)).getPropertyValue("top"),this._$root.removeClass("popout offscreen")),r.focusActivePane(),t){this._autoClose=!0,this._$root.on("keydown",this._handleKeydown),window.document.body.addEventListener("focusin",this._handleFocusChange,!0);var i=$("input[type='text']",this._$root).first();i.length>0?i.focus():$("button",this._$root).first().focus()}r.cacheScrollState(r.ALL_PANES),a.recomputeLayout(),r.restoreAdjustedScrollState(r.ALL_PANES,this.height())
30}var r=e("view/MainViewManager"),i=e("utils/KeyEvent"),o=e("utils/AnimationUtils"),a=e("view/WorkspaceManager");n.prototype._$root=null,n.prototype._autoClose=!1,n.prototype.isLockedOpen=null,n.prototype.height=function(){return this._$root.outerHeight()},n.prototype.prepareClose=function(e){if(void 0===e&&(e=!0),this._$root.addClass("popout"),!brackets.nativeMenus){var t=$("#titlebar").outerHeight();this._$root.css("top",t+"px")}var n=this.height();e&&r.cacheScrollState(r.ALL_PANES),a.recomputeLayout(),e&&r.restoreAdjustedScrollState(r.ALL_PANES,-n)},n.prototype.close=function(e,t){function n(){a._$root.remove(),i.resolve()}var i=new $.Deferred,a=this;return void 0===e&&(e=!0),void 0===t&&(t=!0),this._$root.hasClass("popout")||this.prepareClose(e),this._autoClose&&window.document.body.removeEventListener("focusin",this._handleFocusChange,!0),$(this).triggerHandler("close"),t?o.animateUsingClass(this._$root.get(0),"offscreen").done(n):n(),r.focusActivePane(),i.promise()},n.prototype._handleKeydown=function(e){e.keyCode===i.DOM_VK_ESCAPE&&(e.stopPropagation(),e.preventDefault(),this.close())},n.prototype._handleFocusChange=function(e){if(!this.isLockedOpen||!this.isLockedOpen()){var t=$(e.target).data("attached-to")||e.target;$.contains(this._$root.get(0),t)||this.close()}},n.prototype.getRoot=function(){return this._$root},t.ModalBar=n}),define("utils/StringMatch",["require","exports","module","thirdparty/lodash"],function(e,t){function n(e){this.label=e}function r(e){var t,n,r=[0],i=0,o=!1;for(t=0;t<e.length;t++)n=e[t],"/"===n?(r.push(t++),r.push(t),i=r.length-1,o=!1):"."===n||"-"===n||"_"===n?(r.push(t++),r.push(t),o=!1):n.toUpperCase()===n?(o&&r.push(t),o=!1):o=!0;return{specials:r,lastSegmentSpecialsIndex:i}}function i(e){_=e}function o(e){this.index=e}function a(e){this.index=e}function s(e,t,n,r){function i(){var r;for(r=u;r<n.length&&!(n[r]>=p[l]);r++)if(n[r]<d)u=r;else if(e[l]===t[n[r]])return u=r,l++,d=n[r],c.push(new o(d++)),!0;return!1}function s(){for(;c.length>0;){var e=c.pop();if(!e)return!1;if(l--,e instanceof o&&(u--,e.index<p[l]))return p[l]=e.index-1,f=y,(e=c[c.length-1])?(d=e.index+1,!0):(d=n[r]+1,!0)}return!1}var l,c=[],u=r,d=n[r],p=[];for(l=0;l<e.length;l++)p[l]=1/0;l=0;for(var f=v;;){for(;l<e.length&&d<t.length&&d<=p[l];)f===v&&(i()||(f=y)),f===y&&(e[l]===t[d]?(l++,c.push(new a(d++)),f=v):d++);if(l>=e.length||l<e.length&&!s())break}return l<e.length||0===c.length?null:c}function l(e,t,n,r){var i,o,a="",l=n[r]+e.length-t.length;for(l>0&&(a=e.substring(0,l),e=e.substring(l)),i=0;i<e.length&&(o=s(e.substring(i),t,n,r),!o&&0!==r);i++);return i!==e.length&&o?{remainder:a+e.substring(0,i),matchList:o}:null}function c(e,t,n,r){var i,o,a=n[r];if(i=l(e,t,n,r,a)){if(o=i.matchList,i.remainder){var c=s(i.remainder,t.substring(0,a),n.slice(0,r),0);if(!c)return null;o.unshift.apply(o,c)}}else o=s(e,t,n,0);return o}function u(e,t,n){function r(e){f&&(f.includesLastSegment=c>=n,f.matched&&f.includesLastSegment&&(_&&(s.lastSegment+=u*w),p+=u*w),f.matched&&!d&&(_&&(s.notStartingOnSpecial-=k),p-=k),l.push(f)),e>c+1&&l.push({text:t.substring(c+1,e),matched:!1,includesLastSegment:e>n}),f=null,u=0}function i(e){var i=e.index,a=0;if(_&&(s.match+=E),a+=E,i===n&&(_&&(s.beginning+=S),a+=S),p>0&&c+1===i){i-h===n&&(_&&(s.beginning+=S),a+=S),h++;var l=I*h;d&&(l=2*l),_&&(s.consecutive+=l),a+=l}else h=1;e instanceof o&&(_&&(s.special+=b),a+=b),p+=a,i>=n&&(u+=a),(f&&!f.matched||i>c+1)&&r(i),c=i,f?f.text+=t[i]:(f={text:t[i],matched:!0},d=e instanceof o)}var a,s,l=[],c=-1,u=0,d=!1,p=0;_&&(s={special:0,match:0,lastSegment:0,beginning:0,lengthDeduction:0,consecutive:0,notStartingOnSpecial:0});var f=null,h=0;for(a=0;a<e.length;a++){var m=e[a];i(m)}r(t.length);var g=-1*Math.round(t.length*C);_&&(s.lengthDeduction=g),p+=g;var v={ranges:l,matchGoodness:p};return _&&(v.scoreDebug=s),v}function d(e,t){var r=new n(e);return r.matchGoodness=-Number.MAX_VALUE,_&&(r.scoreDebug={beginning:Number.MAX_VALUE}),r.stringRanges=[{text:e.substr(0,t.length),matched:!0,includesLastSegment:!0}],e.length>t.length&&r.stringRanges.push({text:e.substring(t.length),matched:!1,includesLastSegment:!0}),r}function p(e,t,i,o){var a;if(i=i||{},!t)return a=new n(e),a.matchGoodness=0,_&&(a.scoreDebug={}),a.stringRanges=[{text:e,matched:!1,includesLastSegment:!0}],a;t=t.toLowerCase();var l=e.toLowerCase();if(i.preferPrefixMatches&&(i.segmentedSearch=!1),i.preferPrefixMatches&&l.substr(0,t.length)===t)return d(e,t);o||(o=r(e));var p,f;if(i.segmentedSearch?(p=o.specials[o.lastSegmentSpecialsIndex],f=c(t,l,o.specials,o.lastSegmentSpecialsIndex)):(p=0,f=s(t,l,o.specials,0)),f){var h=u(f,e,p);a=new n(e),a.stringRanges=h.ranges,a.matchGoodness=-1*h.matchGoodness,_&&(a.scoreDebug=h.scoreDebug)}return a}function f(e,t){var n;Array.isArray(t)?n=t:(n=[],g.forEach(t,function(e,t){n[e]=t})),e.sort(function(e,t){var r;for(r=0;r<n.length;r++){var i=n[r];if("function"==typeof i){var o=i(e,t);if(o)return o}else{var a=e[i],s=t[i];if("string"==typeof a&&(a=a.toLowerCase(),s=s.toLowerCase()),s>a)return-1;if(a>s)return 1}}return 0})}function h(e){f(e,{matchGoodness:0,label:1})}function m(e){this.options=e,this.reset()}var g=e("thirdparty/lodash"),v=0,y=1,_=!1,b=35,E=10,w=1,S=10,C=.2,I=7,k=25;m.prototype._specialsCache=null,m.prototype._noMatchCache=null,m.prototype.reset=function(){this._lastQuery=null,this._specialsCache={},this._noMatchCache={}},m.prototype.match=function(e,t){if(null!==this._lastQuery&&this._lastQuery!==t.substring(0,this._lastQuery.length)&&(this._noMatchCache={}),this._lastQuery=t,g.has(this._noMatchCache,e))return void 0;var n=g.has(this._specialsCache,e)?this._specialsCache[e]:void 0;void 0===n&&(n=r(e),this._specialsCache[e]=n);var i=p(e,t,this.options,n);return i||(this._noMatchCache[e]=!0),i},t._findSpecialCharacters=r,t._wholeStringSearch=c,t._lastSegmentSearch=l,t._setDebugScores=i,t._generateMatchList=s,t._SpecialMatch=o,t._NormalMatch=a,t._computeRangesAndScore=u,t.SearchResult=n,t.stringMatch=p,t.basicMatchSort=h,t.multiFieldSort=f,t.StringMatcher=m}),define("search/QuickOpen",["require","exports","module","document/DocumentManager","editor/EditorManager","view/MainViewManager","view/MainViewFactory","command/CommandManager","strings","utils/StringUtils","command/Commands","project/ProjectManager","language/LanguageManager","utils/KeyEvent","widgets/ModalBar","utils/StringMatch","utils/ViewUtils"],function(e,t){function n(e,t,n,r,i,o,a,s,l,c){this.name=e,this.languageIds=t,this.done=n,this.search=r,this.match=i,this.itemFocus=o,this.itemSelect=a,this.resultsFormatter=s,this.matcherOptions=l,this.label=c}function r(e){e.fileTypes&&!e.languageIds&&(console.warn("Using fileTypes for QuickOpen plugins is deprecated. Use languageIds instead."),e.languageIds=e.fileTypes.map(function(e){return O.getLanguageForPath("file."+e).getId()}),delete e.fileTypes),F.push(new n(e.name,e.languageIds,e.done,e.search,e.match,e.itemFocus,e.itemSelect,e.resultsFormatter,e.matcherOptions,e.label))}function i(){this.$searchField=void 0,this._handleItemSelect=this._handleItemSelect.bind(this),this._handleItemFocus=this._handleItemFocus.bind(this),this._handleKeyUp=this._handleKeyUp.bind(this),this._handleResultsReady=this._handleResultsReady.bind(this),this._handleShowResults=this._handleShowResults.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleDocumentMouseDown=this._handleDocumentMouseDown.bind(this),this._filterCallback=this._filterCallback.bind(this),this._resultsFormatterCallback=this._resultsFormatterCallback.bind(this),this._filenameMatcher=new A.StringMatcher({segmentedSearch:!0}),this._matchers={}}function o(e,t){var n;return t?n=e.length:(n=e.lastIndexOf("."),-1===n&&(n=e.length)),e.slice(e.lastIndexOf("/")+1,n)}function a(e){var t=e.match(P);return e.length<=1||!t||t[1]&&isNaN(t[1])||t[3]&&isNaN(t[3])?null:{query:t[0],local:0===e.indexOf(":"),line:t[1]-1||0,ch:t[3]-1||0}}function s(){var e=$("input#quickOpenSearch").data("smart-autocomplete").rawResults;return e||[]}function l(e){if(!e)return null;var t=$(e).index(),n=s();return n[t]}function c(e){var t=$("input#quickOpenSearch").val();return t!==e}function u(e,t){if(!_){var n=new $.Deferred;return b.done(function(){c(e)?n.reject():n.resolve(u(e,t))}),n.promise()}var r=a(e);r&&!r.local&&""!==r.query&&(e=e.replace(r.query,""));var i=$.map(_,function(n){var r;return r=t.match(M.makeProjectRelativeIfPossible(n.fullPath),e),r&&(r.label=n.name,r.fullPath=n.fullPath,r.filenameWithoutExtension=o(n.name,!1)),r});return A.multiFieldSort(i,{matchGoodness:0,filenameWithoutExtension:1,label:2,fullPath:3}),i}function d(e,t,n){var r=e.label||e;t=t||"quicksearch-namematch";var i=e.stringRanges;i||(i=[{text:r,matched:!1,includesLastSegment:!0}]);var o="";if(e.scoreDebug){var a=e.scoreDebug;o+='<span title="sp:'+a.special+", m:"+a.match+", ls:"+a.lastSegment+", b:"+a.beginning+", ld:"+a.lengthDeduction+", c:"+a.consecutive+", nsos: "+a.notStartingOnSpecial+'">('+e.matchGoodness+") </span>"}return i.forEach(function(e){e.matched&&(o+="<span class='"+t+"'>");var r=n?n(e.includesLastSegment,e.text):e.text;o+=T.breakableUrl(r),e.matched&&(o+="</span>")}),o}function p(e,t){t=t.slice(t.indexOf("@")+1,t.length);var n=d(e);return"<li>"+n+"</li>"}function f(e){function t(e,t){if(e){var n=t.lastIndexOf("/");return t.substring(n+1)}return""}var n=d(e,null,t),r=d(e,"quicksearch-pathmatch");return"<li>"+n+"<br /><span class='quick-open-path'>"+r+"</span></li>"}function h(){var e=S.getActiveEditor();return e&&e.getSelectedText()||""}function m(e,t){function n(){E=new i,E.showDialog(e,t)}E?E.isOpen?E.setSearchFieldValue(e,t):E.close().done(n):n()}function g(){m("",h())}function v(){w.getCurrentDocument()&&m(":","")}function y(){w.getCurrentDocument()&&m("@",h())}var _,b,E,w=e("document/DocumentManager"),S=e("editor/EditorManager"),C=e("view/MainViewManager"),I=e("view/MainViewFactory"),k=e("command/CommandManager"),x=e("strings"),T=e("utils/StringUtils"),D=e("command/Commands"),M=e("project/ProjectManager"),O=e("language/LanguageManager"),L=e("utils/KeyEvent"),R=e("widgets/ModalBar").ModalBar,A=e("utils/StringMatch"),N=e("utils/ViewUtils"),P=new RegExp(":([^,]+)?(,(.+)?)?"),F=[],U=null;i.prototype.isOpen=!1,i.prototype._filenameMatcher=null,i.prototype._matchers=null,i.prototype._closeDeferred=null,i.prototype._origDocPath=null,i.prototype._origSelections=null,i.prototype._origScrollPos=null,i.prototype._handleItemSelect=function(e,t){t||(t=$(".smart_autocomplete_container > li:first-child").get(0));var n=l(t),r=!0,i=this,o=this.$searchField.val(),s=a(o);if(U)U.itemSelect(n);else{var c=n&&n.fullPath;c?(r=!1,this.modalBar.prepareClose(),k.execute(D.CMD_ADD_TO_WORKINGSET_AND_OPEN,{fullPath:c}).done(function(){if(s){var e=S.getCurrentFullEditor();e.setCursorPos(s.line,s.ch,!0)}}).always(function(){i.close()})):s&&S.getCurrentFullEditor().setCursorPos(s.line,s.ch,!0)}r&&(this.close(),C.focusActivePane())},i.prototype._handleItemFocus=function(e,t){var n=l(t);U&&U.itemFocus&&U.itemFocus(n)},i.prototype._handleKeyUp=function(e){if(e.keyCode===L.DOM_VK_RETURN||e.keyCode===L.DOM_VK_ESCAPE){e.stopImmediatePropagation(),e.preventDefault();var t=this;setTimeout(function(){e.keyCode===L.DOM_VK_ESCAPE?t.close(t._origScrollPos,t._origSelections):e.keyCode===L.DOM_VK_RETURN&&t._handleItemSelect(null,$(".smart_autocomplete_highlight").get(0))},0)}},i.prototype._isValidLineNumberQuery=function(e){if(":"===e)return!0;var t=a(e),n=S.getCurrentFullEditor();return t&&n&&t.line>=n.getFirstVisibleLine()&&t.line<=n.getLastVisibleLine()},i.prototype._handleResultsReady=function(e,t){var n=0===t.length&&(_||U)&&!this._isValidLineNumberQuery(this.$searchField.val());N.toggleClass(this.$searchField,"no-results",n)},i.prototype._handleShowResults=function(){0===$(".smart_autocomplete_highlight").length&&this._handleItemFocus(null,$(".smart_autocomplete_container > li:first-child").get(0))},i.prototype.close=function(e,t){if(!this.isOpen)return this._closeDeferred.promise();this.isOpen=!1,this._closeDeferred=new $.Deferred;var n;for(n=0;n<F.length;n++){var r=F[n];r.done&&r.done()}this.$searchField.trigger("lostFocus");var i=this;return setTimeout(function(){i.modalBar.close(!!e).done(function(){i._closeDeferred.resolve()});var n=S.getCurrentFullEditor();t&&n.setSelections(t),e&&n.setScrollPos(e.x,e.y)},0),$(".smart_autocomplete_container").remove(),$(window.document).off("mousedown",this._handleDocumentMouseDown),this._closeDeferred.promise()},i.prototype._filterCallback=function(e){if(c(e))return s();var t=a(e);if(t&&t.local){var n={line:t.line,ch:t.ch},r={line:t.line};S.getCurrentFullEditor().setSelection(n,r,!0)}var i,o=w.getCurrentDocument();o&&(i=o.getLanguage().getId());var l;for(l=0;l<F.length;l++){var d=F[l],p=0===d.languageIds.length||-1!==d.languageIds.indexOf(i);if(p&&d.match&&d.match(e)){U=d;var f=this._matchers[U.name];return f||(f=new A.StringMatcher(d.matcherOptions),this._matchers[U.name]=f),this._updateDialogLabel(d,e),d.search(e,f)}}return this._updateDialogLabel(null,e),U=null,u(e,this._filenameMatcher)},i.prototype._resultsFormatterCallback=function(e){var t,n=this.$searchField.val();return(t=U?U.resultsFormatter||p:f)(e,n)},i.prototype.setSearchFieldValue=function(e,t){e=e||"",t=t||"",t=e+t;var n=this.$searchField;n.val(t),n.get(0).setSelectionRange(e.length,t.length),n.trigger("keyIn",[t])},i.prototype._updateDialogLabel=function(e,t){var n="";if(e&&e.label)n=e.label;else{var r=t.length>0?t.charAt(0):"";switch(r){case":":n=x.CMD_GOTO_LINE+"…";break;case"@":n=x.CMD_GOTO_DEFINITION+"…";break;default:n=""}}$(".find-dialog-label",this.dialog).text(n)},i.prototype._handleDocumentMouseDown=function(e){0===this.modalBar.getRoot().find(e.target).length&&0===$(".smart_autocomplete_container").find(e.target).length?this.close():$("input#quickOpenSearch").get(0)!==e.target&&(e.preventDefault(),e.stopPropagation())},i.prototype._handleBlur=function(){this.close()},i.prototype.showDialog=function(e,t){function n(e){return!O.getLanguageForPath(e.fullPath).isBinary()||I.findSuitableFactoryForPath(e.fullPath)}if(!this.isOpen){this.isOpen=!0,$(window.document).on("mousedown",this._handleDocumentMouseDown);var r=w.getCurrentDocument();this._origDocPath=r?r.file.fullPath:null,r?(this._origSelections=S.getCurrentFullEditor().getSelections(),this._origScrollPos=S.getCurrentFullEditor().getScrollPos()):(this._origSelections=null,this._origScrollPos=null);var i="<div align='right'><input type='text' autocomplete='off' id='quickOpenSearch' placeholder='"+x.CMD_QUICK_OPEN+"…' style='width: 30em'><span class='find-dialog-label'></span></div>";this.modalBar=new R(i,!1),this.$searchField=$("input#quickOpenSearch"),this.$searchField.bind({resultsReady:this._handleResultsReady,showResults:this._handleShowResults,itemSelect:this._handleItemSelect,itemFocus:this._handleItemFocus,keyup:this._handleKeyUp,blur:this._handleBlur}),this.$searchField.smartAutoComplete({source:[],maxResults:20,minCharLimit:0,autocompleteFocused:!0,forceSelect:!1,typeAhead:!1,filter:this._filterCallback,resultFormatter:this._resultsFormatterCallback}),this.setSearchFieldValue(e,t),b=M.getAllFiles(n,!0).done(function(e){_=e,b=null,this._filenameMatcher.reset()}.bind(this))}},$(M).on("projectOpen",function(){_=null}),k.register(x.CMD_QUICK_OPEN,D.NAVIGATE_QUICK_OPEN,g),k.register(x.CMD_GOTO_DEFINITION,D.NAVIGATE_GOTO_DEFINITION,y),k.register(x.CMD_GOTO_LINE,D.NAVIGATE_GOTO_LINE,v),t.beginSearch=m,t.addQuickOpenPlugin=r,t.highlightMatch=d,t.stringMatch=A.stringMatch,t.SearchResult=A.SearchResult,t.basicMatchSort=A.basicMatchSort,t.multiFieldSort=A.multiFieldSort}),define("project/SidebarView",["require","exports","module","utils/AppInit","project/ProjectManager","project/WorkingSetView","view/MainViewManager","command/CommandManager","command/Commands","strings","utils/Resizer","thirdparty/lodash"],function(e,t){function n(){var e=w.getProjectRoot().name,t=w.getProjectRoot().fullPath;""===e&&"/"===t&&(e="/"),m.html(D.escape(e)),m.attr("title",t),g.trigger("scroll")}function r(){T.toggle(p)}function i(){T.show(p)}function o(){T.hide(p)}function a(){return T.isVisible(p)}function s(){1===C.getPaneCount()&&0===C.getWorkingSetSize(C.ACTIVE_PANE)?(v.hide(),f.hide()):(v.show(),f.show())}function l(){var e,t=["splitview-icon-none","splitview-icon-vertical","splitview-icon-horizontal"],n=C.getLayoutScheme();e=n.columns>1?1:n.rows>1?2:0,h.removeClass(t.join(" ")).addClass(t[e]),y.setChecked(0===e),_.setChecked(1===e),b.setChecked(2===e),s()}function c(){C.setLayoutScheme(1,1)}function u(){C.setLayoutScheme(1,2)}function d(){C.setLayoutScheme(2,1)}var p,f,h,m,g,v,y,_,b,E=e("utils/AppInit"),w=e("project/ProjectManager"),S=e("project/WorkingSetView"),C=e("view/MainViewManager"),I=e("command/CommandManager"),k=e("command/Commands"),x=e("strings"),T=e("utils/Resizer"),D=e("thirdparty/lodash");E.htmlReady(function(){function e(){var e;p.find(".sidebar-selection").each(function(t,n){e=$(n),e.width(e.parent()[0].scrollWidth)})}p=$("#sidebar"),f=p.find(".working-set-option-btn"),h=p.find(".working-set-splitview-btn"),m=p.find("#project-title"),g=p.find("#project-files-container"),v=p.find("#working-set-list-container"),p.on("panelResizeStart",function(){p.find(".sidebar-selection-extension").css("display","none"),p.find(".scroller-shadow").css("display","none")}),p.on("panelResizeUpdate",function(e,t){p.find(".sidebar-selection").width(t),w._setFileTreeSelectionWidth(t)}),p.on("panelResizeEnd",function(t,n){e(),p.find(".sidebar-selection-extension").css("display","block").css("left",n),p.find(".scroller-shadow").css("display","block"),g.triggerHandler("scroll"),S.syncSelectionIndicator()}),p.on("panelCollapsed",function(){I.get(k.VIEW_HIDE_SIDEBAR).setName(x.CMD_SHOW_SIDEBAR)}),p.on("panelExpanded",function(t,n){S.refresh(),e(),p.find(".scroller-shadow").css("display","block"),p.find(".sidebar-selection-extension").css("left",n),g.triggerHandler("scroll"),S.syncSelectionIndicator(),I.get(k.VIEW_HIDE_SIDEBAR).setName(x.CMD_HIDE_SIDEBAR)}),p.is(":visible")||p.trigger("panelCollapsed"),$(C).on("paneCreate",function(e,t){S.createWorkingSetViewForPane(v,t)}),$(C).on("paneLayoutChange",function(){l()}),$(C).on("workingSetAdd workingSetAddList workingSetRemove workingSetRemoveList workingSetUpdate",function(){s()}),D.forEach(C.getPaneIdList(),function(e){S.createWorkingSetViewForPane(v,e)}),l(),f.attr("title",x.GEAR_MENU_TOOLTIP),h.attr("title",x.SPLITVIEW_MENU_TOOLTIP)}),$(w).on("projectOpen",n),y=I.register(x.CMD_SPLITVIEW_NONE,k.CMD_SPLITVIEW_NONE,c),_=I.register(x.CMD_SPLITVIEW_VERTICAL,k.CMD_SPLITVIEW_VERTICAL,u),b=I.register(x.CMD_SPLITVIEW_HORIZONTAL,k.CMD_SPLITVIEW_HORIZONTAL,d),I.register(x.CMD_HIDE_SIDEBAR,k.VIEW_HIDE_SIDEBAR,r),t.toggle=r,t.show=i,t.hide=o,t.isVisible=a}),define("LiveDevelopment/Servers/BaseServer",["require","exports","module"],function(e,t){function n(e){this._baseUrl=e.baseUrl,this._root=e.root,this._pathResolver=e.pathResolver,this._liveDocuments={}}n.prototype.getBaseUrl=function(){return this._baseUrl},n.prototype._setDocInfo=function(e){var t,n,r=e.doc;n=/^(.*\/)(.+\.([^.]+))$/.exec(r.file.fullPath),n&&(r.extension=n[3],t=this.pathToUrl(n[1]),r.url=t+encodeURI(n[2]),r.root={url:r.url},r.isDirty&&e._updateBrowser&&e._updateBrowser())},n.prototype.pathToUrl=function(e){var t=this.getBaseUrl(),n=this._pathResolver(e);if(n!==e){var r=encodeURI(e),i=encodeURI(this._root);return r.replace(i,t)}return null},n.prototype.urlToPath=function(e){var t,n="";return n=this.getBaseUrl(),""!==n&&0===e.indexOf(n)?(t=e.replace(n,encodeURI(this._root)),decodeURI(t)):null},n.prototype.readyToServe=function(){return $.Deferred().resolve().promise()},n.prototype.canServe=function(){return!0},n.prototype._documentKey=function(e){return"/"+encodeURI(this._pathResolver(e))},n.prototype.add=function(e){if(e){var t=this._documentKey(e.doc.file.fullPath);this._setDocInfo(e),this._liveDocuments[t]=e}},n.prototype.remove=function(e){if(e){var t=this._liveDocuments[this._documentKey(e.doc.file.fullPath)];t&&delete this._liveDocuments[t]}},n.prototype.get=function(e){return this._liveDocuments[this._documentKey(e)]},n.prototype.clear=function(){this._liveDocuments={}},n.prototype.start=function(){},n.prototype.stop=function(){},t.BaseServer=n}),define("LiveDevelopment/Servers/FileServer",["require","exports","module","LiveDevelopment/Servers/BaseServer","file/FileUtils"],function(e,t){function n(e){r.call(this,e)}var r=e("LiveDevelopment/Servers/BaseServer").BaseServer,i=e("file/FileUtils"),o="win"===brackets.platform?"file:///":"file://";n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.canServe=function(e){return!this._baseUrl&&i.isStaticHtmlFileExt(e)},n.prototype.urlToPath=function(e){return 0===e.indexOf(o)?decodeURI(e.slice(o.length)):null},n.prototype.pathToUrl=function(e){return encodeURI(o+e)},t.FileServer=n}),define("LiveDevelopment/LiveDevServerManager",["require","exports","module"],function(e,t){function n(e,t){return t.priority-e.priority}function r(e){var t,n,r;for(r=0;r<o.length;r++)if(t=o[r],n=t.create(),n.canServe(e))return n;return null}function i(e,t){if(!e.create)return void console.error("Incompatible live development server provider");var r={};r.create=e.create,r.priority=t||0,o.push(r),o.sort(n)}var o=[];t.getProvider=r,t.registerProvider=i,t.getServer=r,t.registerServer=i}),define("LiveDevelopment/Servers/UserServer",["require","exports","module","LiveDevelopment/Servers/BaseServer","file/FileUtils"],function(e,t){function n(e){r.call(this,e)}var r=e("LiveDevelopment/Servers/BaseServer").BaseServer,i=e("file/FileUtils");n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.canServe=function(e){return this._baseUrl?e===this._pathResolver(e)?!1:i.isStaticHtmlFileExt(e)||i.isServerHtmlFileExt(e):!1},t.UserServer=n}),define("LiveDevelopment/Agents/CSSAgent",["require","exports","module","thirdparty/path-utils/path-utils.min","thirdparty/lodash","LiveDevelopment/Inspector/Inspector"],function(e,t){function n(e){return PathUtils.parseUrl(e).hrefNoSearch}function r(e,t){t.frame.parentId||(v={})}function i(e){var t,r={};e=n(e);for(t in v)v[t].canonicalizedURL===e&&(r[t]=v[t]);return r}function o(){var e,t=[];for(e in v)t[v[e].canonicalizedURL]=!0;return m.keys(t)}function a(e,t){var n,r=i(e.url),o=[];void 0===t&&(t=e.getText());for(n in r)o.push(g.CSS.setStyleSheetText(r[n].styleSheetId,t));return o.length?$.when.apply($,o):(console.error("Style Sheet for document not loaded: "+e.url),(new $.Deferred).reject().promise())}function s(e){return a(e,"")}function l(e,r){var o,a=n(r.header.sourceURL),s=i(r.header.sourceURL),l=r.header.styleSheetId;o=m.some(s,function(e){return e&&e.styleSheetId===l}),o||(v[l]=r.header,v[l].canonicalizedURL=a,$(t).triggerHandler("styleSheetAdded",[a,r.header]))}function c(e,n){var r=v[n.styleSheetId];delete v[n.styleSheetId],$(t).triggerHandler("styleSheetRemoved",[r.canonicalizedURL,r])}function u(){var e,t,n;return void 0===h&&(e=/Chrome\/(\d+)\./,t=g.getUserAgent(),n=t.match(e),n&&parseInt(n[1],10)>=34)?(h=!0,void $(g.Page).off("frameStoppedLoading.CSSAgent",u)):void g.send("CSS","getAllStyleSheets").done(function(e){e.headers.forEach(function(e){h=!1,l(null,{header:e})})}).fail(function(e){h=-32601===e.code,$(g.Page).off("frameStoppedLoading.CSSAgent",u)})}function d(){return g.CSS.enable()}function p(){$(g.Page).on("frameNavigated.CSSAgent",r),$(g.CSS).on("styleSheetAdded.CSSAgent",l),$(g.CSS).on("styleSheetRemoved.CSSAgent",c),h||$(g.Page).on("frameStoppedLoading.CSSAgent",u)}function f(){$(g.Page).off(".CSSAgent"),$(g.CSS).off(".CSSAgent")}e("thirdparty/path-utils/path-utils.min");var h,m=e("thirdparty/lodash"),g=e("LiveDevelopment/Inspector/Inspector"),v={};t.enable=d,t.styleForURL=i,t.getStylesheetURLs=o,t.reloadCSSForDocument=a,t.clearCSSForDocument=s,t.load=p,t.unload=f}),define("text!LiveDevelopment/Agents/RemoteFunctions.js",[],function(){return'/*\n * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the "Software"), \n * to deal in the Software without restriction, including without limitation \n * the rights to use, copy, modify, merge, publish, distribute, sublicense, \n * and/or sell copies of the Software, and to permit persons to whom the \n * Software is furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \n * DEALINGS IN THE SOFTWARE.\n * \n */\n\n\n/*jslint vars: true, plusplus: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */\n/*jshint unused: false */\n/*global window, navigator, Node, console */\n/*theseus instrument: false */\n\n/**\n * RemoteFunctions define the functions to be executed in the browser. This\n * modules should define a single function that returns an object of all\n * exported functions.\n */\nfunction RemoteFunctions(experimental) {\n \n\n var lastKeepAliveTime = Date.now();\n \n /**\n * @type {DOMEditHandler}\n */\n var _editHandler;\n \n var HIGHLIGHT_CLASSNAME = "__brackets-ld-highlight",\n KEEP_ALIVE_TIMEOUT = 3000; // Keep alive timeout value, in milliseconds\n \n // determine whether an event should be processed for Live Development\n function _validEvent(event) {\n if (navigator.platform.substr(0, 3) === "Mac") {\n // Mac\n return event.metaKey;\n } else {\n // Windows\n return event.ctrlKey;\n }\n }\n\n // determine the color for a type\n function _typeColor(type, highlight) {\n switch (type) {\n case "html":\n return highlight ? "#eec" : "#ffe";\n case "css":\n return highlight ? "#cee" : "#eff";\n case "js":\n return highlight ? "#ccf" : "#eef";\n default:\n return highlight ? "#ddd" : "#eee";\n }\n }\n\n // compute the screen offset of an element\n function _screenOffset(element, key) {\n var bounds = element.getBoundingClientRect();\n if (key === "offsetLeft") {\n return bounds.left + window.pageXOffset;\n } else {\n return bounds.top + window.pageYOffset;\n }\n }\n\n // set an event on a element\n function _trigger(element, name, value, autoRemove) {\n var key = "data-ld-" + name;\n if (value !== undefined && value !== null) {\n element.setAttribute(key, value);\n if (autoRemove) {\n window.setTimeout(element.removeAttribute.bind(element, key));\n }\n } else {\n element.removeAttribute(key);\n }\n }\n\n // construct the info menu\n function Menu(element) {\n this.element = element;\n _trigger(this.element, "showgoto", 1, true);\n window.setTimeout(window.remoteShowGoto);\n this.remove = this.remove.bind(this);\n }\n\n Menu.prototype = {\n onClick: function (url, event) {\n event.preventDefault();\n _trigger(this.element, "goto", url, true);\n this.remove();\n },\n\n createBody: function () {\n if (this.body) {\n return;\n }\n\n // compute the position on screen\n var x = _screenOffset(this.element, "offsetLeft");\n var y = _screenOffset(this.element, "offsetTop") + this.element.offsetHeight;\n\n // create the container\n this.body = document.createElement("div");\n this.body.style.setProperty("z-index", 2147483647);\n this.body.style.setProperty("position", "absolute");\n this.body.style.setProperty("left", x + "px");\n this.body.style.setProperty("top", y + "px");\n this.body.style.setProperty("font-size", "11pt");\n\n // draw the background\n this.body.style.setProperty("background", "#fff");\n this.body.style.setProperty("border", "1px solid #888");\n this.body.style.setProperty("-webkit-box-shadow", "2px 2px 6px 0px #ccc");\n this.body.style.setProperty("border-radius", "6px");\n this.body.style.setProperty("padding", "6px");\n },\n\n addItem: function (target) {\n var item = document.createElement("div");\n item.style.setProperty("padding", "2px 6px");\n if (this.body.childNodes.length > 0) {\n item.style.setProperty("border-top", "1px solid #ccc");\n }\n item.style.setProperty("cursor", "pointer");\n item.style.setProperty("background", _typeColor(target.type));\n item.innerHTML = target.name;\n item.addEventListener("click", this.onClick.bind(this, target.url));\n\n if (target.file) {\n var file = document.createElement("i");\n file.style.setProperty("float", "right");\n file.style.setProperty("margin-left", "12px");\n file.innerHTML = " " + target.file;\n item.appendChild(file);\n }\n this.body.appendChild(item);\n },\n\n show: function () {\n if (!this.body) {\n this.body = this.createBody();\n }\n if (!this.body.parentNode) {\n document.body.appendChild(this.body);\n }\n document.addEventListener("click", this.remove);\n },\n\n remove: function () {\n if (this.body && this.body.parentNode) {\n document.body.removeChild(this.body);\n }\n document.removeEventListener("click", this.remove);\n }\n\n };\n\n function Editor(element) {\n this.onBlur = this.onBlur.bind(this);\n this.onKeyPress = this.onKeyPress.bind(this);\n\n this.element = element;\n this.element.setAttribute("contenteditable", "true");\n this.element.focus();\n this.element.addEventListener("blur", this.onBlur);\n this.element.addEventListener("keypress", this.onKeyPress);\n\n this.revertText = this.element.innerHTML;\n\n _trigger(this.element, "edit", 1);\n }\n\n Editor.prototype = {\n onBlur: function (event) {\n this.element.removeAttribute("contenteditable");\n this.element.removeEventListener("blur", this.onBlur);\n this.element.removeEventListener("keypress", this.onKeyPress);\n _trigger(this.element, "edit", 0, true);\n },\n\n onKeyPress: function (event) {\n switch (event.which) {\n case 13: // return\n this.element.blur();\n break;\n case 27: // esc\n this.element.innerHTML = this.revertText;\n this.element.blur();\n break;\n }\n }\n };\n\n function Highlight(color, trigger) {\n this.color = color;\n this.trigger = !!trigger;\n this.elements = [];\n this.selector = "";\n }\n\n Highlight.prototype = {\n _elementExists: function (element) {\n var i;\n for (i in this.elements) {\n if (this.elements[i] === element) {\n return true;\n }\n }\n return false;\n },\n\n _makeHighlightDiv: function (element, doAnimation) {\n var elementBounds = element.getBoundingClientRect(),\n highlight = window.document.createElement("div"),\n styles = window.getComputedStyle(element);\n \n // Don\'t highlight elements with 0 width & height\n if (elementBounds.width === 0 && elementBounds.height === 0) {\n return;\n }\n \n highlight.className = HIGHLIGHT_CLASSNAME;\n \n var stylesToSet = {\n "left": _screenOffset(element, "offsetLeft") + "px",\n "top": _screenOffset(element, "offsetTop") + "px",\n "width": elementBounds.width + "px",\n "height": elementBounds.height + "px",\n "z-index": 2000000,\n "margin": 0,\n "padding": 0,\n "position": "absolute",\n "pointer-events": "none",\n "border-top-left-radius": styles.borderTopLeftRadius,\n "border-top-right-radius": styles.borderTopRightRadius,\n "border-bottom-left-radius": styles.borderBottomLeftRadius,\n "border-bottom-right-radius": styles.borderBottomRightRadius,\n "border-style": "solid",\n "border-width": "1px",\n "border-color": "#00a2ff",\n "box-shadow": "0 0 1px #fff",\n "box-sizing": "border-box"\n };\n \n var animateStartValues = {\n "background-color": "rgba(0, 162, 255, 0.5)",\n "opacity": 0\n };\n \n var animateEndValues = {\n "background-color": "rgba(0, 162, 255, 0)",\n "opacity": 1\n };\n \n var transitionValues = {\n "-webkit-transition-property": "opacity, background-color",\n "-webkit-transition-duration": "300ms, 2.3s",\n "transition-property": "opacity, background-color",\n "transition-duration": "300ms, 2.3s"\n };\n \n function _setStyleValues(styleValues, obj) {\n var prop;\n \n for (prop in styleValues) {\n obj.setProperty(prop, styleValues[prop]);\n }\n }\n\n _setStyleValues(stylesToSet, highlight.style);\n _setStyleValues(\n doAnimation ? animateStartValues : animateEndValues,\n highlight.style\n );\n \n \n if (doAnimation) {\n _setStyleValues(transitionValues, highlight.style);\n \n window.setTimeout(function () {\n _setStyleValues(animateEndValues, highlight.style);\n }, 0);\n }\n \n window.document.body.appendChild(highlight);\n },\n \n add: function (element, doAnimation) {\n if (this._elementExists(element) || element === document) {\n return;\n }\n if (this.trigger) {\n _trigger(element, "highlight", 1);\n }\n this.elements.push(element);\n \n this._makeHighlightDiv(element, doAnimation);\n },\n\n clear: function () {\n var i, highlights = window.document.querySelectorAll("." + HIGHLIGHT_CLASSNAME),\n body = window.document.body;\n \n for (i = 0; i < highlights.length; i++) {\n body.removeChild(highlights[i]);\n }\n\n if (this.trigger) {\n for (i = 0; i < this.elements.length; i++) {\n _trigger(this.elements[i], "highlight", 0);\n }\n }\n \n this.elements = [];\n },\n \n redraw: function () {\n var i, highlighted;\n \n // When redrawing a selector-based highlight, run a new selector\n // query to ensure we have the latest set of elements to highlight.\n if (this.selector) {\n highlighted = window.document.querySelectorAll(this.selector);\n } else {\n highlighted = this.elements.slice(0);\n }\n \n this.clear();\n for (i = 0; i < highlighted.length; i++) {\n this.add(highlighted[i], false);\n }\n }\n };\n\n var _currentEditor;\n function _toggleEditor(element) {\n _currentEditor = new Editor(element);\n }\n\n var _currentMenu;\n function _toggleMenu(element) {\n if (_currentMenu) {\n _currentMenu.remove();\n }\n _currentMenu = new Menu(element);\n }\n\n var _localHighlight;\n var _remoteHighlight;\n var _setup = false;\n\n\n /** Event Handlers ***********************************************************/\n\n function onMouseOver(event) {\n if (_validEvent(event)) {\n _localHighlight.add(event.target, true);\n }\n }\n\n function onMouseOut(event) {\n if (_validEvent(event)) {\n _localHighlight.clear();\n }\n }\n\n function onMouseMove(event) {\n onMouseOver(event);\n document.removeEventListener("mousemove", onMouseMove);\n }\n\n function onClick(event) {\n if (_validEvent(event)) {\n event.preventDefault();\n event.stopPropagation();\n if (event.altKey) {\n _toggleEditor(event.target);\n } else {\n _toggleMenu(event.target);\n }\n }\n }\n\n function onKeyUp(event) {\n if (_setup && !_validEvent(event)) {\n document.removeEventListener("keyup", onKeyUp);\n document.removeEventListener("mouseover", onMouseOver);\n document.removeEventListener("mouseout", onMouseOut);\n document.removeEventListener("mousemove", onMouseMove);\n document.removeEventListener("click", onClick);\n _localHighlight.clear();\n _localHighlight = undefined;\n _setup = false;\n }\n }\n\n function onKeyDown(event) {\n if (!_setup && _validEvent(event)) {\n document.addEventListener("keyup", onKeyUp);\n document.addEventListener("mouseover", onMouseOver);\n document.addEventListener("mouseout", onMouseOut);\n document.addEventListener("mousemove", onMouseMove);\n document.addEventListener("click", onClick);\n _localHighlight = new Highlight("#ecc", true);\n _setup = true;\n }\n }\n\n /** Public Commands **********************************************************/\n\n // keep alive. Called once a second when a Live Development connection is active.\n // If several seconds have passed without this method being called, we can assume\n // that the connection has been severed and we should remove all our code/hooks.\n function keepAlive() {\n lastKeepAliveTime = Date.now();\n }\n \n // show goto\n function showGoto(targets) {\n if (!_currentMenu) {\n return;\n }\n _currentMenu.createBody();\n var i;\n for (i in targets) {\n _currentMenu.addItem(targets[i]);\n }\n _currentMenu.show();\n }\n\n // remove active highlights\n function hideHighlight() {\n if (_remoteHighlight) {\n _remoteHighlight.clear();\n _remoteHighlight = null;\n }\n }\n\n // highlight a node\n function highlight(node, clear) {\n if (!_remoteHighlight) {\n _remoteHighlight = new Highlight("#cfc");\n }\n if (clear) {\n _remoteHighlight.clear();\n }\n _remoteHighlight.add(node, true);\n }\n\n // highlight a rule\n function highlightRule(rule) {\n hideHighlight();\n var i, nodes = document.querySelectorAll(rule);\n for (i = 0; i < nodes.length; i++) {\n highlight(nodes[i]);\n }\n _remoteHighlight.selector = rule;\n }\n \n // redraw active highlights\n function redrawHighlights() {\n if (_remoteHighlight) {\n _remoteHighlight.redraw();\n }\n }\n \n window.addEventListener("resize", redrawHighlights);\n // Add a capture-phase scroll listener to update highlights when\n // any element scrolls.\n \n function _scrollHandler(e) {\n // Document scrolls can be updated immediately. Any other scrolls\n // need to be updated on a timer to ensure the layout is correct.\n if (e.target === document) {\n redrawHighlights();\n } else {\n if (_remoteHighlight || _localHighlight) {\n window.setTimeout(redrawHighlights, 0);\n }\n }\n }\n \n window.addEventListener("scroll", _scrollHandler, true);\n \n var aliveTest = window.setInterval(function () {\n if (Date.now() > lastKeepAliveTime + KEEP_ALIVE_TIMEOUT) {\n // Remove highlights\n hideHighlight();\n \n // Remove listeners\n window.removeEventListener("resize", redrawHighlights);\n window.removeEventListener("scroll", _scrollHandler, true);\n \n // Clear this interval\n window.clearInterval(aliveTest);\n }\n }, 1000);\n \n /**\n * Constructor\n * @param {Document} htmlDocument\n */\n function DOMEditHandler(htmlDocument) {\n this.htmlDocument = htmlDocument;\n this.rememberedNodes = null;\n this.entityParseParent = htmlDocument.createElement("div");\n }\n\n /**\n * @private\n * Find the first matching element with the specified data-brackets-id\n * @param {string} id\n * @return {Element}\n */\n DOMEditHandler.prototype._queryBracketsID = function (id) {\n if (!id) {\n return null;\n }\n \n if (this.rememberedNodes && this.rememberedNodes[id]) {\n return this.rememberedNodes[id];\n }\n \n var results = this.htmlDocument.querySelectorAll("[data-brackets-id=\'" + id + "\']");\n return results && results[0];\n };\n \n /**\n * @private\n * Insert a new child element\n * @param {Element} targetElement Parent element already in the document\n * @param {Element} childElement New child element\n * @param {Object} edit\n */\n DOMEditHandler.prototype._insertChildNode = function (targetElement, childElement, edit) {\n var before = this._queryBracketsID(edit.beforeID),\n after = this._queryBracketsID(edit.afterID);\n \n if (edit.firstChild) {\n before = targetElement.firstChild;\n } else if (edit.lastChild) {\n after = targetElement.lastChild;\n }\n \n if (before) {\n targetElement.insertBefore(childElement, before);\n } else if (after && (after !== targetElement.lastChild)) {\n targetElement.insertBefore(childElement, after.nextSibling);\n } else {\n targetElement.appendChild(childElement);\n }\n };\n \n /**\n * @private\n * Given a string containing encoded entity references, returns the string with the entities decoded.\n * @param {string} text The text to parse.\n * @return {string} The decoded text.\n */\n DOMEditHandler.prototype._parseEntities = function (text) {\n // Kind of a hack: just set the innerHTML of a div to the text, which will parse the entities, then\n // read the content out.\n var result;\n this.entityParseParent.innerHTML = text;\n result = this.entityParseParent.textContent;\n this.entityParseParent.textContent = "";\n return result;\n };\n \n /**\n * @private\n * @param {Node} node\n * @return {boolean} true if node expects its content to be raw text (not parsed for entities) according to the HTML5 spec.\n */\n function _isRawTextNode(node) {\n return (node.nodeType === Node.ELEMENT_NODE && /script|style|noscript|noframes|noembed|iframe|xmp/i.test(node.tagName));\n }\n \n /**\n * @private\n * Replace a range of text and comment nodes with an optional new text node\n * @param {Element} targetElement\n * @param {Object} edit\n */\n DOMEditHandler.prototype._textReplace = function (targetElement, edit) {\n function prevIgnoringHighlights(node) {\n do {\n node = node.previousSibling;\n } while (node && node.className === HIGHLIGHT_CLASSNAME);\n return node;\n }\n function nextIgnoringHighlights(node) {\n do {\n node = node.nextSibling;\n } while (node && node.className === HIGHLIGHT_CLASSNAME);\n return node;\n }\n function lastChildIgnoringHighlights(node) {\n node = (node.childNodes.length ? node.childNodes.item(node.childNodes.length - 1) : null);\n if (node && node.className === HIGHLIGHT_CLASSNAME) {\n node = prevIgnoringHighlights(node);\n }\n return node;\n }\n \n var start = (edit.afterID) ? this._queryBracketsID(edit.afterID) : null,\n startMissing = edit.afterID && !start,\n end = (edit.beforeID) ? this._queryBracketsID(edit.beforeID) : null,\n endMissing = edit.beforeID && !end,\n moveNext = start && nextIgnoringHighlights(start),\n current = moveNext || (end && prevIgnoringHighlights(end)) || lastChildIgnoringHighlights(targetElement),\n next,\n textNode = (edit.content !== undefined) ? this.htmlDocument.createTextNode(_isRawTextNode(targetElement) ? edit.content : this._parseEntities(edit.content)) : null,\n lastRemovedWasText,\n isText;\n \n // remove all nodes inside the range\n while (current && (current !== end)) {\n isText = current.nodeType === Node.TEXT_NODE;\n\n // if start is defined, delete following text nodes\n // if start is not defined, delete preceding text nodes\n next = (moveNext) ? nextIgnoringHighlights(current) : prevIgnoringHighlights(current);\n\n // only delete up to the nearest element.\n // if the start/end tag was deleted in a prior edit, stop removing\n // nodes when we hit adjacent text nodes\n if ((current.nodeType === Node.ELEMENT_NODE) ||\n ((startMissing || endMissing) && (isText && lastRemovedWasText))) {\n break;\n } else {\n lastRemovedWasText = isText;\n\n current.remove();\n current = next;\n }\n }\n \n if (textNode) {\n // OK to use nextSibling here (not nextIgnoringHighlights) because we do literally\n // want to insert immediately after the start tag.\n if (start && start.nextSibling) {\n targetElement.insertBefore(textNode, start.nextSibling);\n } else if (end) {\n targetElement.insertBefore(textNode, end);\n } else {\n targetElement.appendChild(textNode);\n }\n }\n };\n \n /**\n * @private\n * Apply an array of DOM edits to the document\n * @param {Array.<Object>} edits\n */\n DOMEditHandler.prototype.apply = function (edits) {\n var targetID,\n targetElement,\n childElement,\n self = this;\n \n this.rememberedNodes = {};\n \n edits.forEach(function (edit) {\n var editIsSpecialTag = edit.type === "elementInsert" && (edit.tag === "html" || edit.tag === "head" || edit.tag === "body");\n \n if (edit.type === "rememberNodes") {\n edit.tagIDs.forEach(function (tagID) {\n var node = self._queryBracketsID(tagID);\n self.rememberedNodes[tagID] = node;\n node.remove();\n });\n return;\n }\n \n targetID = edit.type.match(/textReplace|textDelete|textInsert|elementInsert|elementMove/) ? edit.parentID : edit.tagID;\n targetElement = self._queryBracketsID(targetID);\n \n if (!targetElement && !editIsSpecialTag) {\n console.error("data-brackets-id=" + targetID + " not found");\n return;\n }\n \n switch (edit.type) {\n case "attrChange":\n case "attrAdd":\n targetElement.setAttribute(edit.attribute, self._parseEntities(edit.value));\n break;\n case "attrDelete":\n targetElement.removeAttribute(edit.attribute);\n break;\n case "elementDelete":\n targetElement.remove();\n break;\n case "elementInsert":\n childElement = null;\n if (editIsSpecialTag) {\n // If we already have one of these elements (which we should), then\n // just copy the attributes and set the ID.\n childElement = self.htmlDocument[edit.tag === "html" ? "documentElement" : edit.tag];\n if (!childElement) {\n // Treat this as a normal insertion.\n editIsSpecialTag = false;\n }\n }\n if (!editIsSpecialTag) {\n childElement = self.htmlDocument.createElement(edit.tag);\n }\n \n Object.keys(edit.attributes).forEach(function (attr) {\n childElement.setAttribute(attr, self._parseEntities(edit.attributes[attr]));\n });\n childElement.setAttribute("data-brackets-id", edit.tagID);\n \n if (!editIsSpecialTag) {\n self._insertChildNode(targetElement, childElement, edit);\n }\n break;\n case "elementMove":\n childElement = self._queryBracketsID(edit.tagID);\n self._insertChildNode(targetElement, childElement, edit);\n break;\n case "textInsert":\n var textElement = self.htmlDocument.createTextNode(_isRawTextNode(targetElement) ? edit.content : self._parseEntities(edit.content));\n self._insertChildNode(targetElement, textElement, edit);\n break;\n case "textReplace":\n case "textDelete":\n self._textReplace(targetElement, edit);\n break;\n }\n });\n \n this.rememberedNodes = {};\n \n // update highlight after applying diffs\n redrawHighlights();\n };\n \n function applyDOMEdits(edits) {\n _editHandler.apply(edits);\n }\n \n /**\n *\n * @param {Element} elem\n */\n function _domElementToJSON(elem) {\n var json = { tag: elem.tagName.toLowerCase(), attributes: {}, children: [] },\n i,\n len,\n node,\n value;\n \n len = elem.attributes.length;\n for (i = 0; i < len; i++) {\n node = elem.attributes.item(i);\n value = (node.name === "data-brackets-id") ? parseInt(node.value, 10) : node.value;\n json.attributes[node.name] = value;\n }\n \n len = elem.childNodes.length;\n for (i = 0; i < len; i++) {\n node = elem.childNodes.item(i);\n \n // ignores comment nodes and visuals generated by live preview\n if (node.nodeType === Node.ELEMENT_NODE && node.className !== HIGHLIGHT_CLASSNAME) {\n json.children.push(_domElementToJSON(node));\n } else if (node.nodeType === Node.TEXT_NODE) {\n json.children.push({ content: node.nodeValue });\n }\n }\n \n return json;\n }\n \n function getSimpleDOM() {\n return JSON.stringify(_domElementToJSON(document.documentElement));\n }\n\n // init\n _editHandler = new DOMEditHandler(window.document);\n \n if (experimental) {\n window.document.addEventListener("keydown", onKeyDown);\n }\n\n return {\n "DOMEditHandler" : DOMEditHandler,\n "keepAlive" : keepAlive,\n "showGoto" : showGoto,\n "hideHighlight" : hideHighlight,\n "highlight" : highlight,\n "highlightRule" : highlightRule,\n "redrawHighlights" : redrawHighlights,\n "applyDOMEdits" : applyDOMEdits,\n "getSimpleDOM" : getSimpleDOM\n };\n}\n'
31}),define("LiveDevelopment/Agents/RemoteAgent",["require","exports","module","LiveDevelopment/LiveDevelopment","LiveDevelopment/Inspector/Inspector","text!LiveDevelopment/Agents/RemoteFunctions.js"],function(e,t){function n(e,t){var n=/^data-ld-(.*)/.exec(t.name);n&&f.triggerHandler(n[1],t)}function r(e,t){console.assert(e,"Attempted to call remote method without objectId set.");var n,r=Array.prototype.slice.call(arguments,2),i=new $.Deferred;return"function"==typeof r[r.length-1]&&(n=r.pop()),r=r.map(function(e){return e&&e.nodeId?e.resolve():e}),$.when.apply(void 0,r).done(function(){var o=[];r.forEach(function(e){o.push(e.objectId?{objectId:e.objectId}:{value:e})}),m.Runtime.callFunctionOn(e,t,o,void 0,n).then(i.resolve,i.reject)}),i.promise()}function i(e){var t=[d,"_LD."+e];return arguments.length>1&&(t=t.concat(Array.prototype.slice.call(arguments,1))),r.apply(null,t)}function o(){p&&(window.clearInterval(p),p=null)}function a(){o(),p=window.setInterval(function(){i("keepAlive")},1e3)}function s(e,t){if(!t.frame.parentId){o();var n="window._LD="+g+"("+h.config.experimental+");";m.Runtime.evaluate(n,function(e){e.error||e.wasThrown?u.reject(e.error):(d=e.result.objectId,u.resolve(),a())})}}function l(){return u=new $.Deferred,$(m.Page).on("frameNavigated.RemoteAgent",s),$(m.Page).on("frameStartedLoading.RemoteAgent",o),$(m.DOM).on("attributeModified.RemoteAgent",n),u.promise()}function c(){$(m.Page).off(".RemoteAgent"),$(m.DOM).off(".RemoteAgent"),o()}var u,d,p,f=$(t),h=e("LiveDevelopment/LiveDevelopment"),m=e("LiveDevelopment/Inspector/Inspector"),g=e("text!LiveDevelopment/Agents/RemoteFunctions.js");t.call=i,t.load=l,t.unload=c}),define("LiveDevelopment/Agents/ScriptAgent",["require","exports","module","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Agents/DOMAgent"],function(e,t){function n(e){return m[e]}function r(e){return h[e]}function i(e,t){v.DOMDebugger.setDOMBreakpoint(t.root.nodeId,"subtree-modified"),f.resolve()}function o(e,t){if(g){var n=y.nodeWithId(t.node.nodeId);n.trace=g,g=void 0}}function a(e,t){m[t.scriptId]=t,h[t.url]=t}function s(){}function l(e,t){switch(t.reason){case"exception":v.Debugger.resume();break;case"DOM":v.Debugger.resume(),"subtree-modified"===t.data.type&&t.data.insertion===!0&&(g=t.callFrames)}}function c(){h={},m={}}function u(e,t){t.frame.parentId||c()}function d(){c(),f=new $.Deferred;var e=new $.Deferred;return v.Debugger.enable().done(function(){v.Debugger.setPauseOnExceptions("uncaught").done(function(){e.resolve()})}),$(v.Page).on("frameNavigated.ScriptAgent",u),$(y).on("getDocument.ScriptAgent",i),$(v.Debugger).on("scriptParsed.ScriptAgent",a).on("scriptFailedToParse.ScriptAgent",s).on("paused.ScriptAgent",l),$(v.DOM).on("childNodeInserted.ScriptAgent",o),$.when(f.promise(),e.promise())}function p(){c(),$(v.Page).off(".ScriptAgent"),$(y).off(".ScriptAgent"),$(v.Debugger).off(".ScriptAgent"),$(v.DOM).off(".ScriptAgent")}var f,h,m,g,v=e("LiveDevelopment/Inspector/Inspector"),y=e("LiveDevelopment/Agents/DOMAgent");t.scriptWithId=n,t.scriptForURL=r,t.load=d,t.unload=p}),define("LiveDevelopment/Agents/GotoAgent",["require","exports","module","utils/Global","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Agents/DOMAgent","LiveDevelopment/Agents/ScriptAgent","LiveDevelopment/Agents/RemoteAgent","document/DocumentManager","editor/EditorManager","view/MainViewManager"],function(e,t){function n(e){var t=e.search(/[#\?]/);return t>=0&&(e=e.substr(0,t)),e}function r(e){var t=e.split("/");return t[t.length-1]}function i(e,t){if(t.location){var n=h.url,i=t.location;t.canHaveChildren()&&(i+=t.length),n+=":"+i;var o="&lt;"+t.name+"&gt;",a=r(n);e.push({type:"html",url:n,name:o,file:a})}}function o(e,t){if(t.sourceURL){var n=t.sourceURL;n+=":"+t.style.range.start;var i=t.selectorList.text,o=r(n);e.push({type:"css",url:n,name:i,file:o})}}function a(e,t){var n=m.scriptWithId(t.location.scriptId);if(n&&n.url){var i=n.url;i+=":"+t.location.lineNumber+","+t.location.columnNumber;var o=t.functionName;""===o&&(o="anonymous function");var a=r(i);e.push({type:"js",url:i,name:o,file:a})}}function s(e,t){var n=h.nodeWithId(t.nodeId);f.CSS.getMatchedStylesForNode(n.nodeId,function(e){var t,r=[];i(r,n);for(t in n.trace)a(r,n.trace[t]);for(t in n.events){var s=n.events[t];a(r,s.callFrames[0])}for(t in e.matchedCSSRules.reverse())o(r,e.matchedCSSRules[t].rule);g.call("showGoto",r)})}function l(e,t){var n=y.getCurrentFullEditor(),r=n._codeMirror;"number"==typeof e&&(e=r.posFromIndex(e)),r.setCursor(e),n.focus(),t||(r.addLineClass(e.line,"wrap","flash"),window.setTimeout(function(){r.removeLineClass(e.line,"wrap","flash")},1e3))}function c(e,t,r){console.assert("file://"===e.substr(0,7),"Cannot open non-file URLs");var i=new $.Deferred;e=n(e);var o=e.slice("win"===brackets.platform?8:7);o=decodeURI(o);var a=v.getDocumentForPath(o);return a.done(function(e){_._edit(_.ACTIVE_PANE,e),t&&l(t,r),i.resolve()}),a.fail(function(e){console.error(e),i.reject(e)}),i.promise()}function u(e,t){var n,r=t.value,i=/^(.*):([^:]+)$/.exec(r);i&&(r=i[1],n=i[2].split(","),n=1===n.length?parseInt(n[0],10):{line:parseInt(n[0],10),ch:parseInt(n[1],10)}),c(r,n)}function d(){$(g).on("showgoto.GotoAgent",s).on("goto.GotoAgent",u)}function p(){$(g).off(".GotoAgent")}e("utils/Global");var f=e("LiveDevelopment/Inspector/Inspector"),h=e("LiveDevelopment/Agents/DOMAgent"),m=e("LiveDevelopment/Agents/ScriptAgent"),g=e("LiveDevelopment/Agents/RemoteAgent"),v=e("document/DocumentManager"),y=e("editor/EditorManager"),_=e("view/MainViewManager");t.openLocation=l,t.open=c,t.load=d,t.unload=p}),define("LiveDevelopment/Agents/EditAgent",["require","exports","module","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Agents/DOMAgent","LiveDevelopment/Agents/RemoteAgent","LiveDevelopment/Agents/GotoAgent","editor/EditorManager"],function(e,t){function n(e,t){if(e===t)return void 0;var n,r=e.length,i=0;for(n=0;r>n&&t[n]===e[n];n++);for(i+=n,t=t.substr(n),r-=n,n=0;r>n&&t[t.length-1-n]===e[e.length-1-n];n++);return r-=n,t=t.substr(0,t.length-n),{from:i,to:i+r,text:t}}function r(e,r){if(s.nodeId===r.nodeId){d.open(c.url);var i=p.getCurrentFullEditor(),o=i._codeMirror,a=n(s.value,r.characterData);if(a){var l=o.posFromIndex(s.location+a.from),u=o.posFromIndex(s.location+a.to);t.isEditing=!0,i.document.replaceRange(a.text,l,u),t.isEditing=!1;var f=o.posFromIndex(s.location+a.from+a.text.length);i.setCursorPos(f.line,f.ch)}}}function i(e,t){if("0"===t.value)return void $(l.DOM).off(".EditAgent");var n=c.nodeWithId(t.nodeId);n=n.children[0],n.location&&(s=n,$(l.DOM).on("characterDataModified.EditAgent",r))}function o(){$(u).on("edit.EditAgent",i)}function a(){$(u).off(".EditAgent")}var s,l=e("LiveDevelopment/Inspector/Inspector"),c=e("LiveDevelopment/Agents/DOMAgent"),u=e("LiveDevelopment/Agents/RemoteAgent"),d=e("LiveDevelopment/Agents/GotoAgent"),p=e("editor/EditorManager");t.load=o,t.unload=a}),define("LiveDevelopment/Agents/DOMHelpers",["require","exports","module"],function(e,t){function n(e,t,n){return"\\"===t?!1:void 0!==n?e===n:'"'===e||"'"===e}function r(e){if(n(e[0])&&e[e.length-1]===e[0]){var t=e[0];e=e.substr(1,e.length-2),e=e.replace("\\"+t,t)}return e}function i(e,t,r,i,o){"string"==typeof t&&(t=[t,t.length]),void 0===r&&(r=0);var a,s,l=!1;for(a=r;a<e.length;a++)if(i&&n(e[a],e[a-1],s))s=s?void 0:e[a];else if(!s)if(o&&!l&&e.substr(a,o[0].length)===o[0])l=!0,a+=o[0].length-1;else if(l)e.substr(a,o[1].length)===o[1]&&(l=!1,a+=o[1].length-1);else if(0===e.substr(a,t[1]).search(t[0]))return a;return-1}function o(e,t,n,r,o){for(var a,s=0;s<e.length;)a=i(e,t,s,n,r),0>a&&(a=e.length),o(e.substr(s,a-s)),s=a+1}function a(e,t){var n,r,o;return n=i(e,[/<[a-z!\/]/i,2],t),0>n?null:("<!--"===e.substr(n,4)?(r=i(e,"-->",n+4),o=3):"<script"===e.substr(n,7).toLowerCase()?(r=i(e.toLowerCase(),"</script>",n+7),o=9):"<style"===e.substr(n,6).toLowerCase()?(r=i(e.toLowerCase(),"</style>",n+6),o=8):(r=i(e,">",n+1,!0),o=1),0>r?null:{from:n,length:r+o-n})}function s(e){if(e=e.replace(/^<\S+\s*/,""),e=e.replace(/\s*\/?>$/,""),0!==e.length){var t,n,i,a={};return o(e,[/\s/,1],!0,void 0,function(e){t=e.search("="),0>t||(n=e.substr(0,t).trim(),0!==n.length&&(i=e.substr(t+1).trim(),i=r(i),a[n]=i))}),a}}function l(e){var t={};return"<"!==e[0]?(t.nodeType=3,t.nodeValue=e):"<!--"===e.substr(0,4)?(t.nodeType=8,t.nodeValue=e.substr(4,e.length-7)):"!"===e[1]?t.nodeType=10:(t.nodeType=1,t.nodeName=/^<([^>\s]+)/.exec(e)[1].toUpperCase(),t.attributes=s(e),"/"===t.nodeName[0]&&(t.nodeName=t.nodeName.substr(1),t.closing=!0),"/"===e[e.length-2]&&(t.closed=!0),("SCRIPT"===t.nodeName||"STYLE"===t.nodeName)&&(t.closed=!0)),t}function c(e,t){for(var n,r,i,o,s=0;s<e.length;)r=a(e,s),r||(r={from:e.length,length:0}),i=r.from-s,i>0&&(n=e.substr(s,i),/\S/.test(n)&&(o=l(n),o.sourceOffset=s,o.sourceLength=i,t(o))),r.length>0&&(o=l(e.substr(r.from,r.length)),o.sourceOffset=r.from,o.sourceLength=r.length,t(o)),s=r.from+r.length}t.extractPayload=l,t.eachNode=c}),define("LiveDevelopment/Agents/DOMNode",["require","exports","module","LiveDevelopment/Agents/DOMHelpers"],function(e){function t(e,t,n){for(void 0===n&&(n=" ");e.length<t;)e+=n;return e}function n(e){switch(typeof e){case"function":return e;case"string":return function(e,t){return t.name===e}.bind(void 0,e.toUpperCase());case"number":return function(e,t){return t.type===e}.bind(void 0,e);default:console.error("Invalid find condition: "+e)}}var r=e("LiveDevelopment/Agents/DOMHelpers"),i=function(e,t){this.agent=e,this.children=[],this.attributes={},"string"==typeof t&&(t=r.extractPayload(t)),t&&this.setPayload(t),this.agent.addNode(this)},o=i.TYPE_ELEMENT=1,a=i.TYPE_ATTRIBUTE=2,s=i.TYPE_TEXT=3,l=i.TYPE_COMMENT=8,c=i.TYPE_DOCUMENT=9;return i.prototype.remove=function(){this.agent.removeNode(this),this.parent&&this.parent.removeChild(this)},i.prototype.setPayload=function(e){if(this.nodeId=e.nodeId,this.type=e.nodeType,e.nodeName&&(this.name=e.nodeName),e.nodeValue&&(this.value=e.nodeValue),this.attributes={},e.attributes){var t,n,r;for(t=0;t<e.attributes.length;t+=2)n=e.attributes[t],r=e.attributes[t+1],this.attributes[n]=r}e.sourceOffset&&(this.location=e.sourceOffset),e.sourceLength?this.length=e.sourceLength:this.value?this.length=this.value.length:this.name&&(this.length=this.name.length+2),e.children?this.setChildrenPayload(e.children):e.childNodeCount&&this.agent.requestChildNodes(this)},i.prototype.setChildrenPayload=function(e){var t,n,r;for(t in e)n=e[t],r=new i(this.agent,n),this.appendChild(r)},i.prototype.payload=function(){var e={type:this.type};return this.nodeType===o?e.nodeName=this.name:e.value=this.value,e},i.prototype.findParentForNextNodeMatchingPayload=function(e){for(var t=this.canHaveChildren()?this:this.parent;t&&!t.matchesPayload(e);)t=t.parent;return t},i.prototype.findNextNodeMatchingPayload=function(e){for(var t=this.nextNode();t&&!t.matchesPayload(e);)t=t.nextNode();return t},i.prototype.matchesPayload=function(e){var t=!1;if(this.type===e.nodeType)switch(this.type){case 1:t=this.name===e.nodeName;break;case 3:t=!0;break;default:t=!0}return t},i.prototype.resolve=function(){var e=new $.Deferred;return this.objectId?e.resolve(this):this.nodeId?this.agent.resolveNode(this,function(t){this.objectId=t.object.objectId,e.resolve(this)}.bind(this)):e.reject(),e.promise()},i.prototype.canHaveChildren=function(){return 1===this.type&&!this.closed&&!this.closing&&"LINK"!==this.nodeName},i.prototype.removeChild=function(e){this.children.splice(this.indexOfChild(e),1),delete e.parent},i.prototype.insertChildAt=function(e,t){return e.parent&&e.parent.removeChild(e),(!t||0>t||t>this.children.length)&&(t=this.children.length),this.children.splice(t,0,e),e.parent=this,e},i.prototype.appendChild=function(e){return this.insertChildAt(e)},i.prototype.insertChildAfter=function(e,t){var n=this.indexOfChild(t);return n>=0&&n++,this.insertChildAt(e,n)},i.prototype.insertChildBefore=function(e,t){var n=this.indexOfChild(t);return this.insertChildAt(e,n)},i.prototype.indexOfChild=function(e){if(!e)return-1;var t;for(t in this.children)if(this.children[t]===e)return parseInt(t,0);return-1},i.prototype.previousSibling=function(){return this.parent?this.parent.children[this.parent.indexOfChild(this)-1]:null},i.prototype.nextSibling=function(){return this.parent?this.parent.children[this.parent.indexOfChild(this)+1]:null},i.prototype.previousNode=function(){var e=this.previousSibling();return e?e.children.length>0&&(e=e.children[e.children.length-1]):e=this.parent,e},i.prototype.nextNode=function(){if(this.children.length>0)return this.children[0];for(var e,t=this;t;){if(e=t.nextSibling())return e;t=t.parent}return null},i.prototype.each=function(e){if(e(this)===!1)return!1;var t;for(t in this.children)if(this.children[t].each(e)===!1)return!1;return!0},i.prototype.find=function(e){var t=n(e),r=null;return this.each(function(e){return t(e)?(r=e,!1):void 0}),r},i.prototype.findAll=function(e){var t=[],r=n(e);return this.each(function(e){r(e)&&t.push(e)}),t},i.prototype.eachParent=function(e){for(var t=this.parent;t;){if(e(t)===!1)return;t=t.parent}return null},i.prototype.findParent=function(e){var t=null;return this.eachParent(function(n){return e(n)?(t=n,!1):void 0}),t},i.prototype.root=function(){for(var e=this;e.parent;)e=e.parent;return e},i.prototype.isAtLocation=function(e,t){if(void 0===t&&(t=!0),!this.location||e<this.location)return!1;var n;return n=t&&this.closeLocation?this.closeLocation+this.closeLength:this.location+this.length,this.type===s&&(n+=1),n>e},i.prototype.isEmpty=function(){return this.type===s&&/^\s*$/.test(this.value)},i.prototype.toString=function(){var e;switch(this.type){case o:e="<"+this.name+">";break;case a:e="[ATTRIBUTE]";break;case s:e=this.value.replace(/\s+/," ").substr(0,40);break;case l:e="<!--"+this.value.replace(/\s+/," ").substr(0,33)+"-->";break;case c:e="<!DOCTYPE>"}return e},i.prototype.dump=function(e){void 0===e&&(e="");var n=e+this.toString();this.location&&(n=t(n,60),n+=" ("+this.location+","+(this.location+this.length)+")",this.closeLocation&&(n+=" ("+this.closeLocation+","+(this.closeLocation+this.closeLength)+")")),this.nodeId&&(n=t(n,80),n+=" {"+this.nodeId+"}"),console.info(n),e+=". ";var r;for(r in this.children)this.children[r].dump(e)},i}),define("LiveDevelopment/Agents/DOMAgent",["require","exports","module","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Agents/EditAgent","LiveDevelopment/Agents/DOMNode","LiveDevelopment/Agents/DOMHelpers"],function(e,t){function n(e){var n;return t.root.each(function(t){return!t.location||e<t.location?!0:void((!n||n.location<t.location)&&(n=t))}),n}function r(e){var n=[];return t.root.each(function(t){t.type===T.TYPE_ELEMENT&&t.isAtLocation(e)&&n.push(t)}),n}function i(e){return t.root.find(function(t){return t.isAtLocation(e,!1)})}function o(e){return S[e]}function a(e){e.nodeId&&delete S[e.nodeId]}function s(e){e.nodeId&&(S[e.nodeId]=e)}function l(e){C>=0&&C++,k.DOM.requestChildNodes(e.nodeId)}function c(e){var t=e.search(/[#\?]/);return t>=0&&(e=e.substr(0,t)),e}function u(e){var n=t.root;D.eachNode(e,function(e){if(!n)return!0;if(e.closing){var t=n.findParentForNextNodeMatchingPayload(e);if(!t)return console.warn("Matching Parent not at "+e.sourceOffset+" ("+e.nodeName+")");t.closeLocation=e.sourceOffset,t.closeLength=e.sourceLength}else{var r=n.findNextNodeMatchingPayload(e);if(!r)return console.warn("Skipping Source Node at "+e.sourceOffset);n=r,n.location=e.sourceOffset,n.length=e.sourceLength,e.closed&&(n.closed=e.closed)}})}function d(){var e=new XMLHttpRequest;e.open("GET",t.url),e.onload=function(){if(e.status>=200&&e.status<300||304===e.status||0===e.status)u(e.response),w.resolve();else{var n="Received status "+e.status+" from XMLHttpRequest while attempting to load source file at "+t.url;w.reject(n,{message:n})}},e.onerror=function(){var e="Could not load source file at "+t.url;w.reject(e,{message:e})},e.send(null)}function p(){k.DOM.getDocument(function(e){I.triggerHandler("getDocument",e),S={},C=0,t.root=new T(t,e.root)})}function f(e,n){n.frame.parentId||(t.url=c(n.frame.url))}function h(){}function m(e,t){var n=o(t.parentId);n.setChildrenPayload(t.nodes),C>0&&0===--C&&d()}function g(e,t){t.nodeId>0&&k.DOM.requestChildNodes(t.nodeId)}function v(e,n){if(n.node.nodeId>0){var r=o(n.parentNodeId),i=o(n.previousNodeId),a=new T(t,n.node);r.insertChildAfter(a,i)}}function y(e,t){if(t.nodeId>0){var n=o(t.nodeId);n.remove()}}function _(e,r,o){var a=e-r+o.length,s=i(e);if(s)if(3===s.type){var l=s.value.substr(0,e-s.location);l+=o,l+=s.value.substr(r-s.location),s.value=l,x.isEditing||k.DOM.setNodeValue(s.nodeId,s.value)}else console.warn("Changing non-text nodes not supported.");else/^\s*$/.test(o)||(console.warn("Inserting nodes not supported."),s=n(e));s&&(s.length+=a,t.root.each(function(e){e.location>s.location&&(e.location+=a),void 0!==e.closeLocation&&e.closeLocation>s.location&&(e.closeLocation+=a)}))}function b(){return w=new $.Deferred,$(k.Page).on("frameNavigated.DOMAgent",f).on("loadEventFired.DOMAgent",p),$(k.DOM).on("documentUpdated.DOMAgent",h).on("setChildNodes.DOMAgent",m).on("childNodeCountUpdated.DOMAgent",g).on("childNodeInserted.DOMAgent",v).on("childNodeRemoved.DOMAgent",y),w.promise()}function E(){$(k.Page).off(".DOMAgent"),$(k.DOM).off(".DOMAgent")}var w,S,C,I=$(t),k=e("LiveDevelopment/Inspector/Inspector"),x=e("LiveDevelopment/Agents/EditAgent"),T=e("LiveDevelopment/Agents/DOMNode"),D=e("LiveDevelopment/Agents/DOMHelpers");t.nodeBeforeLocation=n,t.allNodesAtLocation=r,t.nodeAtLocation=i,t.nodeWithId=o,t.removeNode=a,t.addNode=s,t.requestChildNodes=l,t.applyChange=_,t.load=b,t.unload=E}),define("LiveDevelopment/Agents/HighlightAgent",["require","exports","module","LiveDevelopment/Agents/DOMAgent","LiveDevelopment/Inspector/Inspector","LiveDevelopment/LiveDevelopment","LiveDevelopment/Agents/RemoteAgent","thirdparty/lodash"],function(e,t){function n(e,n){var r;"1"===n.value&&(r=u.nodeWithId(n.nodeId)),$(t).triggerHandler("highlight",[r])}function r(){switch(m.type){case"node":d.DOM.hideHighlight();break;case"css":f.call("hideHighlight")}m={}}function i(e){return p.config.experimental&&d.config.highlight?(e&&3===e.type&&(e=e.parent),e&&e.nodeId&&1===e.type?void(("node"!==m.type||m.ref!==e.nodeId)&&(m={type:"node",ref:e.nodeId},d.DOM.highlightNode(e.nodeId,d.config.highlightConfig))):r()):void 0}function o(e){m.ref!==e&&(r(),m={type:"css",ref:e},f.call("highlightRule",e))}function a(e){var t="";Array.isArray(e)||(e=[e]),h.each(e,function(e){""!==t&&(t+=","),t+="[data-brackets-id='"+e+"']"}),o(t)}function s(){f.call("redrawHighlights")}function l(){p.config.experimental&&$(f).on("highlight.HighlightAgent",n)}function c(){p.config.experimental&&$(f).off(".HighlightAgent")}var u=e("LiveDevelopment/Agents/DOMAgent"),d=e("LiveDevelopment/Inspector/Inspector"),p=e("LiveDevelopment/LiveDevelopment"),f=e("LiveDevelopment/Agents/RemoteAgent"),h=e("thirdparty/lodash"),m={};t.hide=r,t.node=i,t.rule=o,t.domElement=a,t.redraw=s,t.load=l,t.unload=c}),define("LiveDevelopment/Documents/CSSDocument",["require","exports","module","thirdparty/lodash","LiveDevelopment/Agents/CSSAgent","language/CSSUtils","editor/EditorManager","LiveDevelopment/Agents/HighlightAgent","LiveDevelopment/Inspector/Inspector"],function(e,t,n){var r=e("thirdparty/lodash"),i=e("LiveDevelopment/Agents/CSSAgent"),o=e("language/CSSUtils"),a=e("editor/EditorManager"),s=e("LiveDevelopment/Agents/HighlightAgent"),l=e("LiveDevelopment/Inspector/Inspector"),c=function(e,t){this.doc=e,this._highlight=[],this.onHighlight=this.onHighlight.bind(this),this.onCursorActivity=this.onCursorActivity.bind(this),this.doc.addRef(),this.onChange=this.onChange.bind(this),this.onDeleted=this.onDeleted.bind(this),$(this.doc).on("change.CSSDocument",this.onChange),$(this.doc).on("deleted.CSSDocument",this.onDeleted),this.onActiveEditorChange=this.onActiveEditorChange.bind(this),$(a).on("activeEditorChange",this.onActiveEditorChange),t&&this.attachToEditor(t)};c.prototype._getStyleSheetHeader=function(){return i.styleForURL(this.doc.url)},c.prototype.getStyleSheetFromBrowser=function(){return(new $.Deferred).reject().promise()},c.prototype.getSourceFromBrowser=function(){function e(e){var t;for(t in e)if(r.has(e,t))return e[t];return null}var t=new $.Deferred,n=this._getStyleSheetHeader(),i=e(n);return i?l.CSS.getStyleSheetText(i.styleSheetId).then(function(e){t.resolve(e.text)},t.reject):t.reject(),t.promise()},c.prototype.close=function(){$(this.doc).off(".CSSDocument"),$(a).off("activeEditorChange",this.onActiveEditorChange),this.doc.releaseRef(),this.detachFromEditor()},c.prototype._updateBrowser=function(){var e=i.reloadCSSForDocument(this.doc);l.config.highlight&&e.done(s.redraw)},c.prototype.attachToEditor=function(e){this.editor=e,this.editor&&($(s).on("highlight",this.onHighlight),$(this.editor).on("cursorActivity.CSSDocument",this.onCursorActivity),this.updateHighlight())},c.prototype.detachFromEditor=function(){this.editor&&(s.hide(),$(s).off("highlight",this.onHighlight),$(this.editor).off(".CSSDocument"),this.onHighlight(),this.editor=null)},c.prototype.updateHighlight=function(){if(l.config.highlight&&this.editor){var e=this.editor,t=[];r.each(this.editor.getSelections(),function(n){var r=o.findSelectorAtDocumentPos(e,n.reversed?n.end:n.start);r&&t.push(r)}),t.length?s.rule(t.join(",")):s.hide()}},c.prototype.setInstrumentationEnabled=function(){},c.prototype.isLiveEditingEnabled=function(){return!0},c.prototype.getResponseData=function(){return{body:this.doc.getText()}},c.prototype.onCursorActivity=function(){this.updateHighlight()},c.prototype.onChange=function(){this._updateBrowser()},c.prototype.onDeleted=function(){i.clearCSSForDocument(this.doc),this.close(),$(this).triggerHandler("deleted",[this])},c.prototype.onActiveEditorChange=function(e,t){this.detachFromEditor(),t&&t.document===this.doc&&this.attachToEditor(t)},c.prototype.onHighlight=function(e,t){var n;for(n in this._highlight)this._highlight[n].clear();this._highlight=[],t&&t.location&&l.CSS.getMatchedStylesForNode(t.nodeId,function(e){var t,n,r,i,o=this.editor._codeMirror,a=this._getStyleSheetHeader();for(t in e.matchedCSSRules)n=e.matchedCSSRules[t],n.ruleId&&a[n.ruleId.styleSheetId]&&(r=o.posFromIndex(n.selectorRange.start),i=o.posFromIndex(n.style.range.end),this._highlight.push(o.markText(r,i,{className:"highlight"})))}.bind(this))},n.exports=c}),define("LiveDevelopment/Documents/CSSPreprocessorDocument",["require","exports","module","thirdparty/lodash","language/CSSUtils","editor/EditorManager","LiveDevelopment/Agents/HighlightAgent","LiveDevelopment/Inspector/Inspector"],function(e,t,n){var r=e("thirdparty/lodash"),i=e("language/CSSUtils"),o=e("editor/EditorManager"),a=e("LiveDevelopment/Agents/HighlightAgent"),s=e("LiveDevelopment/Inspector/Inspector"),l=function(e){this.doc=e,this.onCursorActivity=this.onCursorActivity.bind(this),this.doc.addRef(),this.onActiveEditorChange=this.onActiveEditorChange.bind(this),$(o).on("activeEditorChange",this.onActiveEditorChange),this.onActiveEditorChange(null,o.getActiveEditor(),null)};l.prototype.close=function(){$(this.doc).off(".CSSPreprocessorDocument"),$(o).off("activeEditorChange",this.onActiveEditorChange),this.doc.releaseRef(),this.detachFromEditor()},l.prototype.isLiveEditingEnabled=function(){return!1},l.prototype.attachToEditor=function(e){this.editor=e,this.editor&&($(this.editor).on("cursorActivity.CSSPreprocessorDocument",this.onCursorActivity),this.updateHighlight())},l.prototype.detachFromEditor=function(){this.editor&&(a.hide(),$(this.editor).off(".CSSPreprocessorDocument"),this.editor=null)},l.prototype.updateHighlight=function(){if(s.config.highlight&&this.editor){var e=this.editor,t=[];r.each(this.editor.getSelections(),function(n){var r=i.findSelectorAtDocumentPos(e,n.reversed?n.end:n.start);r&&t.push(r)}),t.length?a.rule(t.join(",")):a.hide()}},l.prototype.onCursorActivity=function(){this.updateHighlight()},l.prototype.onActiveEditorChange=function(e,t){this.detachFromEditor(),t&&t.document===this.doc&&this.attachToEditor(t)},n.exports=l}),define("language/HTMLTokenizer",["require","exports","module"],function(e,t){function n(e){return" "===e||" "===e||"\r"===e||"\n"===e}function r(e){return/[A-Za-z0-9\-]/.test(e)}function i(e){return'"'!==e&&"'"!==e&&"<"!==e&&"="!==e}function o(e){return"<"!==e&&"="!==e}function a(e,t){return e?{line:e.line,ch:e.ch+(t||0)}:null}function s(e){this._state=c,this._buffer=e,this._sectionStart=0,this._sectionStartPos={line:0,ch:0},this._index=0,this._indexPos={line:0,ch:0},this._special=0,this._token=null,this._nextToken=null}var l=0,c=l++,u=l++,d=l++,p=l++,f=l++,h=l++,m=l++,g=l++,v=l++,y=l++,_=l++,b=l++,E=l++,w=l++,S=l++,C=l++,I=l++,k=l++,x=l++,T=l++,D=l++,M=l++,O=l++,L=l++,R=l++,A=l++,N=l++,P=l++,F=l++,$=l++,U=l++,j=l++,V=l++,B=l++,W=l++,H=l++,q=l++,z=l++,G=l++,K=l++,X=l++,Y=l++,Q=l++,J=l++,Z=l++,et=l++,tt=l++,nt=l++,rt=l++,it=l++,ot=l++;s.prototype.nextToken=function(){if(this._token=null,this._nextToken){var e=this._nextToken;return this._nextToken=null,e}for(;this._index<this._buffer.length&&!this._token;){var t=this._buffer.charAt(this._index);if(this._state===c)"<"===t&&(this._emitTokenIfNonempty("text"),this._state=u,this._startSection());else if(this._state===u)if("/"===t)this._state=p;else if(">"===t||this._special>0)this._state=c;else if("!"===t)this._state=C,this._startSection(1);else if("?"===t)this._state=k,this._startSection(1);else if("s"===t||"S"===t)this._state=j,this._startSection();else{if(!r(t)){this._emitSpecialToken("error");break}n(t)||(this._state=d,this._startSection())}else if(this._state===d){if("/"===t)this._emitToken("opentagname"),this._emitSpecialToken("selfclosingtag",this._index+2,a(this._indexPos,2)),this._state=m;else if(">"===t)this._emitToken("opentagname"),this._emitSpecialToken("opentagend",this._index+1,a(this._indexPos,1)),this._state=c,this._startSection(1);else if(n(t))this._emitToken("opentagname"),this._state=g;else if(!r(t)){this._emitSpecialToken("error");break}}else if(this._state===p)if(">"===t)this._state=c;else if(this._special>0){if("s"!==t&&"S"!==t){this._state=c;continue}this._state=V}else{if(!r(t)){this._emitSpecialToken("error");break}n(t)||(this._state=f,this._startSection())}else if(this._state===f){if(">"===t)this._emitToken("closetag"),this._state=c,this._startSection(1),this._special=0;else if(n(t))this._emitToken("closetag"),this._state=h,this._special=0;else if(!r(t)){this._emitSpecialToken("error");break}}else if(this._state===h){if(">"===t)this._state=c,this._startSection(1);else if(!n(t)){this._emitSpecialToken("error");break}}else if(this._state===m){if(">"!==t){this._emitSpecialToken("error");break}this._state=c,this._startSection(1)}else if(this._state===g)if(">"===t)this._state=c,this._emitSpecialToken("opentagend",this._index+1,a(this._indexPos,1)),this._startSection(1);else if("/"===t)this._emitSpecialToken("selfclosingtag",this._index+2,a(this._indexPos,2)),this._state=m;else{if(!i(t)){this._emitSpecialToken("error");break}n(t)||(this._state=y,this._startSection())}else if(this._state===y)if("="===t)this._emitTokenIfNonempty("attribname"),this._state=b;else if(n(t))this._emitTokenIfNonempty("attribname"),this._state=_;else{if("/"===t||">"===t){this._emitTokenIfNonempty("attribname"),this._state=g;continue}if(!i(t)){this._emitSpecialToken("error");break}}else if(this._state===_)if("="===t)this._state=b;else{if("/"===t||">"===t){this._state=g;continue}if(!i(t)){this._emitSpecialToken("error");break}n(t)||(this._state=y,this._startSection())}else if(this._state===b)if('"'===t)this._state=E,this._startSection(1);else if("'"===t)this._state=w,this._startSection(1);else{if(!o(t)){this._emitSpecialToken("error");break}n(t)||(this._state=S,this._startSection())}else if(this._state===E)'"'===t&&(this._emitToken("attribvalue"),this._state=v);else if(this._state===w)"'"===t&&(this._state=v,this._emitToken("attribvalue"));else if(this._state===S){if(">"===t)this._emitToken("attribvalue"),this._emitSpecialToken("opentagend",this._index+1,a(this._indexPos,1)),this._state=c,this._startSection(1);else if(n(t))this._emitToken("attribvalue"),this._state=g;else if(!o(t)){this._emitSpecialToken("error");break}}else if(this._state===v)if(">"===t)this._state=c,this._emitSpecialToken("opentagend",this._index+1,a(this._indexPos,1)),this._startSection(1);else if("/"===t)this._emitSpecialToken("selfclosingtag",this._index+2,a(this._indexPos,2)),this._state=m;else{if(!n(t)){this._emitSpecialToken("error");break}this._state=g}else if(this._state===C)this._state="["===t?O:"-"===t?x:I;else if(this._state===I)">"===t&&(this._emitToken("declaration"),this._state=c,this._startSection(1));else if(this._state===k)">"===t&&(this._emitToken("processinginstruction"),this._state=c,this._startSection(1));else if(this._state===x)"-"===t?(this._state=T,this._startSection(1)):this._state=I;else if(this._state===T)"-"===t&&(this._state=D);else if(this._state===D)this._state="-"===t?M:T;else if(this._state===M)">"===t?(this._emitToken("comment",this._index-2,a(this._indexPos,-2)),this._state=c,this._startSection(1)):"-"!==t&&(this._state=T);else if(this._state===O)this._state="C"===t?L:I;else if(this._state===L)this._state="D"===t?R:I;else if(this._state===R)this._state="A"===t?A:I;else if(this._state===A)this._state="T"===t?N:I;else if(this._state===N)this._state="A"===t?P:I;else if(this._state===P)"["===t?(this._state=F,this._startSection(1)):this._state=I;else if(this._state===F)"]"===t&&(this._state=$);else if(this._state===$)this._state="]"===t?U:F;else if(this._state===U)">"===t?(this._emitToken("cdata",this._index-2,a(this._indexPos,-2)),this._state=c,this._startSection(1)):"]"!==t&&(this._state=F);else if(this._state===j)if("c"===t||"C"===t)this._state=B;else{if("t"!==t&&"T"!==t){this._state=d;continue}this._state=J}else if(this._state===V)this._state=1!==this._special||"c"!==t&&"C"!==t?2!==this._special||"t"!==t&&"T"!==t?c:nt:G;else if(this._state===B){if("r"!==t&&"R"!==t){this._state=d;continue}this._state=W}else if(this._state===W){if("i"!==t&&"I"!==t){this._state=d;continue}this._state=H}else if(this._state===H){if("p"!==t&&"P"!==t){this._state=d;continue}this._state=q}else if(this._state===q){if("t"!==t&&"T"!==t){this._state=d;continue}this._state=z}else{if(this._state===z){("/"===t||">"===t||n(t))&&(this._special=1),this._state=d;continue}if(this._state===G)this._state="r"===t||"R"===t?K:c;else if(this._state===K)this._state="i"===t||"I"===t?X:c;else if(this._state===X)this._state="p"===t||"P"===t?Y:c;else if(this._state===Y)this._state="t"===t||"T"===t?Q:c;else if(this._state===Q){if(">"===t||n(t)){this._state=f,this._startSection(-6);continue}this._state=c}else if(this._state===J){if("y"!==t&&"Y"!==t){this._state=d;continue}this._state=Z}else if(this._state===Z){if("l"!==t&&"L"!==t){this._state=d;continue}this._state=et}else if(this._state===et){if("e"!==t&&"E"!==t){this._state=d;continue}this._state=tt}else{if(this._state===tt){("/"===t||">"===t||n(t))&&(this._special=2),this._state=d;continue}if(this._state===nt)this._state="y"===t||"Y"===t?rt:c;else if(this._state===rt)this._state="l"===t||"L"===t?it:c;else if(this._state===it)this._state="e"===t||"E"===t?ot:c;else{if(this._state!==ot){console.error("HTMLTokenizer: Encountered unknown state"),this._emitSpecialToken("error");break}if(">"===t||n(t)){this._state=f,this._startSection(-5);continue}this._state=c}}}"\n"===t?(this._indexPos.line++,this._indexPos.ch=0):this._indexPos.ch++,this._index++}return this._index===this._buffer.length&&this._state!==c&&this._emitSpecialToken("error"),this._token},s.prototype._startSection=function(e){e=e||0,this._sectionStart=this._index+e,this._sectionStartPos=a(this._indexPos,e)},s.prototype._setToken=function(e,t,n){void 0===t&&(t=this._index),void 0===n&&(n=this._indexPos);var r={type:e,contents:-1===this._sectionStart?"":this._buffer.substring(this._sectionStart,t),start:this._sectionStart,end:t,startPos:a(this._sectionStartPos),endPos:a(n)};
32this._token?(this._nextToken&&console.error("HTMLTokenizer: Tried to emit more than two tokens in a single call"),this._nextToken=r):this._token=r},s.prototype._emitToken=function(e,t,n){this._setToken(e,t,n),this._sectionStart=-1,this._sectionStartPos=null},s.prototype._emitSpecialToken=function(e,t,n){this._sectionStart=-1,this._sectionStartPos=null,this._emitToken(e,t,n)},s.prototype._emitTokenIfNonempty=function(e){this._index>this._sectionStart&&this._setToken(e),this._sectionStart=-1,this._sectionStartPos=null},t.Tokenizer=s}),define("thirdparty/murmurhash3_gc",["require","exports","module"],function(e,t,n){var r={mul32:function(e,t){var n=65535&t,r=t-n;return(r*e|0)+(n*e|0)|0},hashBytes:function(e,t,n){for(var r=3432918353,i=461845907,o=n,a=-4&t,s=0;a>s;s+=4){var l=255&e.charCodeAt(s)|(255&e.charCodeAt(s+1))<<8|(255&e.charCodeAt(s+2))<<16|(255&e.charCodeAt(s+3))<<24;l=this.mul32(l,r),l=(131071&l)<<15|l>>>17,l=this.mul32(l,i),o^=l,o=(524287&o)<<13|o>>>19,o=5*o+3864292196|0}switch(l=0,t%4){case 3:l=(255&e.charCodeAt(a+2))<<16;case 2:l|=(255&e.charCodeAt(a+1))<<8;case 1:l|=255&e.charCodeAt(a),l=this.mul32(l,r),l=(131071&l)<<15|l>>>17,l=this.mul32(l,i),o^=l}return o^=t,o^=o>>>16,o=this.mul32(o,2246822507),o^=o>>>13,o=this.mul32(o,3266489909),o^=o>>>16},hashString:function(e,t,n){for(var r=3432918353,i=461845907,o=n,a=-2&t,s=0;a>s;s+=2){var l=e.charCodeAt(s)|e.charCodeAt(s+1)<<16;l=this.mul32(l,r),l=(131071&l)<<15|l>>>17,l=this.mul32(l,i),o^=l,o=(524287&o)<<13|o>>>19,o=5*o+3864292196|0}return t%2==1&&(l=e.charCodeAt(a),l=this.mul32(l,r),l=(131071&l)<<15|l>>>17,l=this.mul32(l,i),o^=l),o^=t<<1,o^=o>>>16,o=this.mul32(o,2246822507),o^=o>>>13,o=this.mul32(o,3266489909),o^=o>>>16}};"undefined"!=typeof n&&"undefined"!=typeof n.exports&&(n.exports=r)}),define("language/HTMLSimpleDOM",["require","exports","module","language/HTMLTokenizer","thirdparty/murmurhash3_gc","utils/PerfUtils"],function(e,t){function n(e){$.extend(this,e)}function r(e){var t=e.parent.children.indexOf(e);return 0===t?e.parent.tagID+".0":e.parent.children[t-1].tagID+"t"}function i(e,t){return{line:e.line+t.line,ch:0===t.line?e.ch+t.ch:t.ch}}function o(e,t){return{line:e.line,ch:e.ch+t}}function a(e,t,n){this.stack=[],this.text=e,this.t=new c(e),this.currentTag=null,this.startOffset=t||0,this.startOffsetPos=n||{line:0,ch:0}}function s(e,t){var n=new a(e);return n.build(t)}function l(e){function t(e){n+=e.tag?r+"TAG "+e.tagID+" "+e.tag+" "+JSON.stringify(e.attributes)+"\n":r+"TEXT "+(e.tagID||"- ")+e.content+"\n",e.isElement()&&(r+=" ",e.children.forEach(t),r=r.slice(2))}var n="",r="";return t(e),n}var c=e("language/HTMLTokenizer").Tokenizer,u=e("thirdparty/murmurhash3_gc"),d=e("utils/PerfUtils"),p=Math.floor(65535*Math.random()),f=1,h={li:{li:!0},dt:{dd:!0,dt:!0},dd:{dd:!0,dt:!0},address:{p:!0},article:{p:!0},aside:{p:!0},blockquote:{p:!0},dir:{p:!0},div:{p:!0},dl:{p:!0},fieldset:{p:!0},footer:{p:!0},form:{p:!0},h1:{p:!0},h2:{p:!0},h3:{p:!0},h4:{p:!0},h5:{p:!0},h6:{p:!0},header:{p:!0},hgroup:{p:!0},hr:{p:!0},main:{p:!0},menu:{p:!0},nav:{p:!0},ol:{p:!0},p:{p:!0},pre:{p:!0},section:{p:!0},table:{p:!0},ul:{p:!0},rt:{rp:!0,rt:!0},rp:{rp:!0,rt:!0},optgroup:{optgroup:!0,option:!0},option:{option:!0},tbody:{thead:!0,tbody:!0,tfoot:!0},tfoot:{tbody:!0},tr:{tr:!0,th:!0,td:!0},th:{th:!0,td:!0},td:{thead:!0,th:!0,td:!0},body:{head:!0,link:!0,script:!0}},m={area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};n.prototype={update:function(){if(this.isElement()){var e,t,n="",r="";for(e=0;e<this.children.length;e++)t=this.children[e],t.isElement()?(r+=String(t.tagID),n+=String(t.tagID)+t.attributeSignature+t.subtreeSignature):(r+=t.textSignature,n+=t.textSignature);this.childSignature=u.hashString(r,r.length,p),this.subtreeSignature=u.hashString(n,n.length,p)}else this.textSignature=u.hashString(this.content,this.content.length,p)},updateAttributeSignature:function(){var e=JSON.stringify(this.attributes);this.attributeSignature=u.hashString(e,e.length,p)},isElement:function(){return!!this.children},isText:function(){return!this.children}},a.prototype._logError=function(e){var t={token:e},n=e?e.startPos||e.endPos:this.startOffsetPos,r=e?e.endPos:this.startOffsetPos;t.startPos=i(this.startOffsetPos,n),t.endPos=i(this.startOffsetPos,r),this.errors||(this.errors=[]),this.errors.push(t)},a.prototype.build=function(e,t){function a(e,t){l=f[f.length-1],f.pop(),l.update(),l.end=u.startOffset+e,l.endPos=i(u.startOffsetPos,t)}var s,l,c,u=this,p=0,f=this.stack,g=null,v={};t=t||{};var y="HTMLInstr. Build DOM Full",_="HTMLInstr. Build DOM Partial";for(d.markStart([y,_]);null!==(s=this.t.nextToken());){if("text"!==s.type&&"comment"!==s.type&&c&&(c=null),"error"===s.type)return d.finalizeMeasurement(y),d.addMeasurement(_),this._logError(s),null;if("opentagname"===s.type){var b,E=s.contents.toLowerCase();if(h.hasOwnProperty(E))for(var w=h[E];f.length>0&&w.hasOwnProperty(f[f.length-1].tag);)a(s.start-1,o(s.startPos,-1));b=new n({tag:s.contents.toLowerCase(),children:[],attributes:{},parent:f.length?f[f.length-1]:null,start:this.startOffset+s.start-1,startPos:i(this.startOffsetPos,o(s.startPos,-1))}),b.tagID=this.getID(b,t),v[b.tagID]&&(b.tagID=this.getNewID()),v[b.tagID]=b,b.parent&&b.parent.children.push(b),this.currentTag=b,m.hasOwnProperty(b.tag)?b.update():f.push(b)}else if("opentagend"===s.type||"selfclosingtag"===s.type)this.currentTag&&("selfclosingtag"===s.type&&f.length&&f[f.length-1]===this.currentTag?a(s.end,s.endPos):(this.currentTag.end=this.startOffset+s.end,this.currentTag.endPos=i(this.startOffsetPos,s.endPos),l=this.currentTag,this.currentTag.updateAttributeSignature(),this.currentTag=null));else if("closetag"===s.type){var S=s.contents.toLowerCase();if(!m.hasOwnProperty(S)){var C;for(C=f.length-1;C>=0&&f[C].tag!==S;C--);if(e&&C!==f.length-1)return d.finalizeMeasurement(y),d.addMeasurement(_),this._logError(s),null;if(C>=0){do f.length===C+1?a(s.end+1,o(s.endPos,1)):a(s.start-2,o(s.startPos,-2));while(f.length>C)}else if(e)return d.finalizeMeasurement(y),d.addMeasurement(_),this._logError(s),null}}else if("attribname"===s.type)g=s.contents.toLowerCase(),this.currentTag.attributes[g]="";else if("attribvalue"===s.type&&null!==g)this.currentTag.attributes[g]=s.contents,g=null;else if("text"===s.type&&f.length){var I,k=f[f.length-1];c?(I=c,I.content+=s.contents):(I=new n({parent:f[f.length-1],content:s.contents}),k.children.push(I),I.tagID=r(I),v[I.tagID]=I,c=I),I.update()}p=s.end}if(f.length){if(e)return d.finalizeMeasurement(y),d.addMeasurement(_),this._logError(s),null;for(var x=this.text.split("\n"),T={line:x.length-1,ch:x[x.length-1].length};f.length;)a(this.text.length,T)}var D=l;return D?(D.nodeMap=v,d.addMeasurement(y),d.finalizeMeasurement(_),D):(this._logError(s),null)},a.prototype.getNewID=function(){return f++},a.prototype.getID=a.prototype.getNewID,t.build=s,t.Builder=a,t.SimpleNode=n,t._dumpDOM=l,t._offsetPos=o,t._getTextNodeID=r,t._seed=p}),define("language/HTMLDOMDiff",["require","exports","module"],function(e,t){function n(e,t){var n=$.extend({},e.attributes),r=t.attributes,i=[];return Object.keys(r).forEach(function(t){if(n[t]!==r[t]){var o=n.hasOwnProperty(t)?"attrChange":"attrAdd";i.push({type:o,tagID:e.tagID,attribute:t,value:r[t]})}delete n[t]}),Object.keys(n).forEach(function(t){i.push({type:"attrDelete",tagID:e.tagID,attribute:t})}),i}function r(e){return e.parent&&e.parent.tagID}function i(e,t){var r,i,a=[],s=[],l=[],c=e?e.nodeMap:{},u=t.nodeMap,d=function(e){e.children&&c[e.tagID]&&a.push(e)},p=function(e){s.push.apply(s,e.edits),l.push.apply(l,e.moves),a.push.apply(a,e.newElements)};a.push(t);do r=a.pop(),i=c[r.tagID],i?(r.attributeSignature!==i.attributeSignature&&s.push.apply(s,n(i,r)),r.childSignature!==i.childSignature&&p(o(i,c,r,u)),r.subtreeSignature!==i.subtreeSignature&&r.children.forEach(d)):(r.parent||s.push({type:"elementInsert",tag:r.tag,tagID:r.tagID,parentID:null,attributes:r.attributes}),p(o(null,c,r,u)));while(a.length);return l.length>0&&s.unshift({type:"rememberNodes",tagIDs:l}),s}var o=function(e,t,n,i){for(var o,a,s,l,c=0,u=0,d=n.children,p=e?e.children:[],f=[],h=[],m=[],g=[],v=function(e,t){f.forEach(function(t){"elementDelete"!==t.type&&(t.beforeID=e)}),h.push.apply(h,f),f=[],t||(l=e)},y=function(){return t[o.tagID]?!1:(s={type:"elementInsert",tag:o.tag,tagID:o.tagID,parentID:o.parent.tagID,attributes:o.attributes},f.push(s),g.push(o),l=o.tagID,c++,!0)},_=function(){return i[a.tagID]?!1:(v(a.tagID,!0),s={type:"elementDelete",tagID:a.tagID},f.push(s),u++,!0)},b=function(){s={type:"textInsert",content:o.content,parentID:o.parent.tagID},l?s.afterID=l:s.firstChild=!0,f.push(s),c++},E=function(){return c>0?n.children[c-1]:null},w=function(){var e=E();s=e&&!e.children?{type:"textReplace",content:e.content}:{type:"textDelete"};var t=f.length>0&&f[f.length-1];return t&&"textReplace"===t.type&&t.afterID===l?void u++:(s.parentID=a.parent.tagID,1===a.parent.children.length?f.push(s):(l&&(s.afterID=l),f.push(s)),void u++)},S=function(){var e=t[o.tagID];return e&&n.tagID!==r(e)?(s={type:"elementMove",tagID:o.tagID,parentID:o.parent.tagID},m.push(s.tagID),f.push(s),c++,!0):!1},C=function(e){var t=i[e.tagID];return e.children&&t&&r(e)!==r(t)};c<d.length&&u<p.length;)o=d[c],o.children&&S()||(a=p[u],C(a)?u++:o.isElement()||a.isElement()?o.isElement()&&a.isText()?(w(),y()):a.isElement()&&o.isText()?_()||b():o.tagID!==a.tagID?_()||y()||(console.error("HTML Instrumentation: This should not happen. Two elements have different tag IDs and there was no insert/delete. This generally means there was a reordering of elements."),c++,u++):(v(a.tagID,!1),c++,u++):(o.textSignature!==a.textSignature&&(s={type:"textReplace",content:o.content,parentID:o.parent.tagID},l&&(s.afterID=l),f.push(s)),c++,u++));for(;u<p.length;)a=p[u],C(a)?u++:a.isElement()?_()||(console.error("HTML Instrumentation: failed to add elementDelete for remaining element in the original DOM. This should not happen.",a),u++):w();for(;c<d.length;)o=d[c],o.isElement()?S()||y()||(console.error("HTML Instrumentation: failed to add elementInsert for remaining element in the updated DOM. This should not happen."),c++):b();return f.forEach(function(e){("textInsert"===e.type||"elementInsert"===e.type||"elementMove"===e.type)&&(e.lastChild=!0,delete e.firstChild,delete e.afterID)}),h.push.apply(h,f),{edits:h,moves:m,newElements:g}};t.domdiff=i}),define("language/HTMLInstrumentation",["require","exports","module","document/DocumentManager","./HTMLSimpleDOM","./HTMLDOMDiff"],function(e,t){function n(e,t){S.hasOwnProperty(t.file.fullPath)&&(delete S[t.file.fullPath],$(t).off(".htmlInstrumentation"))}function r(e,t){return e&&t&&e.line===t.line&&e.ch===t.ch}function i(e,t){return e=e.filter(function(e){return!!e.tagID}).map(function(e){return t[e.tagID]||(t[e.tagID]={mark:e,range:e.find()}),t[e.tagID]}),e.sort(function(e,t){return e.range.from.line===t.range.from.line?e.range.from.ch-t.range.from.ch:e.range.from.line-t.range.from.line}),e}function o(e,t,n,o){var a,s;return o=o||{},a=i(e._codeMirror.findMarksAt(t),o),a.length?(s=a[a.length-1],n&&(r(s.range.from,t)||r(s.range.to,t))&&(s=a.length>1?a[a.length-2]:null),s.mark):null}function a(e,t,n){var r=o(e,t,!1,n);return r?r.tagID:-1}function s(e,t){t.children.forEach(function(t){t.isElement()&&s(e,t)});var n=e.markText(t.startPos,t.endPos);n.tagID=t.tagID}function l(e,t){var n=e._codeMirror,r=n.getAllMarks();n.operation(function(){r.forEach(function(e){e.hasOwnProperty("tagID")&&e.clear()})}),s(n,t)}function c(e,t,n){function r(e){return/[<>\/=\"\']/.test(e)}var i,a,s=0;if(this.isIncremental=!1,n&&1===n.length){var l=n[0];if(!r(l.text)&&!r(l.removed)){var c=o(t,l.from,!0);if(c){var u=c.find();u&&(i=t._codeMirror.getRange(u.from,u.to),this.changedTagID=c.tagID,a=u.from,s=t._codeMirror.indexFromPos(a),this.isIncremental=!0)}}}this.changedTagID||(i=t.document.getText()),b.Builder.call(this,i,s,a),this.editor=t,this.cm=t._codeMirror,this.previousDOM=e}function u(e,t){for(var n=e.parent;n&&n.tagID!==t;)n=n.parent;return!!n}function d(e,t,n){w||(n=void 0);var r=new c(e,t,n),i=r.update();if(!i)return{errors:r.errors};var o=E.domdiff(i.oldSubtree,i.newSubtree);return i.newSubtree!==i.newDOM&&delete i.newSubtree.nodeMap,{dom:i.newDOM,edits:o,_wasIncremental:r.isIncremental}}function p(e,t){var n=S[e.document.file.fullPath];n&&n.dom&&!S[e.document.file.fullPath].invalid||(t=null);var r=d(n&&n.dom,e,t);return r.errors?(n&&(n.invalid=!0),{errors:r.errors}):(S[e.document.file.fullPath]={timestamp:e.document.diskTimestamp,dom:r.dom,dirty:!1},{edits:r.edits})}function f(e,t){function n(e){e.tagID=e.attributes["data-brackets-id"],delete e.attributes["data-brackets-id"],e.children.forEach(function(t){t.parent=e,t.isElement()?n(t):t.isText()&&(t.update(),t.tagID=b.getTextNodeID(t),i[t.tagID]=t)}),e.update(),i[e.tagID]=e,e.tagID===t&&(r=e)}var r,i={};return n(e),r=r||e,r.nodeMap=i,r}function h(e,t){var n,r=S[e.document.file.fullPath],i=r.dom;return n=f(t,i.tagID),{diff:E.domdiff(i,n),browser:n,editor:i}}function m(e){S.hasOwnProperty(e.file.fullPath)||($(e).on("change.htmlInstrumentation",function(){S[e.file.fullPath]&&(S[e.file.fullPath].dirty=!0)}),S[e.file.fullPath]=null);var t=S[e.file.fullPath];if(!e.isDirty&&t&&!t.dirty&&t.timestamp===e.diskTimestamp)return t.dom;var n=e.getText(),r=b.build(n);return r&&(S[e.file.fullPath]={timestamp:e.diskTimestamp,dom:r,dirty:!1}),r}function g(e){function t(e){if(e.tag){var n=" data-brackets-id='"+e.tagID+"'",r=e.start+e.tag.length+1;o+=i.substr(a,r-a)+n,a=r}e.isElement()&&e.children.forEach(t)}var n=e.document,r=m(n),i=n.getText(),o="",a=0;return r?(l(e,r),t(r),o+=i.substr(a)):null}function v(e){var t=S[e.document.file.fullPath],n=t&&t.dom;return n?void l(e,n):void console.error("Couldn't find the dom for "+e.document.file.fullPath)}function y(){S={}}var _=e("document/DocumentManager"),b=e("./HTMLSimpleDOM"),E=e("./HTMLDOMDiff"),w=!0,S={};c.prototype=Object.create(b.Builder.prototype),c.prototype.getID=function(e,t){var n=a(this.editor,b._offsetPos(e.startPos,1),t);if(-1===n||u(e,n))n=this.getNewID();else{var r=this.previousDOM.nodeMap[n];r&&r.tag===e.tag||(n=this.getNewID())}return n},c.prototype._updateMarkedRanges=function(e,t){var n=Object.keys(e),i=this.cm,o=i.getAllMarks();i.operation(function(){o.forEach(function(o){if(o.hasOwnProperty("tagID")&&e[o.tagID]){var a=e[o.tagID],s=t[o.tagID];s&&r(s.range.from,a.startPos)&&r(s.range.to,a.endPos)||(o.clear(),o=i.markText(a.startPos,a.endPos),o.tagID=a.tagID),n.splice(n.indexOf(String(a.tagID)),1)}}),n.forEach(function(t){var n,r=e[t];r.isElement()&&(n=i.markText(r.startPos,r.endPos),n.tagID=Number(t))})})},c.prototype._buildNodeMap=function(e){function t(e){e.tagID&&(n[e.tagID]=e),e.isElement()&&e.children.forEach(t)}var n={};t(e),e.nodeMap=n},c.prototype._handleDeletions=function(e,t,n){var r=[];if(Object.keys(t).forEach(function(t){n.hasOwnProperty(t)||(r.push(t),delete e[t])}),r.length){var i=this.cm.getAllMarks();i.forEach(function(e){e.hasOwnProperty("tagID")&&-1!==r.indexOf(e.tagID)&&e.clear()})}},c.prototype.update=function(){var e={},t=this.build(!0,e),n={newDOM:t,oldSubtree:this.previousDOM,newSubtree:t};if(!t)return null;if(this.changedTagID){var r=this.previousDOM.nodeMap[this.changedTagID],i=r.parent;if(i){var o=i.children.indexOf(r);if(-1===o)console.error("DOMUpdater.update(): couldn't locate old subtree in tree");else{r.parent=null,t.parent=i,i.children[o]=t,$.extend(this.previousDOM.nodeMap,t.nodeMap),this._updateMarkedRanges(t.nodeMap,e),this._buildNodeMap(r),this._handleDeletions(this.previousDOM.nodeMap,r.nodeMap,t.nodeMap);for(var a=i;a;)a.update(),a=a.parent;n.newDOM=this.previousDOM,n.oldSubtree=r}}}else l(this.editor,n.newDOM);return n},$(_).on("beforeDocumentDelete",n),t._markText=v,t._getMarkerAtDocumentPos=o,t._getTagIDAtDocumentPos=a,t._markTextFromDOM=l,t._updateDOM=d,t._allowIncremental=w,t._getBrowserDiff=h,t._resetCache=y,t.scanDocument=m,t.generateInstrumentedHTML=g,t.getUnappliedEditList=p}),define("LiveDevelopment/Documents/HTMLDocument",["require","exports","module","editor/EditorManager","LiveDevelopment/Agents/HighlightAgent","language/HTMLInstrumentation","LiveDevelopment/Inspector/Inspector","LiveDevelopment/LiveDevelopment","utils/PerfUtils","LiveDevelopment/Agents/RemoteAgent","thirdparty/lodash"],function(e,t,n){var r=e("editor/EditorManager"),i=e("LiveDevelopment/Agents/HighlightAgent"),o=e("language/HTMLInstrumentation"),a=e("LiveDevelopment/Inspector/Inspector"),s=e("LiveDevelopment/LiveDevelopment"),l=e("utils/PerfUtils"),c=e("LiveDevelopment/Agents/RemoteAgent"),u=e("thirdparty/lodash"),d=function(e,t){this.doc=e,this.doc&&this.doc.addRef(),this.editor=t,this._instrumentationEnabled=!1,this._onActiveEditorChange=this._onActiveEditorChange.bind(this),$(r).on("activeEditorChange",this._onActiveEditorChange),this.attachToEditor(t)};d.prototype.setInstrumentationEnabled=function(e){e&&!this._instrumentationEnabled&&this.editor&&(o.scanDocument(this.doc),o._markText(this.editor)),this._instrumentationEnabled=e},d.prototype.isLiveEditingEnabled=function(){return this._instrumentationEnabled},d.prototype.getResponseData=function(){var e;return this._instrumentationEnabled&&this.editor&&(e=o.generateInstrumentedHTML(this.editor)),{body:e||this.doc.getText()}},d.prototype.close=function(){this.editor&&$(this.editor).off(".HTMLDocument"),this.doc&&this.doc.releaseRef(),$(r).off("activeEditorChange",this._onActiveEditorChange),s.config.experimental&&this._onHighlight()},d.prototype.attachToEditor=function(e){var t=this;this.editor=e,$(this.editor).on("cursorActivity.HTMLDocument",function(e,n){t._onCursorActivity(e,n)}),$(this.editor).on("change.HTMLDocument",function(e,n,r){t._onChange(e,n,r)}),$(this.editor).on("beforeDestroy.HTMLDocument",function(e,n){t._onDestroy(e,n)}),s.config.experimental&&$(i).on("highlight.HTMLDocument",function(e,n){t._onHighlight(e,n)}),this._instrumentationEnabled&&o._markText(this.editor)},d.prototype.detachFromEditor=function(){this.editor&&(i.hide(),$(this.editor).off(".HTMLDocument"),this._removeHighlight(),this.editor=null)},d.prototype.updateHighlight=function(){var e=this.editor,t=[];a.config.highlight&&(e&&u.each(e.getSelections(),function(n){var r=o._getTagIDAtDocumentPos(e,n.reversed?n.end:n.start);-1!==r&&t.push(r)}),t.length?i.domElement(t):i.hide())},d.prototype._onCursorActivity=function(e,t){this.editor===t&&this.updateHighlight()},d.prototype._compareWithBrowser=function(e){var t=this;c.call("getSimpleDOM").done(function(n){var r,i,a,s=JSON.parse(n.result.value);try{a=o._getBrowserDiff(t.editor,s)}catch(l){return console.error("Error comparing in-browser DOM to in-editor DOM"),void console.error(l.stack)}r=a.diff.filter(function(e){return i=a.browser.nodeMap[e.parentID],i&&"html"===i.tag&&"textDelete"===e.type?!1:!0}),r.length>0&&(console.warn("Browser DOM does not match after change: "+JSON.stringify(e)),r.forEach(function(e){console.log(e)}))})},d.prototype._onDestroy=function(e,t){this.editor===t&&this.detachFromEditor()},d.prototype._onChange=function(e,t,n){if(this._instrumentationEnabled){var r="HTMLDocument applyDOMEdits",i=l.isActive(r);i||l.markStart(r);var a,s=this,u=o.getUnappliedEditList(t,n);u.edits&&(a=c.call("applyDOMEdits",u.edits),a.always(function(){i||l.addMeasurement(r)})),this.errors=u.errors||[],$(this).triggerHandler("statusChanged",[this]),this._debug&&(console.log("Edits applied to browser were:"),console.log(JSON.stringify(u.edits,null,2)),a.done(function(){s._compareWithBrowser(n)}))}},d.prototype._onActiveEditorChange=function(e,t){this.detachFromEditor(),t&&t.document===this.doc&&this.attachToEditor(t)},d.prototype._onHighlight=function(e,t){if(this._removeHighlight(),t&&t.location&&this.editor){var n,r=this.editor._codeMirror,i=r.posFromIndex(t.location);n=t.closeLocation?t.closeLocation+t.closeLength:t.location+t.length,n=r.posFromIndex(n),this._highlight=r.markText(i,n,{className:"highlight"})}},d.prototype._removeHighlight=function(){this._highlight&&(this._highlight.clear(),this._highlight=null)},n.exports=d}),define("LiveDevelopment/Documents/JSDocument",["require","exports","module","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Agents/ScriptAgent","LiveDevelopment/Agents/HighlightAgent"],function(e,t,n){var r=e("LiveDevelopment/Inspector/Inspector"),i=e("LiveDevelopment/Agents/ScriptAgent"),o=e("LiveDevelopment/Agents/HighlightAgent"),a=function(e,t){t&&(this.doc=e,this.editor=t,this.onHighlight=this.onHighlight.bind(this),this.onChange=this.onChange.bind(this),this.onCursorActivity=this.onCursorActivity.bind(this),$(o).on("highlight",this.onHighlight),$(this.editor).on("change",this.onChange),$(this.editor).on("cursorActivity",this.onCursorActivity),this.onCursorActivity())};a.prototype.close=function(){this.editor&&($(o).off("highlight",this.onHighlight),$(this.editor).off("change",this.onChange),$(this.editor).off("cursorActivity",this.onCursorActivity),this.onHighlight())},a.prototype.script=function(){return i.scriptForURL(this.doc.url)},a.prototype.onCursorActivity=function(){},a.prototype.onChange=function(){var e=this.doc.getText();r.Debugger.setScriptSource(this.script().scriptId,e,function(){r.Runtime.evaluate('if($)$("canvas").each(function(i,e){if(e.rerender)e.rerender()})')}.bind(this))},a.prototype.onHighlight=function(e,t){var n,r=this.editor._codeMirror;for(n in this._highlight)r.removeLineClass(this._highlight[n],"wrap","highlight");if(this._highlight=[],t&&t.trace){var i,o,a=this.script().scriptId;for(n in t.trace)i=t.trace[n],i.location&&i.location.scriptId===a&&(o=i.location.lineNumber,r.addLineClass(o,"wrap","highlight"),this._highlight.push(o))}},n.exports=a}),define("LiveDevelopment/Agents/ConsoleAgent",["require","exports","module","LiveDevelopment/Inspector/Inspector"],function(e,t){function n(e){var t=e.level;"warning"===t&&(t="warn");var n="ConsoleAgent: "+e.text;if(e.url&&(n+=" (url: "+e.url+")"),e.stackTrace){var r=e.stackTrace[0];n+=" in "+r.functionName+":"+r.columnNumber}console[t](n)}function r(e,t){c=t.message,n(c)}function i(){c&&n(c)}function o(){}function a(){return u.Console.enable()}function s(){$(u.Console).on("messageAdded.ConsoleAgent",r).on("messageRepeatCountUpdated.ConsoleAgent",i).on("messagesCleared.ConsoleAgent",o)}function l(){$(u.Console).off(".ConsoleAgent")}var c,u=e("LiveDevelopment/Inspector/Inspector");t.enable=a,t.load=s,t.unload=l}),define("LiveDevelopment/Agents/NetworkAgent",["require","exports","module","LiveDevelopment/Inspector/Inspector"],function(e,t){function n(e){var t=e.search(/[#\?]/);return t>=0&&(e=e.substr(0,t)),e}function r(e){return p&&p[e]}function i(e){p[n(e)]=!0}function o(e,t){i(t.request.url)}function a(){p={}}function s(e,t){t.frame.parentId||a(),i(t.frame.url)}function l(){return d.Network.enable()}function c(){$(d.Page).on("frameNavigated.NetworkAgent",s),$(d.Network).on("requestWillBeSent.NetworkAgent",o)}function u(){a(),$(d.Page).off(".NetworkAgent"),$(d.Network).off(".NetworkAgent")}var d=e("LiveDevelopment/Inspector/Inspector"),p={};t.wasURLRequested=r,t.enable=l,t.load=c,t.unload=u}),define("LiveDevelopment/LiveDevelopment",["require","exports","module","utils/Global","thirdparty/lodash","utils/Async","widgets/Dialogs","widgets/DefaultDialogs","document/DocumentManager","editor/EditorManager","LiveDevelopment/Servers/FileServer","filesystem/FileSystemError","file/FileUtils","LiveDevelopment/LiveDevServerManager","view/MainViewManager","utils/NativeApp","preferences/PreferencesDialogs","project/ProjectManager","strings","utils/StringUtils","LiveDevelopment/Servers/UserServer","LiveDevelopment/Inspector/Inspector","LiveDevelopment/Documents/CSSDocument","LiveDevelopment/Documents/CSSPreprocessorDocument","LiveDevelopment/Documents/HTMLDocument","LiveDevelopment/Documents/JSDocument","LiveDevelopment/Agents/CSSAgent","LiveDevelopment/Agents/ConsoleAgent","LiveDevelopment/Agents/RemoteAgent","LiveDevelopment/Agents/NetworkAgent","LiveDevelopment/Agents/DOMAgent","LiveDevelopment/Agents/ScriptAgent","LiveDevelopment/Agents/HighlightAgent","LiveDevelopment/Agents/GotoAgent","LiveDevelopment/Agents/EditAgent"],function(e,t){function n(e){return e&&"pending"===e.state()}function r(e){return bt.isStaticHtmlFileExt(e)||It.getBaseUrl()&&bt.isServerHtmlFileExt(e)}function i(){return gt.getCurrentDocument()}function o(e){switch(e.getLanguage().getId()){case"less":case"scss":return Ot;case"css":return Mt;case"javascript":return t.config.experimental?Rt:null}return r(e.file.fullPath)?Lt:null}function a(e){return Bt?Bt.get(e):void 0}function s(e){return e?a(e.document.file.fullPath):null}function l(e){var t;e.editor&&e._errorLineHandles&&e._errorLineHandles.length&&e.editor._codeMirror.operation(function(){for(;;){if(t=e._errorLineHandles.pop(),!t)break;e.editor._codeMirror.removeLineClass(t,"wrap",At)}})}function c(e){return e+" "+xt.format(kt.LIVE_DEVELOPMENT_TROUBLESHOOTING,brackets.config.troubleshoot_url)}function u(e){l(e),e.close(),e.editor&&$(e.editor).off(".livedev"),$(e).off(".livedev")}function d(e){qt[e.doc.url]&&delete qt[e.doc.url],Bt&&Bt.remove(e),u(e)}function p(e,n){if(e!==t.status){t.status=e;var r=e===st?n:null;$(t).triggerHandler("statusChange",[e,r])}}function f(e){var t,n,r,i,o=e.errors.length?pt:ut;p(o),e.editor&&e.editor._codeMirror.operation(function(){l(e),e._errorLineHandles=e._errorLineHandles||[],e.errors.forEach(function(o){for(t=o.startPos.line,n=o.endPos.line,r=t;n+1>r;r++)i=e.editor._codeMirror.addLineClass(r,"wrap",At),e._errorLineHandles.push(i)})})}function h(){$t&&(u($t),$t=void 0),Object.keys(qt).forEach(function(e){u(qt[e]),delete qt[e]}),Bt&&Bt.clear()}function m(e,t){var n=o(e),r=new n(e,t);return n?($(r).on("statusChanged.livedev",function(){f(r)}),r):null}function g(e){e._ensureMasterEditor(),$t=m(e,e._masterEditor),Bt.add($t)}function v(e){Pt.hasOwnProperty(e)&&!Wt.hasOwnProperty(e)&&(Wt[e]=!0)}function y(e){Wt.hasOwnProperty(e)&&delete Wt[e]}function _(e){var t=Bt&&Bt.get(e.file.fullPath),n=t&&t.isLiveEditingEnabled();return e.isDirty&&!n}function b(e,t,n){var r;t.message?r=t.message:(console.warn("Expected a non-empty string in error.message, got this instead:",t.message),r=JSON.stringify(t)),r&&"Uncaught"===r.substr(0,8)&&(r=r.substr(9));var i=t.data;Array.isArray(i)&&(r+="\n"+i.join("\n")),console.error(r,t,n)}function E(e,t){var n=Bt&&Bt.urlToPath(t),r=!!qt[t];if(n&&!r){var i=gt.getDocumentForPath(n);i.done(function(e){if(!(o(e)!==Mt&&o(e)!==Ot||$t&&e===$t.doc)){var t=m(e,e._masterEditor);t&&(Bt.add(t),qt[e.url]=t,$(t).on("deleted.livedev",function(e,t){d(t)}))}})}}function w(){Ht.forEach(function(e){Pt[e].unload()}),Ht=[]}function S(e,t){var n;return Pt[e]&&Pt[e][t]&&(n=Pt[e][t].call()),n?n.fail(function(){console.error(t+" failed on agent",e)}):n=(new $.Deferred).resolve().promise(),n}function C(){var e;return e=t.config.experimental?Pt:Wt,Object.keys(e)}function I(){return ft.doInParallel(C(),function(e){return S(e,"enable")},!0)}function k(){if(Vt)return Vt;var e,t=new $.Deferred;return Vt=t.promise(),p(ct),e=ft.doInParallel(C(),function(e){return S(e,"load").done(function(){Ht.push(e)})},!0),e=ft.withTimeout(e,1e4),e.done(function(){var e=$t?$t.doc:null;if(e){var n=ut;_(e)&&(n=dt),p(n),t.resolve()}else t.reject()}),e.fail(t.reject),Vt.fail(function(){p(at),ht.showModalDialog(ht.DIALOG_ID_ERROR,kt.LIVE_DEVELOPMENT_ERROR_TITLE,c(kt.LIVE_DEV_LOADING_ERROR_MESSAGE))}).always(function(){Vt=null}),Vt}function x(){function e(e){return e.substring(0,e.lastIndexOf("/",e.length-2)+1)}function t(e){var t=e.lastIndexOf(".");return-1===t?e:e.slice(0,t)}var n,r,o=i();if(o&&(n=o.file.fullPath,bt.isStaticHtmlFileExt(n)||bt.isServerHtmlFileExt(n)))return(new $.Deferred).resolve(o);var a=new $.Deferred,s=It.getBaseUrl(),l=s&&s.length;return It.getAllFiles().done(function(i){var o,s=It.getProjectRoot().fullPath,c=!1,u=!0;o=n?bt.getDirectoryPath(n):s;for(var d=i.filter(function(t){var n=e(t.fullPath);return 0===o.indexOf(n)}),p=function(e){if(0===e.fullPath.indexOf(o)){if("index"!==t(e.name))return!1;if(l){if(bt.isServerHtmlFileExt(e.name)||bt.isStaticHtmlFileExt(e.name))return!0}else if(bt.isStaticHtmlFileExt(e.name))return!0}};!c&&u;)r=ot.findIndex(d,p),-1===r?(o=e(o),-1===o.indexOf(s)&&(u=!1)):c=!0;return-1!==r?void gt.getDocumentForPath(d[r].fullPath).then(a.resolve,a.resolve):void a.resolve(null)}),a.promise()}function T(e,t,n){if(n&&n.document&&bt.isCSSPreprocessorFile(n.document.file.fullPath)){var r=Bt&&Bt.pathToUrl(n.document.file.fullPath);qt&&qt[r]&&d(qt[r])}if(t&&t.document&&bt.isCSSPreprocessorFile(t.document.file.fullPath)){var i=Bt&&Bt.pathToUrl(t.document.file.fullPath);E(null,i)}}function D(e){var t,n=new $.Deferred,r=Dt.connected();return $(vt).off("activeEditorChange",T),$(Dt.Page).off(".livedev"),$(Dt).off(".livedev"),Vt?Vt.always(w):w(),h(),Bt&&(Bt.stop(),Bt=null),e&&r?(t=Dt.Runtime.evaluate("window.open('', '_self').close();"),t=ft.withTimeout(t,5e3)):t=(new $.Deferred).resolve(),t.always(function(){Dt.connected()?Dt.disconnect().always(n.resolve):n.resolve()}),n.promise()}function M(e,r){function i(){var e="mac"===brackets.platform?St.closeLiveBrowser():$.Deferred().resolve();e.done(function(){p(st,r||"explicit_close"),jt.resolve()}).fail(function(e){e&&(r+=" ("+e+")"),p(st,r||"explicit_close"),jt.resolve()})}if(jt)return jt;jt=new $.Deferred,jt.always(function(){jt=null});var o=jt.promise();return n(Ut)&&Ut.reject(),t.status===st?jt.resolve():D(e).always(i),o}function O(e,t){var n,r,i=t.frame.url;t.frame.parentId||!i.match(/^file:\/\//i)&&Bt&&(n=Bt.getBaseUrl(),n&&(r=new RegExp("^"+xt.regexEscape(n),"i"),i.match(r)||M(!1,"navigated_away")))}function L(){M(!1,"closed_unknown_reason")}function R(e,t){var n;t&&t.reason&&(n="detached_"+t.reason),M(!1,n)}function A(){return Vt?Vt:(w(),ot.forOwn(qt,function(e){d(e)}),k())}function N(){A(),Dt.Page.reload()}function P(){return M(!0)}function F(){function e(){n&&Dt.connected()?Dt.Runtime.evaluate("window.isBracketsLiveDevelopmentInterstitialPageLoaded",function(n){var i=n.result;"boolean"===i.type&&i.value?(window.clearTimeout(r),t.resolve()):window.setTimeout(e,100)}):t.reject()}var t=$.Deferred(),n=!0,r=window.setTimeout(function(){n=!1,t.reject()},1e4);return e(),t.promise()}function U(){Dt.Runtime.evaluate("window.navigator.userAgent",function(e){Dt.setUserAgent(e.result.value)});var e=Dt.Page.enable().then(I);e.done(function(){k().then(Ut.resolve,Ut.reject),x().done(function(e){e&&$t?(e!==$t.doc&&g(e),Bt?Dt.Page.navigate(Bt.pathToUrl(e.file.fullPath)):console.error("LiveDevelopment._onInterstitialPageLoad(): No server active")):P()})})}function j(){$(Dt.Page).on("frameNavigated.livedev",O),$(Dt).on("disconnect.livedev",L),F().fail(function(){P(),ht.showModalDialog(mt.DIALOG_ID_ERROR,kt.LIVE_DEVELOPMENT_ERROR_TITLE,c(kt.LIVE_DEV_LOADING_ERROR_MESSAGE))}).done(U)}function V(){ht.showModalDialog(mt.DIALOG_ID_ERROR,kt.LIVE_DEVELOPMENT_ERROR_TITLE,c(kt.LIVE_DEV_NEED_HTML_MESSAGE)),Ut.reject()}function B(){ht.showModalDialog(mt.DIALOG_ID_ERROR,kt.LIVE_DEVELOPMENT_ERROR_TITLE,c(kt.LIVE_DEV_SERVER_NOT_READY_MESSAGE)),Ut.reject()}function W(){var e=!1,n=0;Dt.connectToURL(Ft).fail(function r(i){if("CANCEL"===i)return void Ut.reject(i);if(n>3){p(at);var o=ht.showModalDialog(mt.DIALOG_ID_LIVE_DEVELOPMENT,kt.LIVE_DEVELOPMENT_RELAUNCH_TITLE,c(kt.LIVE_DEVELOPMENT_ERROR_MESSAGE),[{className:ht.DIALOG_BTN_CLASS_LEFT,id:ht.DIALOG_BTN_CANCEL,text:kt.CANCEL},{className:ht.DIALOG_BTN_CLASS_PRIMARY,id:ht.DIALOG_BTN_OK,text:kt.RELAUNCH_CHROME}]);return void o.done(function(t){t===ht.DIALOG_BTN_OK?(p(st),M().done(function(){e=!1,z(!0)}).fail(function(){p(at),e=!1,Ut.reject("CLOSE_LIVE_BROWSER")})):M().done(function(){e=!1,Ut.reject("CANCEL")}).fail(function(){p(at),e=!1,Ut.reject("CLOSE_LIVE_BROWSER")})})}n++,e||t.status===at||St.openLiveBrowser(Ft,!0).done(function(){e=!0}).fail(function(e){var t;p(at),t=e===_t.NOT_FOUND?kt.ERROR_CANT_FIND_CHROME:xt.format(kt.ERROR_LAUNCHING_BROWSER,e),ht.showModalDialog(mt.DIALOG_ID_ERROR,kt.ERROR_LAUNCHING_BROWSER_TITLE,c(t)),Ut.reject("OPEN_LIVE_BROWSER")
33}),t.status!==at&&window.setTimeout(function(){Dt.connectToURL(Ft).fail(r)},3e3)})}function H(e){p(lt),g(e),Bt.start(),$(Dt).one("connect",j),W(),Ut.done(function(){$(vt).on("activeEditorChange",T),T(null,vt.getActiveEditor(),null)})}function q(e){var n=new $.Deferred,r=!1;if(Bt=Et.getServer(e.file.fullPath),r=!t.config.experimental&&!Bt&&bt.isServerHtmlFileExt(e.file.fullPath))Ct.showProjectPreferencesDialog("",kt.LIVE_DEV_NEED_BASEURL_MESSAGE).done(function(t){t===ht.DIALOG_BTN_OK&&It.getBaseUrl()?q(e).then(n.resolve,n.reject):n.reject()});else if(Bt){var i=Bt.readyToServe();i?i.then(n.resolve,function(){B(),n.reject()}):(B(),n.reject())}else n.reject();return n.promise()}function z(e){if(n(jt))return jt.then(function(){return z(e)});if(!e){if(n(Ut))return Ut;Ut=new $.Deferred,Ut.always(function(){Ut=null})}return x().done(function(e){var t,n=e&&q(e)||(new $.Deferred).reject();e&&!e._masterEditor&&(t=wt.getWorkingSet(wt.ALL_PANES).length,wt.addToWorkingSet(wt.ACTIVE_PANE,e.file),t||wt._edit(wt.ACTIVE_PANE,e)),n.done(function(){H(e)}).fail(function(){V()})}),Ut.promise()}function G(){var e=s(vt.getActiveEditor());e&&e.updateHighlight&&e.updateHighlight()}function K(){Dt.connected()&&Pt.highlight&&Pt.highlight.hide()}function X(){Dt.connected()&&Pt.highlight&&Pt.highlight.redraw()}function Y(){var e=i();if(e&&Dt.connected()){var n=Bt&&Bt.pathToUrl(e.file.fullPath),r=Pt.network&&Pt.network.wasURLRequested(n),o=t.config.experimental||Bt&&Bt.canServe(e.file.fullPath);!r&&o?(p(lt),h(),g(e),Dt.Page.navigate(n).then(function(){p(ut)},function(){M(!1,"closed_unknown_reason")})):r&&G()}}function Q(e,t){if(Dt.connected()&&Bt){var n=t.file.fullPath,r=n&&Bt.get(n),i=r&&r.isLiveEditingEnabled&&r.isLiveEditingEnabled();if(!i){var o=Bt.pathToUrl(n),a=Pt.network&&Pt.network.wasURLRequested(o);a&&N()}}}function J(e,t){t&&Dt.connected()&&Bt&&Pt.network&&Pt.network.wasURLRequested(Bt.pathToUrl(t.file.fullPath))&&p(_(t)?dt:ut)}function Z(){return{baseUrl:It.getBaseUrl(),pathResolver:It.makeProjectRelativeIfPossible,root:It.getProjectRoot().fullPath}}function et(){return new Tt(Z())}function tt(){return new yt(Z())}function nt(e){t.config=e,$(Dt).on("error",b),$(Dt.Inspector).on("detached",R),$(Nt).on("styleSheetAdded.livedev",E),$(wt).on("currentFileChange",Y),$(gt).on("documentSaved",Q).on("dirtyFlagChange",J),$(It).on("beforeProjectClose beforeAppClose",P),Et.registerServer({create:et},99),Et.registerServer({create:tt},0),p(st)}function rt(){return Bt}function it(){return Bt&&Bt.getBaseUrl()}e("utils/Global");var ot=e("thirdparty/lodash"),at=t.STATUS_ERROR=-1,st=t.STATUS_INACTIVE=0,lt=t.STATUS_CONNECTING=1,ct=t.STATUS_LOADING_AGENTS=2,ut=t.STATUS_ACTIVE=3,dt=t.STATUS_OUT_OF_SYNC=4,pt=t.STATUS_SYNC_ERROR=5,ft=e("utils/Async"),ht=e("widgets/Dialogs"),mt=e("widgets/DefaultDialogs"),gt=e("document/DocumentManager"),vt=e("editor/EditorManager"),yt=e("LiveDevelopment/Servers/FileServer").FileServer,_t=e("filesystem/FileSystemError"),bt=e("file/FileUtils"),Et=e("LiveDevelopment/LiveDevServerManager"),wt=e("view/MainViewManager"),St=e("utils/NativeApp"),Ct=e("preferences/PreferencesDialogs"),It=e("project/ProjectManager"),kt=e("strings"),xt=e("utils/StringUtils"),Tt=e("LiveDevelopment/Servers/UserServer").UserServer,Dt=e("LiveDevelopment/Inspector/Inspector"),Mt=e("LiveDevelopment/Documents/CSSDocument"),Ot=e("LiveDevelopment/Documents/CSSPreprocessorDocument"),Lt=e("LiveDevelopment/Documents/HTMLDocument"),Rt=e("LiveDevelopment/Documents/JSDocument"),At="live-preview-sync-error",Nt=e("LiveDevelopment/Agents/CSSAgent"),Pt={console:e("LiveDevelopment/Agents/ConsoleAgent"),remote:e("LiveDevelopment/Agents/RemoteAgent"),network:e("LiveDevelopment/Agents/NetworkAgent"),dom:e("LiveDevelopment/Agents/DOMAgent"),css:Nt,script:e("LiveDevelopment/Agents/ScriptAgent"),highlight:e("LiveDevelopment/Agents/HighlightAgent"),"goto":e("LiveDevelopment/Agents/GotoAgent"),edit:e("LiveDevelopment/Agents/EditAgent")},Ft=window.location.pathname;Ft=Ft.replace("/test/SpecRunner.html","/src/index.html"),Ft=Ft.substr(0,Ft.lastIndexOf("/"))+"/LiveDevelopment/launch.html",Ft=window.location.origin+Ft;var $t,Ut,jt,Vt,Bt,Wt={console:!0,remote:!0,network:!0,css:!0,highlight:!0},Ht=[],qt={};t.launcherUrl=Ft,t._getServer=rt,t._getInitialDocFromCurrent=x,t.agents=Pt,t.open=z,t.close=P,t.reconnect=A,t.reload=N,t.enableAgent=v,t.disableAgent=y,t.getLiveDocForPath=a,t.showHighlight=G,t.hideHighlight=K,t.redrawHighlight=X,t.init=nt,t.getCurrentProjectServerConfig=Z,t.getServerBaseUrl=it}),define("text!LiveDevelopment/main.less",[],function(){return'/*\n * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the "Software"), \n * to deal in the Software without restriction, including without limitation \n * the rights to use, copy, modify, merge, publish, distribute, sublicense, \n * and/or sell copies of the Software, and to permit persons to whom the \n * Software is furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \n * DEALINGS IN THE SOFTWARE.\n * \n */\n\n\n.CodeMirror {\n .highlight {\n background: #ecc;\n }\n .flash {\n -webkit-animation: flash 1s;\n }\n}\n \n@-webkit-keyframes flash {\n from {\n background: #ecc;\n }\n to {\n background: inherit;\n }\n}'}),define("LiveDevelopment/main",["require","exports","module","document/DocumentManager","command/Commands","utils/AppInit","LiveDevelopment/LiveDevelopment","LiveDevelopment/Inspector/Inspector","command/CommandManager","preferences/PreferencesManager","widgets/Dialogs","widgets/DefaultDialogs","utils/UrlParams","strings","utils/ExtensionUtils","utils/StringUtils","text!LiveDevelopment/main.less"],function(e,t,n){function r(){var t=e("text!LiveDevelopment/main.less"),n=new less.Parser;n.parse(t,function(e,t){console.assert(!e,e),I.addEmbeddedStyleSheet(t.toCSS())})}function i(e,t,n,r){$("span",e).remove(),e.removeClass(O),t&&t.length>0?$('<span class="label">').addClass(n).text(t).appendTo(e):e.addClass(n),r&&e.attr("title",r)}function o(){v.status>=v.STATUS_ACTIVE?v.close():v.status<=v.STATUS_INACTIVE&&(x.get("skipLiveDevelopmentInfo")||b.getViewState("livedev.afterFirstLaunch")?v.open():(b.setViewState("livedev.afterFirstLaunch","true"),E.showModalDialog(w.DIALOG_ID_INFO,C.LIVE_DEVELOPMENT_INFO_TITLE,C.LIVE_DEVELOPMENT_INFO_MESSAGE).done(function(){v.open()})))}function a(e){if(f.twipsy("hide").removeData("twipsy"),e&&"explicit_close"!==e){var t=C["LIVE_DEV_"+e.toUpperCase()];t||(t=k.format(C.LIVE_DEV_CLOSED_UNKNOWN_REASON,e));var n={placement:"left",trigger:"manual",autoHideDelay:5e3,title:function(){return t}};f.twipsy(n).twipsy("show")}}function s(){f=$("#toolbar-go-live"),f.click(function(){o()}),$(v).on("statusChange",function(e,t,n){i(f,null,M[t+1],D[t+1]),a(n),T.autoconnect&&window.sessionStorage.setItem("live.enabled",3===t)}),i(f,null,M[1],D[1])}function l(){$(v).on("statusChange",function(e,t){_.get(m.FILE_LIVE_FILE_PREVIEW).setChecked(t===v.STATUS_ACTIVE),_.get(m.FILE_LIVE_HIGHLIGHT).setEnabled(t===v.STATUS_ACTIVE)})}function c(){_.get(m.FILE_LIVE_HIGHLIGHT).setChecked(T.highlight)}function u(){T.highlight=!T.highlight,c(),T.highlight?v.showHighlight():v.hideHighlight(),b.setViewState("livedev.highlight",T.highlight)}function d(){window.ld=v,window.i=y,window.report=function(e){window.params=e,console.info(e)}}function p(){v.status>=v.STATUS_ACTIVE&&v.reload()}var f,h=e("document/DocumentManager"),m=e("command/Commands"),g=e("utils/AppInit"),v=e("LiveDevelopment/LiveDevelopment"),y=e("LiveDevelopment/Inspector/Inspector"),_=e("command/CommandManager"),b=e("preferences/PreferencesManager"),E=e("widgets/Dialogs"),w=e("widgets/DefaultDialogs"),S=e("utils/UrlParams").UrlParams,C=e("strings"),I=e("utils/ExtensionUtils"),k=e("utils/StringUtils"),x=new S,T={experimental:!1,debug:!0,autoconnect:!1,highlight:!0,highlightConfig:{borderColor:{r:255,g:229,b:153,a:.66},contentColor:{r:111,g:168,b:220,a:.55},marginColor:{r:246,g:178,b:107,a:.66},paddingColor:{r:147,g:196,b:125,a:.66},showInfo:!0}},D=[C.LIVE_DEV_STATUS_TIP_NOT_CONNECTED,C.LIVE_DEV_STATUS_TIP_NOT_CONNECTED,C.LIVE_DEV_STATUS_TIP_PROGRESS1,C.LIVE_DEV_STATUS_TIP_PROGRESS2,C.LIVE_DEV_STATUS_TIP_CONNECTED,C.LIVE_DEV_STATUS_TIP_OUT_OF_SYNC,C.LIVE_DEV_STATUS_TIP_SYNC_ERROR],M=["warning","","info","info","success","out-of-sync","sync-error"],O=M.join(" ");g.appReady(function(){x.parse(),y.init(T),v.init(T),r(),s(),l(),c(),T.debug&&d(),T.autoconnect&&"true"===window.sessionStorage.getItem("live.enabled")&&h.getCurrentDocument()&&o(),$(window).focus(function(){y.connected()&&T.highlight&&v.redrawHighlight()})}),b.stateManager.definePreference("livedev.highlight","boolean",!0).on("change",function(){T.highlight=b.getViewState("livedev.highlight"),c()}),b.convertPreferences(n,{highlight:"user livedev.highlight",afterFirstLaunch:"user livedev.afterFirstLaunch"},!0),T.highlight=b.getViewState("livedev.highlight"),_.register(C.CMD_LIVE_FILE_PREVIEW,m.FILE_LIVE_FILE_PREVIEW,o),_.register(C.CMD_LIVE_HIGHLIGHT,m.FILE_LIVE_HIGHLIGHT,u),_.register(C.CMD_RELOAD_LIVE_PREVIEW,m.CMD_RELOAD_LIVE_PREVIEW,p),_.get(m.FILE_LIVE_HIGHLIGHT).setEnabled(!1)}),define("utils/NodeDomain",["require","exports","module","utils/NodeConnection"],function(e,t,n){function r(e,t){var n=new i;this.connection=n,this._domainName=e,this._domainPath=t,this._domainLoaded=!1,this._load=this._load.bind(this),this._connectionPromise=n.connect(!0).then(this._load),$(n).on("close",function(e,t){$(this.connection).off(o),this._domainLoaded=!1,this._connectionPromise=t.then(this._load)}.bind(this))}var i=e("utils/NodeConnection"),o=".NodeDomainEvent";r.prototype.connection=null,r.prototype._connectionPromise=null,r.prototype._domainName=null,r.prototype._domainPath=null,r.prototype._domainLoaded=!1,r.prototype._load=function(){var e=this.connection;return e.loadDomains(this._domainPath,!0).done(function(){this._domainLoaded=!0,this._connectionPromise=null;var t=Object.keys(e.domainEvents[this._domainName]);t.forEach(function(t){var n=this._domainName+":"+t+o;$(e).on(n,function(){var e=Array.prototype.slice.call(arguments,1);$(this).triggerHandler(t,e)}.bind(this))},this)}.bind(this)).fail(function(e){console.error('[NodeDomain] Error loading domain "'+this._domainName+'": '+e)}.bind(this))},r.prototype.ready=function(){return this._domainLoaded&&this.connection.connected()},r.prototype.promise=function(){if(this._connectionPromise)return this._connectionPromise;var e=new $.Deferred;return this.ready()?e.resolve():e.reject(),e.promise()},r.prototype.exec=function(e){var t,n=this.connection,r=Array.prototype.slice.call(arguments,1),i=function(){var t,i=n.domains[this._domainName],o=i&&i[e];return t=o?o.apply(i,r):(new $.Deferred).reject().promise()}.bind(this);return t=this.ready()?i():this._connectionPromise?this._connectionPromise.then(i):(new $.Deferred.reject).promise()},n.exports=r}),define("utils/ColorUtils",["require","exports","module"],function(e,t){var n=/#[a-f0-9]{6}\b|#[a-f0-9]{3}\b|\brgb\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*\)|\brgb\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*\)|\brgba\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\brgba\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\bhsl\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*\)|\bhsla\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\baliceblue\b|\bantiquewhite\b|\baqua\b|\baquamarine\b|\bazure\b|\bbeige\b|\bbisque\b|\bblack\b|\bblanchedalmond\b|\bblue\b|\bblueviolet\b|\bbrown\b|\bburlywood\b|\bcadetblue\b|\bchartreuse\b|\bchocolate\b|\bcoral\b|\bcornflowerblue\b|\bcornsilk\b|\bcrimson\b|\bcyan\b|\bdarkblue\b|\bdarkcyan\b|\bdarkgoldenrod\b|\bdarkgray\b|\bdarkgreen\b|\bdarkgrey\b|\bdarkkhaki\b|\bdarkmagenta\b|\bdarkolivegreen\b|\bdarkorange\b|\bdarkorchid\b|\bdarkred\b|\bdarksalmon\b|\bdarkseagreen\b|\bdarkslateblue\b|\bdarkslategray\b|\bdarkslategrey\b|\bdarkturquoise\b|\bdarkviolet\b|\bdeeppink\b|\bdeepskyblue\b|\bdimgray\b|\bdimgrey\b|\bdodgerblue\b|\bfirebrick\b|\bfloralwhite\b|\bforestgreen\b|\bfuchsia\b|\bgainsboro\b|\bghostwhite\b|\bgold\b|\bgoldenrod\b|\bgray\b|\bgreen\b|\bgreenyellow\b|\bgrey\b|\bhoneydew\b|\bhotpink\b|\bindianred\b|\bindigo\b|\bivory\b|\bkhaki\b|\blavender\b|\blavenderblush\b|\blawngreen\b|\blemonchiffon\b|\blightblue\b|\blightcoral\b|\blightcyan\b|\blightgoldenrodyellow\b|\blightgray\b|\blightgreen\b|\blightgrey\b|\blightpink\b|\blightsalmon\b|\blightseagreen\b|\blightskyblue\b|\blightslategray\b|\blightslategrey\b|\blightsteelblue\b|\blightyellow\b|\blime\b|\blimegreen\b|\blinen\b|\bmagenta\b|\bmaroon\b|\bmediumaquamarine\b|\bmediumblue\b|\bmediumorchid\b|\bmediumpurple\b|\bmediumseagreen\b|\bmediumslateblue\b|\bmediumspringgreen\b|\bmediumturquoise\b|\bmediumvioletred\b|\bmidnightblue\b|\bmintcream\b|\bmistyrose\b|\bmoccasin\b|\bnavajowhite\b|\bnavy\b|\boldlace\b|\bolive\b|\bolivedrab\b|\borange\b|\borangered\b|\borchid\b|\bpalegoldenrod\b|\bpalegreen\b|\bpaleturquoise\b|\bpalevioletred\b|\bpapayawhip\b|\bpeachpuff\b|\bperu\b|\bpink\b|\bplum\b|\bpowderblue\b|\bpurple\b|\bred\b|\brosybrown\b|\broyalblue\b|\bsaddlebrown\b|\bsalmon\b|\bsandybrown\b|\bseagreen\b|\bseashell\b|\bsienna\b|\bsilver\b|\bskyblue\b|\bslateblue\b|\bslategray\b|\bslategrey\b|\bsnow\b|\bspringgreen\b|\bsteelblue\b|\btan\b|\bteal\b|\bthistle\b|\btomato\b|\bturquoise\b|\bviolet\b|\bwheat\b|\bwhite\b|\bwhitesmoke\b|\byellow\b|\byellowgreen\b/gi;t.COLOR_REGEX=n}),define("command/DefaultMenus",["require","exports","module","utils/AppInit","command/Commands","editor/EditorManager","command/Menus","strings"],function(e){var t=e("utils/AppInit"),n=e("command/Commands"),r=e("editor/EditorManager"),i=e("command/Menus"),o=e("strings");t.htmlReady(function(){var e;e=i.addMenu(o.FILE_MENU,i.AppMenuBar.FILE_MENU),e.addMenuItem(n.FILE_NEW_UNTITLED),e.addMenuItem(n.FILE_OPEN),e.addMenuItem(n.FILE_OPEN_FOLDER),e.addMenuItem(n.FILE_CLOSE),e.addMenuItem(n.FILE_CLOSE_ALL),e.addMenuDivider(),e.addMenuItem(n.FILE_SAVE),e.addMenuItem(n.FILE_SAVE_ALL),e.addMenuItem(n.FILE_SAVE_AS),e.addMenuDivider(),e.addMenuItem(n.FILE_LIVE_FILE_PREVIEW),e.addMenuItem(n.FILE_PROJECT_SETTINGS),e.addMenuDivider(),e.addMenuItem(n.FILE_EXTENSION_MANAGER),e=i.addMenu(o.EDIT_MENU,i.AppMenuBar.EDIT_MENU),e.addMenuItem(n.EDIT_UNDO),e.addMenuItem(n.EDIT_REDO),e.addMenuDivider(),brackets.nativeMenus&&(e.addMenuItem(n.EDIT_CUT),e.addMenuItem(n.EDIT_COPY),e.addMenuItem(n.EDIT_PASTE),e.addMenuDivider()),e.addMenuItem(n.EDIT_SELECT_ALL),e.addMenuItem(n.EDIT_SELECT_LINE),e.addMenuItem(n.EDIT_SPLIT_SEL_INTO_LINES),e.addMenuItem(n.EDIT_ADD_CUR_TO_PREV_LINE),e.addMenuItem(n.EDIT_ADD_CUR_TO_NEXT_LINE),e.addMenuDivider(),e.addMenuItem(n.EDIT_INDENT),e.addMenuItem(n.EDIT_UNINDENT),e.addMenuItem(n.EDIT_DUPLICATE),e.addMenuItem(n.EDIT_DELETE_LINES),e.addMenuItem(n.EDIT_LINE_UP),e.addMenuItem(n.EDIT_LINE_DOWN),e.addMenuDivider(),e.addMenuItem(n.EDIT_LINE_COMMENT),e.addMenuItem(n.EDIT_BLOCK_COMMENT),e.addMenuDivider(),e.addMenuItem(n.SHOW_CODE_HINTS),e.addMenuDivider(),e.addMenuItem(n.TOGGLE_CLOSE_BRACKETS),e=i.addMenu(o.FIND_MENU,i.AppMenuBar.FIND_MENU),e.addMenuItem(n.CMD_FIND),e.addMenuItem(n.CMD_FIND_NEXT),e.addMenuItem(n.CMD_FIND_PREVIOUS),e.addMenuItem(n.CMD_FIND_ALL_AND_SELECT),e.addMenuItem(n.CMD_ADD_NEXT_MATCH),e.addMenuItem(n.CMD_SKIP_CURRENT_MATCH),e.addMenuDivider(),e.addMenuItem(n.CMD_FIND_IN_FILES),e.addMenuItem(n.CMD_FIND_IN_SELECTED),e.addMenuDivider(),e.addMenuItem(n.CMD_REPLACE),e.addMenuItem(n.CMD_REPLACE_IN_FILES),e.addMenuItem(n.CMD_REPLACE_IN_SELECTED),e=i.addMenu(o.VIEW_MENU,i.AppMenuBar.VIEW_MENU),e.addMenuItem(n.CMD_THEMES_OPEN_SETTINGS),e.addMenuDivider(),e.addMenuItem(n.CMD_SPLITVIEW_NONE),e.addMenuItem(n.CMD_SPLITVIEW_VERTICAL),e.addMenuItem(n.CMD_SPLITVIEW_HORIZONTAL),e.addMenuDivider(),e.addMenuItem(n.VIEW_HIDE_SIDEBAR),e.addMenuDivider(),e.addMenuItem(n.VIEW_INCREASE_FONT_SIZE),e.addMenuItem(n.VIEW_DECREASE_FONT_SIZE),e.addMenuItem(n.VIEW_RESTORE_FONT_SIZE),e.addMenuDivider(),e.addMenuItem(n.TOGGLE_ACTIVE_LINE),e.addMenuItem(n.TOGGLE_LINE_NUMBERS),e.addMenuItem(n.TOGGLE_WORD_WRAP),e.addMenuDivider(),e.addMenuItem(n.FILE_LIVE_HIGHLIGHT),e.addMenuDivider(),e.addMenuItem(n.VIEW_TOGGLE_INSPECTION),e=i.addMenu(o.NAVIGATE_MENU,i.AppMenuBar.NAVIGATE_MENU),e.addMenuItem(n.NAVIGATE_QUICK_OPEN),e.addMenuItem(n.NAVIGATE_GOTO_LINE),e.addMenuItem(n.NAVIGATE_GOTO_DEFINITION),e.addMenuItem(n.NAVIGATE_JUMPTO_DEFINITION),e.addMenuItem(n.NAVIGATE_GOTO_FIRST_PROBLEM),e.addMenuDivider(),e.addMenuItem(n.NAVIGATE_NEXT_DOC),e.addMenuItem(n.NAVIGATE_PREV_DOC),e.addMenuDivider(),e.addMenuItem(n.NAVIGATE_SHOW_IN_FILE_TREE),e.addMenuDivider(),e.addMenuItem(n.TOGGLE_QUICK_EDIT),e.addMenuItem(n.QUICK_EDIT_PREV_MATCH),e.addMenuItem(n.QUICK_EDIT_NEXT_MATCH),e.addMenuItem(n.CSS_QUICK_EDIT_NEW_RULE),e.addMenuDivider(),e.addMenuItem(n.TOGGLE_QUICK_DOCS),e=i.addMenu(o.HELP_MENU,i.AppMenuBar.HELP_MENU),e.addMenuItem(n.HELP_CHECK_FOR_UPDATE),e.addMenuDivider(),brackets.config.how_to_use_url&&e.addMenuItem(n.HELP_HOW_TO_USE_BRACKETS),brackets.config.support_url&&e.addMenuItem(n.HELP_SUPPORT),brackets.config.suggest_feature_url&&e.addMenuItem(n.HELP_SUGGEST),brackets.config.release_notes_url&&e.addMenuItem(n.HELP_RELEASE_NOTES),brackets.config.get_involved_url&&e.addMenuItem(n.HELP_GET_INVOLVED);var t="mac"!==brackets.platform||!brackets.nativeMenus;(t||brackets.config.homepage_url||brackets.config.twitter_url)&&e.addMenuDivider(),brackets.config.homepage_url&&e.addMenuItem(n.HELP_HOMEPAGE),brackets.config.twitter_url&&e.addMenuItem(n.HELP_TWITTER),t&&e.addMenuItem(n.HELP_ABOUT);var a=i.registerContextMenu(i.ContextMenuIds.WORKING_SET_CONTEXT_MENU);a.addMenuItem(n.FILE_SAVE),a.addMenuItem(n.FILE_SAVE_AS),a.addMenuItem(n.FILE_RENAME),a.addMenuItem(n.NAVIGATE_SHOW_IN_FILE_TREE),a.addMenuItem(n.NAVIGATE_SHOW_IN_OS),a.addMenuDivider(),a.addMenuItem(n.CMD_FIND_IN_SUBTREE),a.addMenuItem(n.CMD_REPLACE_IN_SUBTREE),a.addMenuDivider(),a.addMenuItem(n.FILE_CLOSE);var s=i.registerContextMenu(i.ContextMenuIds.WORKING_SET_CONFIG_MENU);s.addMenuItem(n.CMD_WORKINGSET_SORT_BY_ADDED),s.addMenuItem(n.CMD_WORKINGSET_SORT_BY_NAME),s.addMenuItem(n.CMD_WORKINGSET_SORT_BY_TYPE),s.addMenuDivider(),s.addMenuItem(n.CMD_WORKING_SORT_TOGGLE_AUTO);var l=i.registerContextMenu(i.ContextMenuIds.SPLITVIEW_MENU);l.addMenuItem(n.CMD_SPLITVIEW_NONE),l.addMenuItem(n.CMD_SPLITVIEW_VERTICAL),l.addMenuItem(n.CMD_SPLITVIEW_HORIZONTAL);var c=i.registerContextMenu(i.ContextMenuIds.PROJECT_MENU);c.addMenuItem(n.FILE_NEW),c.addMenuItem(n.FILE_NEW_FOLDER),c.addMenuItem(n.FILE_RENAME),c.addMenuItem(n.FILE_DELETE),c.addMenuItem(n.NAVIGATE_SHOW_IN_OS),c.addMenuDivider(),c.addMenuItem(n.CMD_FIND_IN_SUBTREE),c.addMenuItem(n.CMD_REPLACE_IN_SUBTREE),c.addMenuDivider(),c.addMenuItem(n.FILE_REFRESH);var u=i.registerContextMenu(i.ContextMenuIds.EDITOR_MENU);u.addMenuItem(n.TOGGLE_QUICK_EDIT),u.addMenuItem(n.TOGGLE_QUICK_DOCS),u.addMenuItem(n.EDIT_SELECT_ALL);var d=i.registerContextMenu(i.ContextMenuIds.INLINE_EDITOR_MENU);d.addMenuItem(n.TOGGLE_QUICK_EDIT),d.addMenuItem(n.EDIT_SELECT_ALL),d.addMenuDivider(),d.addMenuItem(n.QUICK_EDIT_PREV_MATCH),d.addMenuItem(n.QUICK_EDIT_NEXT_MATCH),$("#editor-holder").on("contextmenu",function(e){if(0===$(e.target).parents(".CodeMirror-gutter").length){var t=r.getFocusedEditor(),n=r.getFocusedInlineWidget();t&&(t.hasSelection()||t.selectWordAt(t.getCursorPos()),n?d.open(e):u.open(e))}}),$("#project-files-container").on("contextmenu",function(e){c.open(e)}),i.ContextMenu.assignContextMenuToSelector(".working-set-option-btn",s),i.ContextMenu.assignContextMenuToSelector(".working-set-splitview-btn",l),$(window).contextmenu(function(e){e.preventDefault()}),$(window.document).on("mousedown",".dropdown",function(e){e.preventDefault()}),$(window.document).on("mouseenter","#titlebar .dropdown",function(){var e=$(this).siblings(".open");e.length>0&&(e.removeClass("open"),$(this).addClass("open"))})})}),define("editor/EditorStatusBar",["require","exports","module","thirdparty/lodash","utils/AnimationUtils","utils/AppInit","widgets/DropdownButton","editor/EditorManager","view/MainViewManager","editor/Editor","file/FileUtils","utils/KeyEvent","language/LanguageManager","preferences/PreferencesManager","widgets/StatusBar","strings","utils/StringUtils"],function(e){function t(e,t,n){return P.format(e>1?n:t,e)}function n(e){var t=e.document,n=t.getLanguage();g.$button.css("width","auto"),g.$button.prop("disabled",t.isUntitled()),g.$button.text(n.getName())}function r(e){var n=e.lineCount();y.text(t(n,N.STATUSBAR_LINE_COUNT_SINGULAR,N.STATUSBAR_LINE_COUNT_PLURAL))}function i(e){var t=D.getUseTabChar(e);_.text(t?N.STATUSBAR_TAB_SIZE:N.STATUSBAR_SPACES),_.attr("title",t?N.STATUSBAR_INDENT_TOOLTIP_SPACES:N.STATUSBAR_INDENT_TOOLTIP_TABS),b.attr("title",t?N.STATUSBAR_INDENT_SIZE_TOOLTIP_TABS:N.STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES)}function o(e){return D.getUseTabChar(e)?D.getTabSize(e):D.getSpaceUnits(e)}function a(e){var t=o(e);b.text(t),E.val(t)}function s(){var e=x.getActiveEditor(),t=e&&e.document.file.fullPath;D.setUseTabChar(!D.getUseTabChar(t),t),i(t),a(t)}function l(e,n){n=n||x.getActiveEditor();var r=n.getCursorPos(!0),i=P.format(N.STATUSBAR_CURSOR_POSITION,r.line+1,r.ch+1),o=n.getSelections(),a="";if(o.length>1)a=P.format(N.STATUSBAR_SELECTION_MULTIPLE,o.length);else if(n.hasSelection()){var s=o[0];if(s.start.line!==s.end.line){var l=s.end.line-s.start.line+1;0===s.end.ch&&l--,a=t(l,N.STATUSBAR_SELECTION_LINE_SINGULAR,N.STATUSBAR_SELECTION_LINE_PLURAL)}else{var c=n.getColOffset(s.end)-n.getColOffset(s.start);a=t(c,N.STATUSBAR_SELECTION_CH_SINGULAR,N.STATUSBAR_SELECTION_CH_PLURAL)}}v.text(i+a)}function c(e,t){b.removeClass("hidden"),E.addClass("hidden"),E.off("blur keyup"),T.focusActivePane();var n=parseInt(t,10);if(D.getUseTabChar(e)){if(!D.setTabSize(n,e))return}else if(!D.setSpaceUnits(n,e))return;a(e),l()}function u(e,t,n,r){w.text()!==(n?N.STATUSBAR_OVERWRITE:N.STATUSBAR_INSERT)&&(w.text(n?N.STATUSBAR_OVERWRITE:N.STATUSBAR_INSERT),r||C.animateUsingClass(w[0],"flash",1500))}function d(e){var t=x.getActiveEditor(),n=!t._codeMirror.state.overwrite;u(e,t,n,!0),t.toggleOverwrite(n)}function p(e){e.toggleOverwrite(w.text()===N.STATUSBAR_OVERWRITE),w.attr("title",N.STATUSBAR_INSOVR_TOOLTIP)}function f(e,t,o){if(o&&($(o).off(".statusbar"),$(o.document).off(".statusbar"),o.document.releaseRef()),t){var s=t.document.file.fullPath;A.showAllPanes(),$(t).on("cursorActivity.statusbar",l),$(t).on("optionChange.statusbar",function(){i(s),a(s)}),$(t).on("change.statusbar",function(){window.setTimeout(function(){r(t)},0)}),$(t).on("overwriteToggle.statusbar",u),t.document.addRef(),$(t.document).on("languageChanged.statusbar",function(){n(t)}),l(null,t),n(t),r(t),p(t),i(s),a(s)}else A.hideAllPanes()}function h(){var e=S.values(L.getLanguages()).filter(function(e){return!e.isBinary()});e.sort(function(e,t){return e.getName().toLowerCase().localeCompare(t.getName().toLowerCase())}),g.items=e,g.items.unshift("---"),g.items.unshift(F)}function m(){v=$("#status-cursor"),y=$("#status-file"),_=$("#indent-type"),b=$("#indent-width-label"),E=$("#indent-width-input"),w=$("#status-overwrite"),g=new k("",[],function(e){var t=x.getActiveEditor().document,n=L.getLanguageForPath(t.file.fullPath,!0);if(e===F){var r=S.escape(P.format(N.STATUSBAR_SET_DEFAULT_LANG,M.getSmartFileExtension(t.file.fullPath)));return{html:r,enabled:t.getLanguage()!==n}}var i=S.escape(e.getName());return e===n&&(i+=" <span class='default-language'>"+N.STATUSBAR_DEFAULT_LANG+"</span>"),e===t.getLanguage()&&(i="<span class='checked-language'></span>"+i),i}),g.dropdownExtraClasses="dropdown-status-bar",g.$button.addClass("btn-status-bar"),$("#status-language").append(g.$button),g.$button.attr("title",N.STATUSBAR_LANG_TOOLTIP),_.on("click",s),b.on("click",function(){var e=x.getActiveEditor();E.val(o(e)),b.addClass("hidden"),E.removeClass("hidden"),E.focus(),E.on("blur",function(){c(e,E.val())}).on("keyup",function(t){t.keyCode===O.DOM_VK_RETURN?E.blur():t.keyCode===O.DOM_VK_ESCAPE&&c(e,!1)})}),E.focus(function(){E.select()}),$(g).on("select",function(e,t){var n=x.getActiveEditor().document,r=n.file.fullPath;if(t===F){var i=R.get("language.fileExtensions");i[M.getSmartFileExtension(r)]=n.getLanguage().getId(),R.set("language.fileExtensions",i)}else{var o=L.getLanguageForPath(r,!0);L.setLanguageOverrideForPath(r,t===o?null:t)}}),w.on("click",d)}var g,v,y,_,b,E,w,S=e("thirdparty/lodash"),C=e("utils/AnimationUtils"),I=e("utils/AppInit"),k=e("widgets/DropdownButton").DropdownButton,x=e("editor/EditorManager"),T=e("view/MainViewManager"),D=e("editor/Editor").Editor,M=e("file/FileUtils"),O=e("utils/KeyEvent"),L=e("language/LanguageManager"),R=e("preferences/PreferencesManager"),A=e("widgets/StatusBar"),N=e("strings"),P=e("utils/StringUtils"),F={};$(x).on("activeEditorChange",f),I.htmlReady(m),I.appReady(function(){h(),f(null,x.getActiveEditor(),null),A.show()})}),define("editor/EditorCommandHandlers",["require","exports","module","command/Commands","strings","command/CommandManager","editor/EditorManager","utils/StringUtils","utils/TokenUtils","thirdparty/CodeMirror2/lib/codemirror","thirdparty/lodash"],function(e){function t(e,t){var n,r,i=[],o="";for(n=e.length;n<t.length;n++)r=t.charAt(n),i.push(o+"[^"+F.regexEscape(r)+"]"),o&&i.push(o+"$"),o+=r;return new RegExp("^\\s*"+F.regexEscape(e)+"($|"+i.join("|")+")")}function n(e,n,r){var i,o,a=[];return e.forEach(function(e){i=F.regexEscape(e),o=!0,n&&0===n.indexOf(e)&&(a.push(t(e,n)),o=!1),r&&n!==r&&0===r.indexOf(e)&&(a.push(t(e,r)),o=!1),o&&a.push(new RegExp("^\\s*"+i))}),a}function r(e,t){return t.some(function(t){return e.match(t)})}function i(e,t,n){var r=null;return t.forEach(function(t,i){e.match(t)&&(r&&r.length<n[i].length||!r)&&(r=n[i])}),r}function o(e,t,n,i){var o,a,s=!1;for(o=t;n>=o;o++)if(a=e.document.getLine(o),a.match(/\S/)&&!r(a,i)){s=!0;break}return s}function a(e,t,r,a,s){var l=e.document,c=s.selectionForEdit,u=s.selectionsToTrack,d=n(t,r,a),p=c.start.line,f=c.end.line,h=[];0===c.end.ch&&f--;var m,g,v,y,_=o(e,p,f,d);if(_){for(m=p;f>=m;m++)h.push({text:t[0],start:{line:m,ch:0}});V.each(u,function(e){0===e.start.ch&&0!==j.cmpPos(e.start,e.end)?(e.start={line:e.start.line,ch:0},e.end={line:e.end.line,ch:e.end.line===f?e.end.ch+t[0].length:0}):e.isBeforeEdit=!0})}else{for(m=p;f>=m;m++)g=l.getLine(m),v=i(g,d,t),v&&(y=g.indexOf(v),h.push({text:"",start:{line:m,ch:y},end:{line:m,ch:y+v.length}}));V.each(u,function(e){e.isBeforeEdit=!0})}return{edit:h,selection:u}}function s(e,t,n,i,o,a){for(var l=U.moveSkippingWhitespace(U.movePrevToken,e);l&&r(e.token.string,a);)l=U.moveSkippingWhitespace(U.movePrevToken,e);return l&&"comment"===e.token.type?e.token.string.match(i)||e.token.string.match(o)?t===n&&e.token.string.length===t.length?!s(e,t,n,i,o,a):e.token.string.match(i):!0:!1}function l(e,t,i,a,l,c){var u,d,p,f,h,m,g=e.document,v=U.getInitialContext(e._codeMirror,{line:l.start.line,ch:l.start.ch}),y=e.indexFromPos(l.end),_=n(a,t,i),b=new RegExp("^"+F.regexEscape(t),"g"),E=new RegExp(F.regexEscape(i)+"$","g"),w=null,S=null,C=!0,I=!1,k=!1,x=!1,T=!1,D=!0,M=[];for(c||(c=[V.cloneDeep(l)]),v.token.type||/\S/.test(v.token.string)||(D=U.moveSkippingWhitespace(U.moveNextToken,v));D&&"comment"!==v.token.type;)D=U.moveSkippingWhitespace(U.moveNextToken,v)&&e.indexFromPos(v.pos)<=y,C=!1;if(D&&"comment"===v.token.type)if(r(v.token.string,_)?0===v.token.start&&!v.token.string.match(/^\\s*/)&&C?(d=U.getInitialContext(e._codeMirror,{line:v.pos.line,ch:v.token.start}),I=s(d,t,i,b,E,_)):I=!1:(I=!0,v.token.string===t&&t===i&&(d=U.getInitialContext(e._codeMirror,{line:v.pos.line,ch:v.token.start}),p=s(d,t,i,b,E,_),p?U.moveSkippingWhitespace(U.movePrevToken,v):U.moveSkippingWhitespace(U.moveNextToken,v))),I){for(h=V.cloneDeep(v.pos),D=!0;D&&!v.token.string.match(b);)D=U.moveSkippingWhitespace(U.movePrevToken,v);for(w=D&&{line:v.pos.line,ch:v.token.start},v.token.string===t&&t===i&&(v=U.getInitialContext(e._codeMirror,V.cloneDeep(h)));D&&!v.token.string.match(E);)D=U.moveSkippingWhitespace(U.moveNextToken,v);S=D&&{line:v.pos.line,ch:v.token.end-i.length};do D=U.moveSkippingWhitespace(U.moveNextToken,v)&&e.indexFromPos(v.pos)<=y;while(D&&!v.token.string.match(b));x=D&&!!v.token.string.match(b),f=S&&{line:S.line,ch:S.ch+i.length},(f&&j.cmpPos(l.start,f)>0||w&&j.cmpPos(l.end,w)<0)&&(k=!0)}else m=l.end.line,0===l.end.ch&&e.hasSelection()&&m--,o(e,l.start.line,m,_)?k=!0:T=!0;else k=!0;if(x)u={edit:[],selection:c};else if(T)u=null;else{if(k){var O=0===l.start.ch&&0===l.end.ch&&l.start.line<l.end.line;O?(M.push({text:i+"\n",start:l.end}),M.push({text:t+"\n",start:l.start})):(M.push({text:i,start:l.end}),M.push({text:t,start:l.start})),V.each(c,function(e){function n(e){j.cmpPos(e,l.end)>0&&(O?e.line++:e.line===l.end.line&&(e.ch+=i.length)),j.cmpPos(e,l.start)>=0&&(O?e.line++:e.line===l.start.line&&(e.ch+=t.length))}n(e.start),n(e.end)})}else{var L=g.getLine(w.line).trim(),R=0===w.ch&&t.length===L.length,A=!1;S&&(L=g.getLine(S.line).trim(),A=0===S.ch&&i.length===L.length),S&&M.push(R&&A?{text:"",start:S,end:{line:S.line+1,ch:0}}:{text:"",start:S,end:{line:S.line,ch:S.ch+i.length}}),M.push(R&&A?{text:"",start:w,end:{line:w.line+1,ch:0}}:{text:"",start:w,end:{line:w.line,ch:w.ch+t.length}}),V.each(c,function(e){e.isBeforeEdit=!0})}u={edit:M,selection:c}}return u}function c(e,t,n,r){var i=r.selectionForEdit;return i.end.line===i.start.line+1&&0===i.end.ch&&(i.end={line:i.start.line,ch:e.document.getLine(i.start.line).length}),l(e,t,n,[],i,r.selectionsToTrack)}function u(e,t){var n=e.convertToLineSelections(t,{mergeAdjacent:!1}),r=[];return V.each(n,function(t){var n,i=t.selectionForEdit,o=e.getModeForRange(i.start,i.end);if(o){var s=e.document.getLanguage().getLanguageForMode(o.name||o);s.hasLineCommentSyntax()?n=a(e,s.getLineCommentPrefixes(),s.getBlockCommentPrefix(),s.getBlockCommentSuffix(),t):s.hasBlockCommentSyntax()&&(n=c(e,s.getBlockCommentPrefix(),s.getBlockCommentSuffix(),t))}n||(n={selection:t.selectionsToTrack}),r.push(n)}),r}function d(e){e=e||P.getFocusedEditor(),e&&e.setSelections(e.document.doMultipleEdits(u(e,e.getSelections())))}function p(e){if(e=e||P.getFocusedEditor()){var t=[],n=[];V.each(e.getSelections(),function(r){var i=e.getModeForRange(r.start,r.end),o={edit:[],selection:[r]};if(i){var a=e.document.getLanguage().getLanguageForMode(i.name||i);a.hasBlockCommentSyntax()&&(o=l(e,a.getBlockCommentPrefix(),a.getBlockCommentSuffix(),a.getLineCommentPrefixes(),r),o||n.push(r))}o&&t.push(o)}),t.push.apply(t,u(e,n)),e.setSelections(e.document.doMultipleEdits(t))}}function f(e){if(e=e||P.getFocusedEditor()){var t=e.getSelections(),n="",r=[],i=[],o=[],a=e.document;V.each(t,function(e){0===j.cmpPos(e.start,e.end)?o.push(e):i.push(e)});var s=e.convertToLineSelections(o);V.each(s,function(t){var i=t.selectionForEdit;i.end.line===e.lineCount()&&(n="\n"),r.push({edit:{text:a.getRange(i.start,i.end)+n,start:i.start}})
34}),V.each(i,function(e){r.push({edit:{text:a.getRange(e.start,e.end),start:e.start}})}),a.doMultipleEdits(r)}}function h(e){if(e=e||P.getFocusedEditor()){var t,n,r=e.document,i=e.convertToLineSelections(e.getSelections()),o=[];V.each(i,function(i){var a=i.selectionForEdit;t=a.start,n=a.end,n.line===e.getLastVisibleLine()+1&&(t.line>e.getFirstVisibleLine()&&(t.line-=1,t.ch=r.getLine(t.line).length),n.line-=1,n.ch=r.getLine(n.line).length),o.push({edit:{text:"",start:t,end:n}})}),r.doMultipleEdits(o)}}function m(e,t){if(e=e||P.getFocusedEditor()){var n=e.document,r=e.convertToLineSelections(e.getSelections()),i=!!P.getFocusedInlineWidget(),o=e.getFirstVisibleLine(),a=e.getLastVisibleLine(),s=e.lineCount(),l=0,c=[],u=[],d={};V.each(r,function(e){var r=e.selectionForEdit,u=[];switch(t){case B:if(r.start.line!==o){var d=n.getRange({line:r.start.line-1,ch:0},r.start);r.end.line===a+1&&(i?(d=d.substring(0,d.length-1),l=n.getLine(r.end.line-1).length,u.push({text:"\n",start:{line:r.end.line-1,ch:l}})):d="\n"+d.substring(0,d.length-1)),u.push({text:"",start:{line:r.start.line-1,ch:0},end:r.start}),u.push({text:d,start:{line:r.end.line-1,ch:0}}),V.each(e.selectionsToTrack,function(e){e.start.line--,e.end.line--}),c.push({edit:u,selection:e.selectionsToTrack})}break;case W:if(r.end.line<=a){var p=n.getRange(r.end,{line:r.end.line+1,ch:0}),f=r.end;r.end.line===a&&(i?(r.end.line===s-1&&(p+="\n"),l=n.getLine(r.end.line-1).length,u.push({text:"\n",start:{line:r.end.line,ch:n.getLine(r.end.line).length}})):(p+="\n",f={line:r.end.line-1,ch:n.getLine(r.end.line-1).length})),u.push({text:"",start:f,end:{line:r.end.line+1,ch:0}}),l&&u.push({text:"",start:{line:r.end.line-1,ch:l},end:{line:r.end.line,ch:0}}),u.push({text:p,start:{line:r.start.line,ch:0}}),c.push({edit:u})}}}),c.length&&(u=n.doMultipleEdits(c),d.ch=0,t===B?(e.setSelections(u),d.line=e.getSelection().start.line):t===W?d.line=e.getSelection().end.line:(console.error("EditorCommandHandler.moveLine() called with invalid argument 'direction' = %d",t),d=null),e._codeMirror.scrollIntoView(d))}}function g(e){m(e,B)}function v(e){m(e,W)}function y(e,t){if(e=e||P.getFocusedEditor()){var n,r,i=e.getSelections(),o=!!P.getFocusedInlineWidget(),a=e.getLastVisibleLine(),s=e.document,l=[];s.batchOperation(function(){V.each(i,function(e,n){if(0===n||t===B&&e.start.line>i[n-1].start.line||t===W&&e.end.line>i[n-1].end.line){switch(t){case B:r=e.start.line;break;case W:r=e.end.line,(0===j.cmpPos(e.start,e.end)||0!==e.end.ch)&&r++}var c;c=r>a&&o?{line:r-1,ch:s.getLine(r-1).length}:{line:r,ch:0},l.push({edit:{text:"\n",start:c},selection:{start:c,end:c,primary:e.primary}})}else e.primary&&(l[l.length-1].selections[0].primary=!0)}),n=s.doMultipleEdits(l,"+input"),V.each(n,function(e){s._masterEditor._codeMirror.indentLine(e.start.line,"smart",!0),e.start.ch=null,e.end=e.start})}),e.setSelections(n)}}function _(e){y(e,B)}function b(e){y(e,W)}function E(){var e=P.getFocusedEditor();e&&e._codeMirror.execCommand("indentMore")}function w(){var e=P.getFocusedEditor();e&&e._codeMirror.execCommand("indentLess")}function S(e){e=e||P.getFocusedEditor(),e&&e.setSelections(V.pluck(e.convertToLineSelections(e.getSelections(),{expandEndAtStartOfLine:!0}),"selectionForEdit"))}function C(e){e=e||P.getFocusedEditor(),e&&e._codeMirror.execCommand("splitSelectionByLine")}function I(e,t){if(e=e||P.getFocusedEditor()){var n=e.getSelections(),r=[];V.each(n,function(n){var i,o;(-1===t&&n.start.line>e.getFirstVisibleLine()||1===t&&n.end.line<e.getLastVisibleLine())&&(i=V.clone(-1===t?n.start:n.end),o=e.getColOffset(i),i.line+=t,i.ch=e.getCharIndexForColumn(i.line,o),r.push({start:i,end:i,primary:n.primary}),n.primary=!1)}),e.setSelections(n.concat(r))}}function k(e){I(e,-1)}function x(e){I(e,1)}function T(e){var t=P.getFocusedEditor(),n=new $.Deferred;return t?(t[e](),n.resolve()):n.reject(),n.promise()}function D(){return T("undo")}function M(){return T("redo")}function O(){return(new $.Deferred).reject().promise()}function L(){var e=new $.Deferred,t=P.getFocusedEditor();return t?(t.selectAllNoScroll(),e.resolve()):e.reject(),e.promise()}var R=e("command/Commands"),A=e("strings"),N=e("command/CommandManager"),P=e("editor/EditorManager"),F=e("utils/StringUtils"),U=e("utils/TokenUtils"),j=e("thirdparty/CodeMirror2/lib/codemirror"),V=e("thirdparty/lodash"),B=-1,W=1;N.register(A.CMD_INDENT,R.EDIT_INDENT,E),N.register(A.CMD_UNINDENT,R.EDIT_UNINDENT,w),N.register(A.CMD_COMMENT,R.EDIT_LINE_COMMENT,d),N.register(A.CMD_BLOCK_COMMENT,R.EDIT_BLOCK_COMMENT,p),N.register(A.CMD_DUPLICATE,R.EDIT_DUPLICATE,f),N.register(A.CMD_DELETE_LINES,R.EDIT_DELETE_LINES,h),N.register(A.CMD_LINE_UP,R.EDIT_LINE_UP,g),N.register(A.CMD_LINE_DOWN,R.EDIT_LINE_DOWN,v),N.register(A.CMD_OPEN_LINE_ABOVE,R.EDIT_OPEN_LINE_ABOVE,_),N.register(A.CMD_OPEN_LINE_BELOW,R.EDIT_OPEN_LINE_BELOW,b),N.register(A.CMD_SELECT_LINE,R.EDIT_SELECT_LINE,S),N.register(A.CMD_SPLIT_SEL_INTO_LINES,R.EDIT_SPLIT_SEL_INTO_LINES,C),N.register(A.CMD_ADD_CUR_TO_NEXT_LINE,R.EDIT_ADD_CUR_TO_NEXT_LINE,x),N.register(A.CMD_ADD_CUR_TO_PREV_LINE,R.EDIT_ADD_CUR_TO_PREV_LINE,k),N.register(A.CMD_UNDO,R.EDIT_UNDO,D),N.register(A.CMD_REDO,R.EDIT_REDO,M),N.register(A.CMD_CUT,R.EDIT_CUT,O),N.register(A.CMD_COPY,R.EDIT_COPY,O),N.register(A.CMD_PASTE,R.EDIT_PASTE,O),N.register(A.CMD_SELECT_ALL,R.EDIT_SELECT_ALL,L)}),define("editor/EditorOptionHandlers",["require","exports","module","utils/AppInit","editor/Editor","command/Commands","command/CommandManager","preferences/PreferencesManager","strings","thirdparty/lodash"],function(e){function t(e){var t=m[e];t&&s.get(t).setChecked(l.get(e))}function n(e){return function(){l.set(e,!l.get(e))}}function r(){u.each(m,function(e,t){s.get(e).setChecked(l.get(t))}),o.getShowLineNumbers()||o._toggleLinePadding(!0)}var i=e("utils/AppInit"),o=e("editor/Editor").Editor,a=e("command/Commands"),s=e("command/CommandManager"),l=e("preferences/PreferencesManager"),c=e("strings"),u=e("thirdparty/lodash"),d="showLineNumbers",p="styleActiveLine",f="wordWrap",h="closeBrackets",m={};m[d]=a.TOGGLE_LINE_NUMBERS,m[p]=a.TOGGLE_ACTIVE_LINE,m[f]=a.TOGGLE_WORD_WRAP,m[h]=a.TOGGLE_CLOSE_BRACKETS,Object.keys(m).forEach(function(e){l.on("change",e,function(){t(e)})}),s.register(c.CMD_TOGGLE_LINE_NUMBERS,a.TOGGLE_LINE_NUMBERS,n(d)),s.register(c.CMD_TOGGLE_ACTIVE_LINE,a.TOGGLE_ACTIVE_LINE,n(p)),s.register(c.CMD_TOGGLE_WORD_WRAP,a.TOGGLE_WORD_WRAP,n(f)),s.register(c.CMD_TOGGLE_CLOSE_BRACKETS,a.TOGGLE_CLOSE_BRACKETS,n(h)),i.htmlReady(r)}),define("utils/BuildInfoUtils",["require","exports","module","filesystem/FileSystem","file/FileUtils","utils/Global"],function(e,t){function n(e,t){var r=new $.Deferred;if(brackets.inBrowser)r.reject();else{var a=i.getFileForPath(e);o.readAsText(a).done(function(i){if(0===i.indexOf("ref: ")){var o=e.substr(0,e.lastIndexOf("/")),a=i.substr(5).trim(),s=i.substr(16).trim();n(o+"/"+a,t).done(function(e){r.resolve({branch:s,sha:e.sha.trim()})}).fail(function(){r.resolve({branch:s})})}else r.resolve({sha:i})}).fail(function(){r.reject()})}return r.promise()}function r(){var e=new $.Deferred,t=o.getNativeBracketsDirectoryPath(),r=t.substr(0,t.lastIndexOf("/"))+"/.git/HEAD";return n(r).done(function(t){e.resolve(t.branch,t.sha,!0)}).fail(function(){e.resolve(brackets.metadata.repository.branch,brackets.metadata.repository.SHA,!1)}),e.promise()}var i=e("filesystem/FileSystem"),o=e("file/FileUtils");e("utils/Global"),t.getBracketsSHA=r}),define("text!htmlContent/about-dialog.html",[],function(){return'<div class="about-dialog modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{Strings.ABOUT}}</h1>\n </div>\n <div class="modal-body no-padding">\n <img class="about-icon" src="{{ABOUT_ICON}}">\n <div class="about-text">\n <h2>{{APP_NAME_ABOUT_BOX}}</h2>\n <div class="about-info">\n <p class="dialog-message">{{Strings.ABOUT_TEXT_LINE1}} <span id="about-build-number">{{BUILD_INFO}}</span>\n {{#BUILD_TIMESTAMP}}\n <br><span class="dialog-message">{{Strings.ABOUT_TEXT_BUILD_TIMESTAMP}}{{BUILD_TIMESTAMP}}</span>\n {{/BUILD_TIMESTAMP}}\n </p>\n\n <p class="dialog-message"><!-- $NON-NLS$ -->Copyright 2012 - 2014 Adobe Systems Incorporated and its licensors. All rights reserved.</p>\n <p class="dialog-message">{{{Strings.ABOUT_TEXT_WEB_PLATFORM_DOCS}}}</p>\n <p class="dialog-message">{{{Strings.ABOUT_TEXT_LINE3}}}</p>\n <p class="dialog-message">{{{Strings.ABOUT_TEXT_LINE4}}}</p>\n <p class="dialog-message">\n {{Strings.ABOUT_TEXT_LINE5}}\n <span class="spinner inline"></span>\n </p>\n <div class="about-contributors">\n </div>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <button class="dialog-button btn primary" data-button-id="ok">{{Strings.CLOSE}}</button>\n </div>\n</div>\n'}),define("text!htmlContent/contributors-list.html",[],function(){return'{{#.}}<a href="{{html_url}}" title="{{login}} - {{html_url}}"><img src="{{avatar_url}}?size=30" alt="{{login}}" width="30" height="30" /></a>{{/.}}\n'}),define("help/HelpCommandHandlers",["require","exports","module","utils/AppInit","utils/BuildInfoUtils","command/CommandManager","command/Commands","widgets/Dialogs","file/FileUtils","utils/NativeApp","strings","utils/StringUtils","utils/UpdateNotification","text!htmlContent/about-dialog.html","text!htmlContent/contributors-list.html","utils/Global"],function(e){function t(){h.checkForUpdate(!0)}function n(e){return function(){e&&d.openURLInDefaultBrowser(e)}}function r(){brackets.app.showExtensionsFolder(u.convertToNativePath(decodeURI(window.location.href)),function(){})}function i(){function e(t,n,r,i){i=i||new $.Deferred,r=r||[];var o=f.format(t,y,n);return $.ajax({url:o,dataType:"json",cache:!1}).done(function(o){r=r.concat(o||[]),n&&o.length===y?e(t,n+1,r,i):i.resolve(r)}).fail(function(){r.length?i.resolve(r):i.reject()}),i.promise()}var t={ABOUT_ICON:brackets.config.about_icon,APP_NAME_ABOUT_BOX:brackets.config.app_name_about,BUILD_TIMESTAMP:brackets.config.build_timestamp,BUILD_INFO:v||"",Strings:p};c.showModalDialogUsingTemplate(Mustache.render(m,t));var n,r=$(".about-dialog.instance"),i=r.find(".about-contributors"),o=r.find(".spinner"),a=brackets.config.contributors_url;-1!==a.indexOf("{1}")&&(n=1),o.addClass("spin"),e(a,n).done(function(e){var t=e.length,n=0;e.forEach(function(e){e.avatar_url=e.avatar_url.split("?")[0]}),i.html(Mustache.render(g,e)),i.find("img").one("load",function(){$(this).css("opacity",1),n++,n>=t&&o.removeClass("spin")}).each(function(){this.complete&&$(this).trigger("load")})}).fail(function(){o.removeClass("spin"),i.html(Mustache.render("<p class='dialog-message'>{{ABOUT_TEXT_LINE6}}</p>",p))})}var o=e("utils/AppInit"),a=e("utils/BuildInfoUtils"),s=e("command/CommandManager"),l=e("command/Commands"),c=e("widgets/Dialogs"),u=e("file/FileUtils"),d=e("utils/NativeApp"),p=e("strings"),f=e("utils/StringUtils"),h=e("utils/UpdateNotification"),m=e("text!htmlContent/about-dialog.html"),g=e("text!htmlContent/contributors-list.html");e("utils/Global");var v,y=100;o.appReady(function(){a.getBracketsSHA().done(function(e,t){t=t?t.substr(0,9):"",(e||t)&&(v=f.format("({0} {1})",e,t).trim())})}),s.register(p.CMD_CHECK_FOR_UPDATE,l.HELP_CHECK_FOR_UPDATE,t),s.register(p.CMD_HOW_TO_USE_BRACKETS,l.HELP_HOW_TO_USE_BRACKETS,n(brackets.config.how_to_use_url)),s.register(p.CMD_SUPPORT,l.HELP_SUPPORT,n(brackets.config.support_url)),s.register(p.CMD_SUGGEST,l.HELP_SUGGEST,n(brackets.config.suggest_feature_url)),s.register(p.CMD_RELEASE_NOTES,l.HELP_RELEASE_NOTES,n(brackets.config.release_notes_url)),s.register(p.CMD_GET_INVOLVED,l.HELP_GET_INVOLVED,n(brackets.config.get_involved_url)),s.register(p.CMD_SHOW_EXTENSIONS_FOLDER,l.HELP_SHOW_EXT_FOLDER,r),s.register(p.CMD_HOMEPAGE,l.HELP_HOMEPAGE,n(brackets.config.homepage_url)),s.register(p.CMD_TWITTER,l.HELP_TWITTER,n(brackets.config.twitter_url)),s.register(p.CMD_ABOUT,l.HELP_ABOUT,i)}),define("text!htmlContent/edit-filter-dialog.html",[],function(){return'<div class="file-filter-dialog modal">\n <div class="modal-header">\n <h1 class="dialog-title">{{Strings.FILE_FILTER_DIALOG}}</h1>\n </div>\n <div class="modal-body">\n <div class="dialog-message">\n {{{instruction}}}\n <textarea class="exclusions-editor"></textarea>\n <input type="text" class="exclusions-name" placeholder="{{Strings.FILTER_NAME_PLACEHOLDER}}">\n <div class="exclusions-filecount">{{Strings.FILTER_COUNTING_FILES}}</div>\n </div>\n </div>\n <div class="modal-footer">\n <button class="dialog-button btn" data-button-id="cancel">{{Strings.CANCEL}}</button>\n <button class="dialog-button btn primary" data-button-id="ok">{{Strings.OK}}</button>\n </div>\n</div>\n'}),define("text!htmlContent/filter-name.html",[],function(){return"<div class='filter-trash-icon'>&times;</div><!-- \n--><span class='recent-filter-name'>{{{filter-name}}}</span><!-- \n--><span class='recent-filter-patterns'>{{{filter-patterns}}}</span><!-- \n--><span class='filter-edit-icon'></span>"}),define("search/FileFilters",["require","exports","module","thirdparty/lodash","widgets/Dialogs","widgets/DropdownButton","utils/StringUtils","strings","preferences/PreferencesManager","text!htmlContent/edit-filter-dialog.html","text!htmlContent/filter-name.html"],function(e,t){function n(e){return _.isArray(e)?e.length>2?e.slice(0,2).join(", ")+" "+w.format(S.FILE_FILTER_CLIPPED_SUFFIX,e.length-2):e.join(", "):""}function r(){var e=[S.NEW_FILE_FILTER,S.CLEAR_FILE_FILTER],t=C.get("fileFilters")||[];t.length&&(e.push("---"),t=t.filter(function(e){return""!==n(e.patterns)}),e=e.concat(t)),D.items=e}function i(e,t){var n=-1;return t&&e.length?_.findIndex(e,_.partial(_.isEqual,t)):n}function o(){var e=C.get("fileFilters")||[],t=C.getViewState("activeFileFilter"),n=C.getViewState("search.exclusions")||[],r=null;return void 0===t&&n.length?(r={name:"",patterns:n},t=i(e,r),-1===t&&(t=e.length,e.push(r),C.set("fileFilters",e)),C.setViewState("activeFileFilter",t)):t>-1&&t<e.length&&(r=e[t]),r}function a(){var e=o();if(e&&e.patterns.length){var t=e.name||n(e.patterns);D.setButtonLabel(w.format(S.EXCLUDE_FILE_FILTER,t))}else D.setButtonLabel(S.NO_FILE_FILTER)}function s(e,t){var n=C.get("fileFilters")||[];if(e){if(-1===t)t=n.length,n.push(e);else{if(!(t>-1&&t<n.length))return void console.log("setActiveFilter is called with an invalid index: "+t);_.isEqual(n[t],e)||(n[t]=e)}C.set("fileFilters",n),C.setViewState("activeFileFilter",t)}else C.setViewState("activeFileFilter",-1)}function l(e){var t=e.map(function(e){if("**"!==e.substr(0,2)&&(e="**"+e),"**"!==e.substr(-2,2)){var t=e.lastIndexOf("/");-1===e.indexOf(".",t+1)&&(e+="**")}return e}),n=t.map(function(e){var t,n="";for(t=0;t<e.length;t++){var r=e[t];"*"===r?"*"===e[t+1]?"/"===e[t+2]&&"/"===e[t-1]?(n+="(.*/)?",t+=2):(n+=".*",t++):n+="[^/]*":n+="?"===r?"[^/]":w.regexEscape(r)}return"^"+n+"$"});return n.join("|")}function c(e,t){if(!e)return!0;var n=new RegExp(e);return!t.match(n)}function u(e,t){if(!e)return t;var n=new RegExp(e);return t.filter(function(e){return!e.fullPath.match(n)})}function d(e,t){function n(){var e=h.val().split("\n");return e.filter(function(e){return e.trim().length})}function i(){T.promise.done(function(e){var t=n();if(t.length){var r=u(l(t),e);m.html(w.format(S.FILTER_FILE_COUNT,r.length,e.length,T.label))}else m.html(w.format(S.FILTER_FILE_COUNT_ALL,e.length,T.label))})}function o(){var e=h.val().trim();g.prop("disabled",!e.length)}var c=window.document.activeElement,d={instruction:w.format(S.FILE_FILTER_INSTRUCTIONS,brackets.config.glob_help_url),Strings:S},p=b.showModalDialogUsingTemplate(Mustache.render(I,d)),f=p.getElement().find(".exclusions-name"),h=p.getElement().find(".exclusions-editor");f.val(e.name),h.val(e.patterns.join("\n")).focus(),p.done(function(e){e===b.DIALOG_BTN_OK&&(s({name:f.val(),patterns:n()},t),a(),r()),c.focus()});var m=p.getElement().find(".exclusions-filecount"),g=p.getElement().find(".primary");return h.on("input",o),o(),T?(h.on("input",_.debounce(i,400)),i()):m.hide(),p.getPromise()}function p(){var e=o();return e&&e.patterns.length?l(e.patterns):""}function f(e){var t=C.get("fileFilters")||[],n=C.getViewState("activeFileFilter"),i=$(e.target).parent().data("index")-x;e.stopPropagation(),t.splice(i,1),C.set("fileFilters",t),n===i?s(null):n>i&&(--n,s(t[n],n)),a(),r(),D.refresh()}function h(e){var t=C.get("fileFilters")||[],n=$(e.target).parent().data("index")-x;e.stopPropagation(),D.closeDropdown(),d(t[n],n)}function m(e,t){var n=C.getViewState("activeFileFilter"),r=n>-1?n+x:-1;D.setChecked(r,!0),t.find(".filter-trash-icon").on("click",f),t.find(".filter-edit-icon").on("click",h)}function g(e){function t(e,t){if(x>t)return"<span class='recent-filter-name'></span>"+_.escape(e);var r=n(e.patterns),i={"filter-name":_.escape(e.name||r),"filter-patterns":e.name?" - "+_.escape(r):""};return Mustache.render(k,i)}return T=e,D=new E("",[],t),a(),r(),D.$button.addClass("file-filter-picker no-focus"),$(D).on("listRendered",m),$(D).on("select",function(e,t,n){0===n?(D.closeDropdown(),d({name:"",patterns:[]},-1)):1===n?(D.setChecked(n,!1),s(null),a()):n>=x&&t&&(s(t,n-x),D.setChecked(n,!0),a())}),D.$button}function v(){D&&D.showDropdown()}function y(){D&&D.closeDropdown()}var _=e("thirdparty/lodash"),b=e("widgets/Dialogs"),E=e("widgets/DropdownButton").DropdownButton,w=e("utils/StringUtils"),S=e("strings"),C=e("preferences/PreferencesManager"),I=e("text!htmlContent/edit-filter-dialog.html"),k=e("text!htmlContent/filter-name.html"),x=3,T=null,D=null;t.showDropdown=v,t.closeDropdown=y,t.createFilterPicker=g,t.commitPicker=p,t.getActiveFilter=o,t.setActiveFilter=s,t.editFilter=d,t.compile=l,t.filterPath=c,t.filterFileList=u}),define("text!htmlContent/findreplace-bar.html",[],function(){return'<div class="find-input-group">\n <div id="find-group"><!--\n --><div class="search-input-container"><input type="text" id="find-what" placeholder="{{queryPlaceholder}}" value="{{initialQuery}}" /><div class="error"></div><span id="find-counter"></span></div><!--\n --><button id="find-case-sensitive" class="btn no-focus" tabindex="-1" title="{{Strings.BUTTON_CASESENSITIVE_HINT}}"><div class="button-icon"></div></button><!--\n --><button id="find-regexp" class="btn no-focus" tabindex="-1" title="{{Strings.BUTTON_REGEXP_HINT}}"><div class="button-icon"></div></button><!--\n {{^multifile}}\n --><div class="navigator"><!--\n --><button id="find-prev" class="btn no-focus" tabindex="-1" title="{{Strings.BUTTON_PREV_HINT}}">{{Strings.BUTTON_PREV}}</button><!--\n --><button id="find-next" class="btn no-focus" tabindex="-1" title="{{Strings.BUTTON_NEXT_HINT}}">{{Strings.BUTTON_NEXT}}</button><!--\n --></div><!--\n {{/multifile}}\n --></div>\n\n {{#replace}}\n <div id="replace-group" {{#scope}}class="has-scope"{{/scope}}><!--\n --><input type="text" id="replace-with" placeholder="{{Strings.REPLACE_PLACEHOLDER}}"/><!--\n {{^multifile}}\n --><button id="replace-yes" class="btn no-focus" tabindex="-1">{{Strings.BUTTON_REPLACE}}</button><!--\n {{/multifile}}\n --><button id="replace-all" class="btn no-focus {{#multifile}}solo{{/multifile}}" tabindex="-1">{{replaceAllLabel}}</button></div>\n {{/replace}}\n</div>\n\n{{#multifile}}\n<div class="scope-group">\n <div class="no-results-message">{{Strings.FIND_NO_RESULTS}}</div>\n <div class="message">\n <span id="searchlabel">{{{scopeLabel}}}</span>\n </div>\n <!-- For Find in Files, the filter picker will be added here programmatically. -->\n</div>\n{{/multifile}}\n'}),define("search/FindBar",["require","exports","module","thirdparty/lodash","command/Commands","command/KeyBindingManager","utils/KeyEvent","widgets/ModalBar","preferences/PreferencesManager","view/MainViewManager","strings","utils/ViewUtils","text!htmlContent/findreplace-bar.html"],function(e,t,n){function r(e){var t={multifile:!1,replace:!1,queryPlaceholder:"",initialQuery:"",scopeLabel:""};this._options=i.extend(t,e),this._closed=!1,this._enabled=!0}var i=e("thirdparty/lodash"),o=e("command/Commands"),a=e("command/KeyBindingManager"),s=e("utils/KeyEvent"),l=e("widgets/ModalBar").ModalBar,c=e("preferences/PreferencesManager"),u=e("view/MainViewManager"),d=e("strings"),p=e("utils/ViewUtils"),f=e("text!htmlContent/findreplace-bar.html");r._addFindBar=function(e){r._bars=r._bars||[],r._bars.push(e)},r._removeFindBar=function(e){r._bars&&i.pull(r._bars,e)},r._closeFindBars=function(){var e=r._bars;e&&(e.forEach(function(e){e.close(!0,!1)}),e=[])},r.prototype._options=null,r.prototype._closed=!1,r.prototype._enabled=!0,r.prototype._modalBar=null,r.prototype.$=function(e){return this._modalBar?$(e,this._modalBar.getRoot()):$()},r.prototype._updateSearchBarFromPrefs=function(){this.$("#find-case-sensitive").toggleClass("active",!!c.getViewState("caseSensitive")),this.$("#find-regexp").toggleClass("active",!!c.getViewState("regexp"))},r.prototype._updatePrefsFromSearchBar=function(){c.setViewState("caseSensitive",this.$("#find-case-sensitive").is(".active")),c.setViewState("regexp",this.$("#find-regexp").is(".active"))},r.prototype._addShortcutToTooltip=function(e,t){var n=a.getKeyBindings(t)[0];if(n){var r=e.attr("title");r=r?r+" ":"",e.attr("title",r+"("+a.formatKeyDescriptor(n.displayKey)+")")}},r.prototype.open=function(){var e=this;r._closeFindBars();var t=i.clone(this._options);t.Strings=d,t.replaceAllLabel=t.multifile?d.BUTTON_REPLACE_ALL_IN_FILES:d.BUTTON_REPLACE_ALL,this._modalBar=new l(Mustache.render(f,t),!0),$(this._modalBar).on("close",function(){e.showError(null),e._modalBar=null,e._closed=!0,r._removeFindBar(e),u.focusActivePane(),$(e).trigger("close")}),r._addFindBar(this);var n=this._modalBar.getRoot();n.on("input","#find-what",function(){$(e).triggerHandler("queryChange")}).on("click","#find-case-sensitive, #find-regexp",function(t){$(t.currentTarget).toggleClass("active"),e._updatePrefsFromSearchBar(),$(e).triggerHandler("queryChange")}).on("keydown","#find-what, #replace-with",function(t){t.keyCode===s.DOM_VK_RETURN&&(t.preventDefault(),t.stopPropagation(),e._options.multifile?$(t.target).is("#find-what")?e._options.replace?e.focusReplace():$(e).triggerHandler("doFind"):$(e).triggerHandler("doReplaceAll"):$(e).triggerHandler("doFind",[t.shiftKey]))}),this._options.multifile||(this._addShortcutToTooltip($("#find-next"),o.CMD_FIND_NEXT),this._addShortcutToTooltip($("#find-prev"),o.CMD_FIND_PREVIOUS),n.on("click","#find-next",function(){$(e).triggerHandler("doFind",!1)}).on("click","#find-prev",function(){$(e).triggerHandler("doFind",!0)})),this._options.replace&&(this._addShortcutToTooltip($("#replace-yes"),o.CMD_REPLACE),n.on("click","#replace-yes",function(){$(e).triggerHandler("doReplace")}).on("click","#replace-all",function(){$(e).triggerHandler("doReplaceAll")}).on("keydown",function(t){t.keyCode!==s.DOM_VK_TAB||t.ctrlKey||t.metaKey||t.altKey||("replace-with"!==t.target.id||t.shiftKey?"find-what"===t.target.id&&t.shiftKey&&(e.$("#replace-with").focus(),t.preventDefault()):(e.$("#find-what").focus(),t.preventDefault()))})),this._updateSearchBarFromPrefs(),this.focusQuery()},r.prototype.close=function(e){this._modalBar&&this._modalBar.close(!0,!e)},r.prototype.isClosed=function(){return this._closed},r.prototype.getOptions=function(){return this._options},r.prototype.getQueryInfo=function(){return{query:this.$("#find-what").val()||"",isCaseSensitive:this.$("#find-case-sensitive").is(".active"),isRegexp:this.$("#find-regexp").is(".active")}},r.prototype.showError=function(e,t){var n=this.$(".error");e?(t?n.html(e):n.text(e),n.show()):n.hide()},r.prototype.showFindCount=function(e){this.$("#find-counter").text(e)},r.prototype.showNoResults=function(e,t){p.toggleClass(this.$("#find-what"),"no-results",e);var n=this.$(".no-results-message");t?n.show():n.hide()},r.prototype.getReplaceText=function(){return this.$("#replace-with").val()||""},r.prototype.enable=function(e){this.$("#find-what, #replace-with, #find-prev, #find-next, #find-case-sensitive, #find-regexp").prop("disabled",!e),this._enabled=e},r.prototype.isEnabled=function(){return this._enabled},r.prototype.isReplaceEnabled=function(){return this.$("#replace-yes").is(":enabled")},r.prototype.enableNavigation=function(e){this.isEnabled()&&this.$("#find-prev, #find-next").prop("disabled",!e)},r.prototype.enableReplace=function(e){this.isEnabled&&this.$("#replace-yes, #replace-all").prop("disabled",!e)},r.prototype._focus=function(e){this.$(e).focus().get(0).select()},r.prototype.focusQuery=function(){this._focus("#find-what")},r.prototype.focusReplace=function(){this._focus("#replace-with")},c.stateManager.definePreference("caseSensitive","boolean",!1),c.stateManager.definePreference("regexp","boolean",!1),c.convertPreferences(n,{caseSensitive:"user",regexp:"user"},!0),t.FindBar=r}),define("search/FindUtils",["require","exports","module","utils/Async","document/DocumentManager","view/MainViewManager","filesystem/FileSystem","file/FileUtils","project/ProjectManager","strings","utils/StringUtils","thirdparty/lodash"],function(e,t){function n(e,t){return e=e.replace(/(\$+)(\d{1,2}|&)/g,function(e,n,r){if(n.length%2===1){if("&"===r)return n.substr(1)+(t[0]||"");var i=parseInt(r,10);if(0!==i)return n.substr(1)+(t[i]||"")}return e}),e=e.replace(/\$\$/g,"$")}function r(e){var t=e.getSelectedText();return t?t.replace(/^\n*/,"").split("\n")[0]:""}function i(e,r,i,o){return e.diskTimestamp.getTime()!==r.timestamp.getTime()?(new $.Deferred).reject(t.ERROR_FILE_CHANGED).promise():(e.batchOperation(function(){r.matches.reverse().forEach(function(t){t.isChecked&&e.replaceRange(o?n(i,t.result):i,t.start,t.end)})}),(new $.Deferred).resolve().promise())}function o(e,r,i,o){var a=h.getFileForPath(e);return p.getDocumentText(a,!0).then(function(e,s,l){if(s.getTime()!==r.timestamp.getTime())return(new $.Deferred).reject(t.ERROR_FILE_CHANGED).promise();var c=[],u=0;r.matches.forEach(function(t){t.isChecked&&(c.push(e.slice(u,t.startOffset)),c.push(o?n(i,t.result):i),u=t.endOffset)}),c.push(e.slice(u));var p=c.join("");return l===m.LINE_ENDINGS_CRLF&&(p=p.replace(/\n/g,"\r\n")),d.promisify(a,"write",p)})}function a(e,t,n,r){var a=p.getOpenDocumentForPath(e);return r=r||{},a||!r.forceFilesOpen&&-1===f.findInWorkingSet(f.ALL_PANES,e)?a?i(a,t,n,r.isRegexp):o(e,t,n,r.isRegexp):p.getDocumentForPath(e).then(function(e){return i(e,t,n,r.isRegexp)})}function s(e){return e.matches.some(function(e){return e.isChecked})}function l(e,t,n){return d.doInParallel_aggregateErrors(Object.keys(e),function(r){return a(r,e[r],t,n)}).done(function(){if(n&&n.forceFilesOpen){var t=p.getCurrentDocument();if(!t||!e[t.file.fullPath]||!s(e[t.file.fullPath])){var r=Object.keys(e).sort(m.comparePaths),i=_.find(r,function(t){return s(e[t])});if(i){var o=p.getOpenDocumentForPath(i);o&&f._edit(f.ACTIVE_PANE,o)}}}})}function c(e){return e?y.format(v.FIND_IN_FILES_SCOPED,y.breakableUrl(g.makeProjectRelativeIfPossible(e.fullPath))):v.FIND_IN_FILES_NO_SCOPE}function u(e){var t;if(!e||!e.query)return{empty:!0};var n="gm";if(e.isCaseSensitive||(n+="i"),e.isRegexp)try{t=new RegExp(e.query,n)}catch(r){return{valid:!1,error:r.message}}else t=new RegExp(y.regexEscape(e.query),n);return{valid:!0,queryExpr:t}}var d=e("utils/Async"),p=e("document/DocumentManager"),f=e("view/MainViewManager"),h=e("filesystem/FileSystem"),m=e("file/FileUtils"),g=e("project/ProjectManager"),v=e("strings"),y=e("utils/StringUtils"),_=e("thirdparty/lodash");t.parseDollars=n,t.getInitialQueryFromSelection=r,t.hasCheckedMatches=s,t.performReplacements=l,t.labelForScope=c,t.parseQueryInfo=u,t.ERROR_FILE_CHANGED="fileChanged"}),define("search/SearchModel",["require","exports","module","file/FileUtils","search/FindUtils"],function(e,t){function n(){this.clear()}var r=e("file/FileUtils"),i=e("search/FindUtils");n.MAX_TOTAL_RESULTS=1e5,n.prototype.results=null,n.prototype.queryInfo=null,n.prototype.queryExpr=null,n.prototype.isReplace=!1,n.prototype.replaceText=null,n.prototype.scope=null,n.prototype.filter=null,n.prototype.numMatches=0,n.prototype.foundMaximum=!1,n.prototype.exceedsMaximum=!1,n.prototype.clear=function(){this.results={},this.queryInfo=null,this.queryExpr=null,this.isReplace=!1,this.replaceText=null,this.scope=null,this.numMatches=0,this.foundMaximum=!1,this.exceedsMaximum=!1,this.fireChanged()},n.prototype.setQueryInfo=function(e){var t=i.parseQueryInfo(e);return t.valid?(this.queryInfo=e,this.queryExpr=t.queryExpr,!0):!1},n.prototype.setResults=function(e,t){this.removeResults(e),!this.foundMaximum&&t.matches.length&&(t.collapsed=!!t.collapsed,this.results[e]=t,this.numMatches+=t.matches.length,this.numMatches>=n.MAX_TOTAL_RESULTS&&(this.foundMaximum=!0,this.numMatches>n.MAX_TOTAL_RESULTS&&(this.results[e].matches.pop(),this.numMatches--,this.exceedsMaximum=!0)))},n.prototype.removeResults=function(e){this.results[e]&&(this.numMatches-=this.results[e].matches.length,delete this.results[e])},n.prototype.hasResults=function(){return Object.keys(this.results).length>0},n.prototype.countFilesMatches=function(){return{files:Object.keys(this.results).length,matches:this.numMatches}},n.prototype.getSortedFiles=function(e){return Object.keys(this.results).sort(function(t,n){return e===t?-1:e===n?1:r.comparePaths(t,n)})},n.prototype.fireChanged=function(e){$(this).triggerHandler("change",e)},t.SearchModel=n}),define("search/FindInFiles",["require","exports","module","thirdparty/lodash","search/FileFilters","utils/Async","utils/StringUtils","project/ProjectManager","document/Document","document/DocumentManager","view/MainViewManager","filesystem/FileSystem","language/LanguageManager","search/SearchModel","utils/PerfUtils","search/FindUtils"],function(e,t){function n(){$(S).off("documentChange",m),k.off("change",g),$(C).off("fileNameChange",v)}function r(){L.hasResults()&&(n(),$(S).on("documentChange",m),k.on("change",g),$(C).on("fileNameChange",v))}function i(e,t){if(L.foundMaximum||-1===e.search(t))return[];for(var n,r,i,o,a,s,l,c,u=E.getLines(e),d=[];null!==(n=t.exec(e));){if(r=E.offsetToLineNum(u,n.index),i=u[r],o=n.index-e.lastIndexOf("\n",n.index)-1,s=n[0].split("\n"),l=s.length,a=n[0].length,c=s[s.length-1].length,i=i.substr(0,Math.min(200,i.length)),d.push({start:{line:r,ch:o},end:{line:r+l-1,ch:1===l?o+a:c},startOffset:n.index,endOffset:n.index+a,line:i,result:n,isChecked:!0}),d.length>T.MAX_TOTAL_RESULTS){t.lastIndex=0;break}0===a&&t.lastIndex++}return d}function o(e,t){var n,r,o,a,s,l,c=!1,u=e.file.fullPath,d=L.results[u];L.removeResults(u),t.forEach(function(t){if(a=[],s=0,l=0,t.from&&t.to){for(n=0;n<t.text.length;n++)a.push(e.getLine(t.from.line+n));r=a.length-1-(t.to.line-t.from.line),d&&(d.matches.forEach(function(e){e.end.line<t.from.line?s++:e.end.line<=t.to.line?l++:(e.start.line+=r,e.end.line+=r)}),l>0&&d.matches.splice(s,l),c=!0),o=i(a.join("\r\n"),L.queryExpr),o.length&&(o.forEach(function(e,n){o[n].start.line+=t.from.line,o[n].end.line+=t.from.line}),d?Array.prototype.splice.apply(d.matches,[s,0].concat(o)):d={matches:o,collapsed:!1,timestamp:e.diskTimestamp},c=!0)}else d={matches:i(e.getText(),L.queryExpr),timestamp:e.diskTimestamp},c=!0}),d&&d.matches.length&&L.setResults(u,d),c&&L.fireChanged(!0)}function a(e,t){return t?t.isDirectory?0===e.fullPath.indexOf(t.fullPath):e.fullPath===t.fullPath:!0}function s(e){return!x.getLanguageForPath(e).isBinary()}function l(e){function t(t){return a(t,e)&&s(t.fullPath)}return e&&e.isFile?(new $.Deferred).resolve(t(e)?[e]:[]).promise():w.getAllFiles(t,!0)}function c(e){if(L&&L.scope){if(!a(e,L.scope))return!1}else if(0!==e.fullPath.indexOf(w.getProjectRoot().fullPath)&&-1===I.findInWorkingSet(I.ALL_PANES,e.fullPath))return!1;
35return s(e.fullPath)?_.filterPath(L.filter,e.fullPath):!1}function u(e){var t=new $.Deferred;return C.getDocumentText(e).done(function(n,r){var o=i(n,L.queryExpr);L.setResults(e.fullPath,{matches:o,timestamp:r}),t.resolve(!!o.length)}).fail(function(){t.resolve(!1)}),t.promise()}function d(e,n,i){L.filter=i;var o=L.setQueryInfo(e);if(!o)return null;var a=L.scope?L.scope.fullPath:w.getProjectRoot().fullPath,s=D.markStart("FindIn: "+a+" - "+e.query);return n.then(function(e){return e=_.filterFileList(i,e),e.length?b.doInParallel(e,u):O}).then(function(e){return t._searchDone=!0,D.addMeasurement(s),r(),e===O?e:L.results},function(e){return console.log("find in files failed: ",e),D.finalizeMeasurement(s),e})}function p(){n(),L.clear()}function f(e,t,n,r,i){return p(),L.scope=t,void 0!==r&&(L.isReplace=!0,L.replaceText=r),i=i||l(t),d(e,i,n)}function h(e,n,r){return M.performReplacements(e,n,r).always(function(){t._replaceDone=!0})}var m,g,v,y=e("thirdparty/lodash"),_=e("search/FileFilters"),b=e("utils/Async"),E=e("utils/StringUtils"),w=e("project/ProjectManager"),S=e("document/Document"),C=e("document/DocumentManager"),I=e("view/MainViewManager"),k=e("filesystem/FileSystem"),x=e("language/LanguageManager"),T=e("search/SearchModel").SearchModel,D=e("utils/PerfUtils"),M=e("search/FindUtils"),O={},L=new T;m=function(e,t,n){c(t.file)&&o(t,n)},v=function(e,t,n){var r=!1;y.forEach(L.results,function(e,i){0===i.indexOf(t)&&(L.removeResults(i),L.setResults(i.replace(t,n),e),r=!0)}),r&&L.fireChanged()},g=function(e,t,n,r){function i(e){Object.keys(L.results).forEach(function(t){0===t.indexOf(e.fullPath)&&(L.removeResults(t),a=!0)})}function o(e){var t=[],n=new $.Deferred,r=function(e){return w.shouldShow(e)?(e.isFile&&s(e.name)&&c(e)&&t.push(e),!0):!1};return e.visit(r,function(e){return e?void n.reject(e):void b.doInParallel(t,function(e){return u(e).done(function(e){a=a||e})}).always(n.resolve)}),n.promise()}var a=!1;if(t){var l;if(t.isDirectory)if(n&&r)r.forEach(i),l=b.doInParallel(n,o);else{i(t);var d=$.Deferred();l=d.promise(),t.getContents(function(e,t){b.doInParallel(t,o).always(d.resolve)})}else i(t),l=o(t);l.always(function(){a&&L.fireChanged()})}},t.searchModel=L,t.doSearchInScope=f,t.doReplace=h,t.getCandidateFiles=l,t.clearSearch=p,t.ZERO_FILES_TO_SEARCH=O,t._documentChangeHandler=m,t._fileNameChangeHandler=v,t._fileSystemChangeHandler=g}),define("text!htmlContent/search-panel.html",[],function(){return'<div id="{{panelID}}" class="search-results bottom-panel vert-resizable top-resizer no-focus">\n <div class="toolbar simple-toolbar-layout">\n <div class="title"></div>\n <a href="#" class="close">&times;</a>\n </div>\n <div class="table-container resizable-content"></div>\n</div>\n'}),define("text!htmlContent/search-results.html",[],function(){return'<table class="bottom-panel-table table table-striped table-condensed row-highlight">\n <tbody>\n {{#searchList}}\n <tr class="file-section" data-file-index="{{fileIndex}}">\n {{#replace}}<td class="checkbox-column"><input type="checkbox" class="check-one-file" {{#isChecked}}checked="true"{{/isChecked}} /></td>{{/replace}}\n <td colspan="2">\n <span class="disclosure-triangle expanded" title="{{Strings.FIND_IN_FILES_EXPAND_COLLAPSE}}"></span>\n {{{filename}}}\n </td>\n </tr>\n {{#items}}\n <tr data-file-index="{{fileIndex}}" data-item-index="{{itemIndex}}" data-match-index="{{matchIndex}}">\n {{#replace}}<td class="checkbox-column"><input type="checkbox" class="check-one" {{#isChecked}}checked="true"{{/isChecked}} /></td>{{/replace}}\n <td class="line-number">{{line}}</td>\n <td class="line-text">{{pre}}<span class="highlight">{{highlight}}</span>{{post}}</td>\n </tr>\n {{/items}}\n {{/searchList}}\n </tbody>\n</table>\n'}),define("text!htmlContent/search-summary.html",[],function(){return'{{#replace}}\n<div class="fixed-col"><input type="checkbox" class="check-all" {{#allChecked}}checked="checked"{{/allChecked}} /></div>\n{{/replace}}\n<div class="fixed-col">{{titleLabel}} &quot;</div>\n<div class="contracting-col">{{query}}</div>\n<div class="fixed-col">&quot;</div>\n{{#replace}}\n<div class="fixed-col">&nbsp;{{Strings.FIND_REPLACE_TITLE_WITH}} &quot;</div>\n<div class="contracting-col">{{replaceWith}}</div>\n<div class="fixed-col">&quot;</div>\n{{/replace}}\n{{#scope}}\n<div class="contracting-col">{{{scope}}}</div>\n{{/scope}}\n<div class="fixed-col">&nbsp;{{{summary}}}</div>\n{{#hasPages}}\n<div class="pagination-col">\n <span class="first-page {{^hasPrev}}disabled{{/hasPrev}}"></span>\n <span class="prev-page {{^hasPrev}}disabled{{/hasPrev}}"></span>\n {{{results}}}\n <span class="next-page {{^hasNext}}disabled{{/hasNext}}"></span>\n <span class="last-page {{^hasNext}}disabled{{/hasNext}}"></span>\n</div>\n{{/hasPages}}\n{{#replace}}\n<div class="replace-col">\n <button class="btn small replace-checked">{{Strings.BUTTON_REPLACE}}</button>\n</div>\n{{/replace}}'}),define("search/SearchResultsView",["require","exports","module","command/CommandManager","command/Commands","document/DocumentManager","editor/EditorManager","project/ProjectManager","project/FileViewController","file/FileUtils","search/FindUtils","view/WorkspaceManager","utils/StringUtils","strings","thirdparty/lodash","text!htmlContent/search-panel.html","text!htmlContent/search-results.html","text!htmlContent/search-summary.html"],function(e,t){function n(e,t,n){var r=Mustache.render(m,{panelID:t});this._panel=d.createBottomPanel(n,$(r),100),this._$summary=this._panel.$panel.find(".title"),this._$table=this._panel.$panel.find(".table-container"),this._model=e}var r=e("command/CommandManager"),i=e("command/Commands"),o=e("document/DocumentManager"),a=e("editor/EditorManager"),s=e("project/ProjectManager"),l=e("project/FileViewController"),c=e("file/FileUtils"),u=e("search/FindUtils"),d=e("view/WorkspaceManager"),p=e("utils/StringUtils"),f=e("strings"),h=e("thirdparty/lodash"),m=e("text!htmlContent/search-panel.html"),g=e("text!htmlContent/search-results.html"),v=e("text!htmlContent/search-summary.html"),y=100,_=400;n.prototype._model=null,n.prototype._searchList=[],n.prototype._panel=null,n.prototype._initialFilePath=null,n.prototype._currentStart=0,n.prototype._allChecked=!1,n.prototype._$selectedRow=null,n.prototype._$summary=null,n.prototype._$table=null,n.prototype._timeoutID=null,n.prototype._handleModelChange=function(e){if(this._model.isReplace)return void this.close();var t=this;this._timeoutID&&window.clearTimeout(this._timeoutID),e?this._timeoutID=window.setTimeout(function(){t._updateResults(),t._timeoutID=null},_):this._updateResults()},n.prototype._addPanelListeners=function(){function e(e){var t=n._panel.$panel.find(".file-section"),r=t.filter(function(){return $(this).find(".check-one-file").is(":checked")});r.length===t.length&&e.prop("checked",!0)}function t(t,r){var i=0===t.data("item-index")?t:t.prevUntil(".file-section").last(),o=i.prev(),a=o.nextUntil(".file-section"),s=o.find(".check-one-file"),l=n._panel.$panel.find(".check-all");if(r){if(!s.is(":checked")){var c=a.filter(function(){return $(this).find(".check-one").is(":checked")});c.length===a.length&&(s.prop("checked",!0),l.is(":checked")||e(l))}}else l.is(":checked")&&l.prop("checked",!1),s.is(":checked")&&s.prop("checked",!1)}var n=this;this._panel.$panel.off(".searchResults").on("click.searchResults",".close",function(){n.close()}).on("click.searchResults",".first-page:not(.disabled)",function(){n._currentStart=0,n._render()}).on("click.searchResults",".prev-page:not(.disabled)",function(){n._currentStart-=y,n._render()}).on("click.searchResults",".next-page:not(.disabled)",function(){n._currentStart+=y,n._render()}).on("click.searchResults",".last-page:not(.disabled)",function(){n._currentStart=n._getLastCurrentStart(),n._render()}).on("dblclick.searchResults",".table-container tr:not(.file-section)",function(){var e=n._searchList[$(this).data("file-index")];l.openFileAndAddToWorkingSet(e.fullPath)}).on("click.searchResults .table-container",function(e){var t=$(e.target).closest("tr");if(t.length){n._$selectedRow&&n._$selectedRow.removeClass("selected"),t.addClass("selected"),n._$selectedRow=t;var o=n._searchList[t.data("file-index")],s=o.fullPath;if(t.hasClass("file-section")){var l,c=!n._model.results[s].collapsed;l=e.metaKey||e.ctrlKey?$(e.target).closest("table").find(".file-section"):t,l.each(function(){s=n._searchList[$(this).data("file-index")].fullPath,o=n._model.results[s],o.collapsed!==c&&(o.collapsed=c,$(this).nextUntil(".file-section").toggle(),$(this).find(".disclosure-triangle").toggleClass("expanded").toggleClass("collapsed"))}),(e.metaKey||e.ctrlKey)&&h.forEach(n._model.results,function(e){e.collapsed=c})}else{var u=o.items[t.data("item-index")];r.execute(i.FILE_OPEN,{fullPath:s}).done(function(){a.getCurrentFullEditor().setSelection(u.start,u.end,!0)})}}}),this._model.isReplace&&this._panel.$panel.on("click.searchResults",".check-all",function(){var e=$(this).is(":checked");h.forEach(n._model.results,function(t){t.matches.forEach(function(t){t.isChecked=e})}),n._$table.find(".check-one").prop("checked",e),n._$table.find(".check-one-file").prop("checked",e),n._allChecked=e}).on("click.searchResults",".check-one-file",function(t){var r=$(this).is(":checked"),i=$(t.target).closest("tr"),o=n._searchList[i.data("file-index")],a=i.nextUntil(".file-section"),s=n._panel.$panel.find(".check-all");o&&n._model.results[o.fullPath].matches.forEach(function(e){e.isChecked=r}),a.find(".check-one").prop("checked",r),r?s.is(":checked")||e(s):s.is(":checked")&&s.prop("checked",!1),t.stopPropagation()}).on("click.searchResults",".check-one",function(e){var r=$(e.target).closest("tr"),i=n._searchList[r.data("file-index")],o=n._model.results[i.fullPath].matches[r.data("match-index")];o.isChecked=$(this).is(":checked"),t(r,o.isChecked),e.stopPropagation()}).on("click.searchResults",".replace-checked",function(){$(n).triggerHandler("replaceAll")})},n.prototype._showSummary=function(){var e,t,n=this._model.countFilesMatches(),r=this._getLastIndex(n.matches);e=p.format(f.FIND_NUM_FILES,n.files,n.files>1?f.FIND_IN_FILES_FILES:f.FIND_IN_FILES_FILE),t=p.format(f.FIND_TITLE_SUMMARY,this._model.exceedsMaximum?f.FIND_IN_FILES_MORE_THAN:"",String(n.matches),n.matches>1?f.FIND_IN_FILES_MATCHES:f.FIND_IN_FILES_MATCH,e),this._$summary.html(Mustache.render(v,{query:this._model.queryInfo.query&&this._model.queryInfo.query.toString()||"",replaceWith:this._model.replaceText,titleLabel:this._model.isReplace?f.FIND_REPLACE_TITLE_LABEL:f.FIND_TITLE_LABEL,scope:this._model.scope?"&nbsp;"+u.labelForScope(this._model.scope)+"&nbsp;":"",summary:t,allChecked:this._allChecked,hasPages:n.matches>y,results:p.format(f.FIND_IN_FILES_PAGING,this._currentStart+1,r),hasPrev:this._currentStart>0,hasNext:r<n.matches,replace:this._model.isReplace,Strings:f}))},n.prototype._render=function(){var e,t,n,r,i,o=this._model.countFilesMatches(),a=this._model.getSortedFiles(this._initialFilePath),l=this._getLastIndex(o.matches),u=0,d=!1,h=!0,m=this;this._showSummary(),this._searchList=[],a.some(function(o){if(d=!0,r=m._model.results[o],u+r.matches.length<m._currentStart)u+=r.matches.length,d=!1;else if(u<m._currentStart)n=m._currentStart-u,u=m._currentStart;else{if(!(l>u))return!0;n=0}if(d&&n<r.matches.length){for(e=[],h=!0;n<r.matches.length&&l>u;)t=r.matches[n],i=t.start.line!==t.end.line,e.push({fileIndex:m._searchList.length,itemIndex:e.length,matchIndex:n,line:t.start.line+1,pre:t.line.substr(0,t.start.ch),highlight:t.line.substring(t.start.ch,i?void 0:t.end.ch),post:i?"…":t.line.substr(t.end.ch),start:t.start,end:t.end,isChecked:t.isChecked}),t.isChecked||(h=!1),u++,n++;var a=c.getDirectoryPath(s.makeProjectRelativeIfPossible(o)),g=c.getDirectoryPath(a),v=p.format(f.FIND_IN_FILES_FILE_PATH,p.breakableUrl(c.getBaseName(o)),p.breakableUrl(g),g?"&mdash;":"");m._searchList.push({fileIndex:m._searchList.length,filename:v,fullPath:o,isChecked:h,items:e})}}),this._$table.empty().append(Mustache.render(g,{replace:this._model.isReplace,searchList:this._searchList,Strings:f})).find(".file-section").each(function(){var e=m._searchList[$(this).data("file-index")].fullPath;m._model.results[e].collapsed&&(m._model.results[e].collapsed=!1,$(this).trigger("click"))}),this._$selectedRow&&(this._$selectedRow.removeClass("selected"),this._$selectedRow=null),this._panel.show(),this._$table.scrollTop(0)},n.prototype._updateResults=function(){if(this._panel.isVisible()){var e=this._$table.scrollTop(),t=this._$selectedRow?this._$selectedRow.index():null,n=this._model.countFilesMatches().matches;this._currentStart>n&&(this._currentStart=this._getLastCurrentStart(n)),this._render(),this._$table.scrollTop(e),t&&(this._$selectedRow=this._$table.find("tr:eq("+t+")"),this._$selectedRow.addClass("selected"))}},n.prototype._getLastIndex=function(e){return Math.min(this._currentStart+y,e)},n.prototype._getLastCurrentStart=function(e){return e=e||this._model.countFilesMatches().matches,Math.floor((e-1)/y)*y},n.prototype.open=function(){this._currentStart=0,this._$selectedRow=null,this._allChecked=!0;var e=o.getCurrentDocument();this._initialFilePath=e?e.file.fullPath:null,this._render(),this._addPanelListeners(),$(this._model).on("change.SearchResultsView",this._handleModelChange.bind(this))},n.prototype.close=function(){this._panel&&this._panel.isVisible()&&(this._$table.empty(),this._panel.hide(),this._panel.$panel.off(".searchResults"),$(this._model).off("change.SearchResultsView"),$(this).triggerHandler("close"))},t.SearchResultsView=n}),define("search/FindInFilesUI",["require","exports","module","utils/AppInit","command/CommandManager","command/Commands","widgets/Dialogs","widgets/DefaultDialogs","editor/EditorManager","view/WorkspaceManager","search/FileFilters","file/FileUtils","search/FindBar","search/FindInFiles","search/FindUtils","document/InMemoryFile","project/ProjectManager","search/SearchResultsView","widgets/StatusBar","strings","utils/StringUtils","thirdparty/lodash"],function(e,t){function n(e,t,n,r,i){return _.doSearchInScope(e,t,n,r,i).done(function(e){if(_.searchModel.hasResults())D.open(),M&&M.close();else if(D.close(),M){var t=!1;M.enable(!0),M.focusQuery(),e===_.ZERO_FILES_TO_SEARCH?M.showError(k.format(I.FIND_IN_FILES_ZERO_FILES,b.labelForScope(_.searchModel.scope)),!0):t=!0,M.showNoResults(!0,t)}C.hideBusyIndicator()}).fail(function(e){console.log("find in files failed: ",e),C.hideBusyIndicator()})}function r(e,t){function r(){var e=M.getQueryInfo(),t=b.parseQueryInfo(e);M.enableReplace(t.valid),t.valid||t.empty?(M.showNoResults(!1),M.showError(null)):(M.showNoResults(!0,!1),M.showError(t.error))}function i(t){var r=M.getQueryInfo();if(r&&r.query){M.enable(!1),C.showBusyIndicator(!0);var i;i=l?g.commitPicker(l):null,n(r,e,i,t,c)}return null}function o(){i(M.getReplaceText())}if(!e||h.canOpenPath(e.fullPath)){if(e instanceof E)return void u.execute(d.FILE_OPEN,{fullPath:e.fullPath}).done(function(){u.execute(d.CMD_FIND)});var a=h.getActiveEditor(),s="";M&&!M.isClosed()?s=M.getQueryInfo().query:a&&(s=b.getInitialQueryFromSelection(a)),M&&M.close(),M=new y({multifile:!0,replace:t,initialQuery:s,queryPlaceholder:I.FIND_QUERY_PLACEHOLDER,scopeLabel:b.labelForScope(e)}),M.open(),M._modalBar.isLockedOpen=function(){return!M.isEnabled()||$(".modal.instance .exclusions-editor").length>0};var l,c=_.getCandidateFiles(e);$(M).on("doFind.FindInFiles",function(){i()}).on("queryChange.FindInFiles",r).on("close.FindInFiles",function(){$(M).off(".FindInFiles"),M=null}),t&&$(M).on("doReplaceAll.FindInFiles",o);var p=M._modalBar.height();if(!e||e.isDirectory){var f={label:b.labelForScope(e),promise:c};l=g.createFilterPicker(f),M._modalBar.getRoot().find(".scope-group").append(l)}r();var v,w=h.getCurrentFullEditor();w&&(v=w.getScrollPos(),v.y-=p),m.recomputeLayout(),w&&w._codeMirror.scrollTo(v.x,v.y+M._modalBar.height())}}function i(e){function t(e){C.showBusyIndicator(!0),_.doReplace(r,n,{forceFilesOpen:e,isRegexp:o}).fail(function(e){var t=I.REPLACE_IN_FILES_ERRORS+v.makeDialogFileList(e.map(function(e){return w.makeProjectRelativeIfPossible(e.item)}));p.showModalDialog(f.DIALOG_ID_ERROR,I.REPLACE_IN_FILES_ERRORS_TITLE,t,[{className:p.DIALOG_BTN_CLASS_PRIMARY,id:p.DIALOG_BTN_OK,text:I.BUTTON_REPLACE_WITHOUT_UNDO}])}).always(function(){C.hideBusyIndicator()})}var n=e.replaceText;if(null!==n){var r=x.cloneDeep(e.results),i=Object.keys(r).filter(function(e){return b.hasCheckedMatches(r[e])}),o=e.queryInfo.isRegexp;i.length<=T?(D.close(),t(!0)):p.showModalDialog(f.DIALOG_ID_INFO,I.REPLACE_WITHOUT_UNDO_WARNING_TITLE,k.format(I.REPLACE_WITHOUT_UNDO_WARNING,T),[{className:p.DIALOG_BTN_CLASS_NORMAL,id:p.DIALOG_BTN_CANCEL,text:I.CANCEL},{className:p.DIALOG_BTN_CLASS_PRIMARY,id:p.DIALOG_BTN_OK,text:I.BUTTON_REPLACE_WITHOUT_UNDO}]).done(function(e){e===p.DIALOG_BTN_OK&&(D.close(),t(!1))})}}function o(){r(null,!0)}function a(){var e=w.getSelectedItem();r(e)}function s(){var e=w.getSelectedItem();r(e,!0)}function l(){M&&M.close()}var c=e("utils/AppInit"),u=e("command/CommandManager"),d=e("command/Commands"),p=e("widgets/Dialogs"),f=e("widgets/DefaultDialogs"),h=e("editor/EditorManager"),m=e("view/WorkspaceManager"),g=e("search/FileFilters"),v=e("file/FileUtils"),y=e("search/FindBar").FindBar,_=e("search/FindInFiles"),b=e("search/FindUtils"),E=e("document/InMemoryFile"),w=e("project/ProjectManager"),S=e("search/SearchResultsView").SearchResultsView,C=e("widgets/StatusBar"),I=e("strings"),k=e("utils/StringUtils"),x=e("thirdparty/lodash"),T=20,D=null,M=null;c.htmlReady(function(){var e=_.searchModel;D=new S(e,"find-in-files-results","find-in-files.results"),$(D).on("replaceAll",function(){i(e)}).on("close",function(){_.clearSearch()})}),$(w).on("beforeProjectClose",function(){D.close()}),u.register(I.CMD_FIND_IN_FILES,d.CMD_FIND_IN_FILES,r),u.register(I.CMD_FIND_IN_SELECTED,d.CMD_FIND_IN_SELECTED,a),u.register(I.CMD_FIND_IN_SUBTREE,d.CMD_FIND_IN_SUBTREE,a),u.register(I.CMD_REPLACE_IN_FILES,d.CMD_REPLACE_IN_FILES,o),u.register(I.CMD_REPLACE_IN_SELECTED,d.CMD_REPLACE_IN_SELECTED,s),u.register(I.CMD_REPLACE_IN_SUBTREE,d.CMD_REPLACE_IN_SUBTREE,s),t.searchAndShowResults=n,t._showFindBar=r,t._closeFindBar=l}),define("search/ScrollTrackMarkers",["require","exports","module","thirdparty/lodash","view/WorkspaceManager"],function(e,t){function n(e){return $(e.getRootElement()).children(".CodeMirror-vscrollbar")}function r(){var e=n(c);if(d=e[0].offsetHeight,d>0)u="win"===brackets.platform?0:"mac"===brackets.platform?4:2,d-=2*u;else{var t=$(c.getRootElement()).find("> .CodeMirror-scroll > .CodeMirror-sizer > div > .CodeMirror-lines > div")[0];d=t.offsetHeight,u=t.offsetTop}}function i(e){var t="";e.forEach(function(e){var n=Math.round(e.line/c.lineCount()*d)+u;n--,t+="<div class='tickmark' style='top:"+n+"px'></div>"}),$(".tickmark-track",c.getRootElement()).append($(t))}function o(){c&&($(".tickmark-track",c.getRootElement()).empty(),h=[])}function a(e,t){if(!(t&&e===c||!t&&!c))if(t){if(console.assert(!c),c=e,c.isTextSubset())return;var o=n(c),a=$("<div class='tickmark-track'></div>");o.parent().append(a),r(),$(f).on("workspaceUpdateLayout.ScrollTrackMarkers",p.debounce(function(){h.length&&(r(),$(".tickmark-track",c.getRootElement()).empty(),i(h))},300))}else console.assert(c===e),$(".tickmark-track",e.getRootElement()).remove(),c=null,h=[],$(f).off("workspaceUpdateLayout.ScrollTrackMarkers")}function s(e,t){console.assert(c===e),h=h.concat(t),i(t)}function l(){return h}var c,u,d,p=e("thirdparty/lodash"),f=e("view/WorkspaceManager"),h=[];t._getTickmarks=l,t.clear=o,t.setVisible=a,t.addTickmarks=s}),define("search/FindReplace",["require","exports","module","command/CommandManager","command/Commands","view/MainViewManager","strings","utils/StringUtils","editor/Editor","editor/EditorManager","search/FindBar","search/FindUtils","search/FindInFilesUI","search/ScrollTrackMarkers","thirdparty/lodash","thirdparty/CodeMirror2/lib/codemirror"],function(e,t){function n(){this.searchStartPos=null,this.parsedQuery=null,this.queryInfo=null,this.foundAny=!1,this.marked=[],this.resultSet=[],this.matchIndex=-1,this.markedCurrent=null}function r(e){return e._searchState||(e._searchState=new n),e._searchState}function i(e,t,n){return e.getSearchCursor(t.parsedQuery,n,!t.queryInfo.isCaseSensitive)}function o(e){if(O&&O.showError(null),!e||!e.query)return"";if(!e.isRegexp)return e.query;try{return new RegExp(e.query,e.isCaseSensitive?"":"i")}catch(t){return O&&O.showError(t.message),""}}function a(e,t){e.queryInfo=t,e.parsedQuery=t?o(t):null}function s(e,t,n){e.foundAny&&O&&(-1===e.matchIndex?e.matchIndex=H.findIndex(e.resultSet,t):(e.matchIndex=n?e.matchIndex-1:e.matchIndex+1,e.matchIndex=(e.matchIndex+e.resultSet.length)%e.resultSet.length,H.isEqual(e.resultSet[e.matchIndex],t)||(e.matchIndex=H.findIndex(e.resultSet,t))),-1!==e.matchIndex&&O.showFindCount(P.format(N.FIND_MATCH_INDEX,e.matchIndex+1,e.resultSet.length)))}function l(e,t,n,o){var a=e._codeMirror,s=r(a),l=i(a,s,n||e.getCursorPos(!1,t?"start":"end"));return s.lastMatch=l.find(t),s.lastMatch||o===!1||(l=i(a,s,t?{line:a.lineCount()-1}:{line:0,ch:0}),s.lastMatch=l.find(t)),s.lastMatch?{start:l.from(),end:l.to()}:(a.setCursor(e.getCursorPos()),null)}function c(e,t,n,r){var i=H.find(t,function(e){return e.primary})||H.last(t),o=e.isLineVisible(i.start.line),a=F.BOUNDARY_CHECK_NORMAL;r&&o&&(a=F.BOUNDARY_IGNORE_TOP);var s=H.find(t,function(e){return e.primary});s||(s=H.last(t)),e._codeMirror.scrollIntoView({from:s.start,to:s.end}),e.setSelections(t,n,a)}function u(e,t){for(var n=e._codeMirror,r=t.ch,i=r,o=n.getLine(t.line);r&&q.isWordChar(o.charAt(r-1));)--r;for(;i<o.length&&q.isWordChar(o.charAt(i));)++i;return{start:{line:t.line,ch:r},end:{line:t.line,ch:i},text:o.slice(r,i)}}function d(e,t){return 0===q.cmpPos(e.start,t.start)&&0===q.cmpPos(e.end,t.end)}function p(e,t){if(e=e||U.getActiveEditor()){var n,i,o,s=e.getSelections(),p=!1;if(H.each(s,function(r,a){var s=0===q.cmpPos(r.start,r.end);if(r.primary&&(n=r,i=a,s||(o=e.document.getRange(n.start,n.end))),s){var l=u(e,r.start);r.start=l.start,r.end=l.end,r.primary&&t&&(o=l.text)}}),o&&o.length){var f=r(e._codeMirror);a(f,{query:o,isCaseSensitive:!1,isRegexp:!1});var h,m,g=n.end;do if(h=l(e,!1,g),h&&(m=H.find(s,H.partial(d,h)),g=h.end,0===q.cmpPos(g,n.end))){h=null;break}while(h&&m);h&&(h.primary=!0,s.push(h),p=!0)}t&&s.splice(i,1),p?c(e,s,!0,!0):c(e,s,!1)}}function f(e){return p(e,!0)}function h(e){if(e=e||U.getActiveEditor()){var t=e.getSelection(),n=[];if(0===q.cmpPos(t.start,t.end)&&(t=u(e,t.start)),0!==q.cmpPos(t.start,t.end)){var i,o={line:0,ch:0},s=r(e._codeMirror);for(a(s,{query:e.document.getRange(t.start,t.end),isCaseSensitive:!1,isRegexp:!1});null!==(i=l(e,!1,o,!1));)d(t,i)&&(i.primary=!0),n.push(i),o=i.end;n.length&&e.setSelections(n,!1)}}}function m(e,t){t.markedCurrent&&t.markedCurrent.clear()}function g(e,t,n,i){var o=e._codeMirror;o.operation(function(){var a=r(o);m(o,a);var u=l(e,t,i);u?(s(r(e._codeMirror),{from:u.start,to:u.end},t),c(e,[u],!0,n),a.markedCurrent=o.markText(u.start,u.end,{className:"searching-current-match",startStyle:"searching-first",endStyle:"searching-last"})):o.setCursor(e.getCursorPos())})}function v(e,t){e.operation(function(){t.marked.forEach(function(e){e.clear()}),m(e,t)}),t.marked.length=0,t.markedCurrent=null,W.clear(),t.resultSet=[],t.matchIndex=-1}function y(e){e.operation(function(){var t=r(e);t.parsedQuery&&(a(t,null),v(e,t))})}function _(e,t){t?$(e.getRootElement()).addClass("find-highlighting"):$(e.getRootElement()).removeClass("find-highlighting"),W.setVisible(e,t)}function b(e){function t(e){O.showNoResults(!o.foundAny&&O.getQueryInfo().query),O.enableNavigation(o.foundAny&&e>1),O.enableReplace(o.foundAny)}var n=e._codeMirror,o=r(n);n.operation(function(){if(o.marked&&v(n,o),!o.parsedQuery)return O.showFindCount(""),o.foundAny=!1,void t();var r=i(n,o);if(n.getValue().length<=z){for(o.resultSet=[];r.findNext();)o.resultSet.push(r.pos);if(o.resultSet.length<=G){_(e,!0),o.resultSet.forEach(function(e){o.marked.push(n.markText(e.from,e.to,{className:"CodeMirror-searching",startStyle:"searching-first",endStyle:"searching-last"}))});var a=o.resultSet.map(function(e){return e.from});W.addTickmarks(e,a)}0===o.resultSet.length&&O.showFindCount(N.FIND_NO_RESULTS),o.foundAny=o.resultSet.length>0,t(o.resultSet.length)}else O.showFindCount(""),o.foundAny=r.findNext(),t()})}function E(e,t,n){a(t,O.getQueryInfo()),b(e),t.parsedQuery?g(e,!1,!0,t.searchStartPos):n||e._codeMirror.setCursor(t.searchStartPos)}function w(e,t){var n=e._codeMirror,i=r(n);i.searchStartPos=e.getCursorPos(!1,"start");var o;o=O?O.getQueryInfo().query:V.getInitialQueryFromSelection(e),O&&O.close(),O=new j({multifile:!1,replace:t,initialQuery:o,queryPlaceholder:N.FIND_QUERY_PLACEHOLDER}),O.open(),$(O).on("queryChange.FindReplace",function(){E(e,i)}).on("doFind.FindReplace",function(t,n){g(e,n)}).on("close.FindReplace",function(){v(n,i),_(e,!1),$(O).off(".FindReplace"),O=null}),E(e,i,!0)}function S(e,t){var n=r(e._codeMirror);return n.parsedQuery?void g(e,t):void w(e,!1)}function C(){O&&O.close()}function I(e,t){var n=e._codeMirror,i=r(n),o=O.getReplaceText();t?(O.close(),B.searchAndShowResults(i.queryInfo,e.document.file,null,o)):(n.replaceSelection(i.queryInfo.isRegexp?V.parseDollars(o,i.lastMatch):o),b(e),g(e),i.lastMatch||O.close())}function k(e){return O&&O.getOptions().replace&&O.isReplaceEnabled()?void I(e,!1):(w(e,!0),void $(O).on("doReplace.FindReplace",function(){I(e,!1)}).on("doReplaceAll.FindReplace",function(){I(e,!0)}))}function x(){var e=U.getActiveEditor();e&&(y(e._codeMirror),S(e,!1))}function T(){var e=U.getActiveEditor();e&&S(e)}function D(){var e=U.getActiveEditor();e&&S(e,!0)}function M(){var e=U.getActiveEditor();e&&k(e)}var O,L=e("command/CommandManager"),R=e("command/Commands"),A=e("view/MainViewManager"),N=e("strings"),P=e("utils/StringUtils"),F=e("editor/Editor"),U=e("editor/EditorManager"),j=e("search/FindBar").FindBar,V=e("search/FindUtils"),B=e("search/FindInFilesUI"),W=e("search/ScrollTrackMarkers"),H=e("thirdparty/lodash"),q=e("thirdparty/CodeMirror2/lib/codemirror"),z=5e5,G=2e3;$(A).on("currentFileChange",C),L.register(N.CMD_FIND,R.CMD_FIND,x),L.register(N.CMD_FIND_NEXT,R.CMD_FIND_NEXT,T),L.register(N.CMD_REPLACE,R.CMD_REPLACE,M),L.register(N.CMD_FIND_PREVIOUS,R.CMD_FIND_PREVIOUS,D),L.register(N.CMD_FIND_ALL_AND_SELECT,R.CMD_FIND_ALL_AND_SELECT,h),L.register(N.CMD_ADD_NEXT_MATCH,R.CMD_ADD_NEXT_MATCH,p),L.register(N.CMD_SKIP_CURRENT_MATCH,R.CMD_SKIP_CURRENT_MATCH,f),t._getWordAt=u,t._expandWordAndAddNextToSelection=p,t._findAllAndSelect=h}),define("text!htmlContent/install-extension-dialog.html",[],function(){return'<div class="install-extension-dialog modal">\n <div class="modal-header">\n <h1 class="dialog-title">\n {{#isUpdate}}{{Strings.UPDATE_EXTENSION_TITLE}}{{/isUpdate}}\n {{^isUpdate}}{{Strings.INSTALL_EXTENSION_TITLE}}{{/isUpdate}}\n </h1>\n </div>\n <div class="modal-body">\n <div class="field-container input-field">\n <input type="text" placeholder="{{INSTALL_EXTENSION_HINT}}" class="url" />\n </div>\n <div class="field-container message-field">\n <div class="message"></div>\n </div>\n </div>\n <div class="modal-footer">\n {{#includeBrowseExtensions}}<button class="btn left browse-extensions">{{Strings.BROWSE_EXTENSIONS}}</button>{{/includeBrowseExtensions}}\n <button class="dialog-button btn" data-button-id="cancel">{{Strings.CANCEL}}</button>\n <button class="dialog-button btn primary" data-button-id="ok" disabled>{{Strings.INSTALL}}</button>\n </div>\n</div>\n'}),define("extensibility/InstallExtensionDialog",["require","exports","module","widgets/Dialogs","filesystem/File","utils/StringUtils","strings","filesystem/FileSystem","utils/KeyEvent","extensibility/Package","utils/NativeApp","text!htmlContent/install-extension-dialog.html"],function(e,t){function n(e,t){this._installer=e,this._state=g,this._installResult=null,this._isUpdate=t,this._cancelTimeout=1e4}function r(e){this._isLocalFile=e}function i(){var e=new n(new r);return e.show()}function o(e,t){var i=e instanceof l,o=new n(new r(i),t);return o.show(e.fullPath||e)}function a(e){return o(e,!0)}var s=e("widgets/Dialogs"),l=e("filesystem/File"),c=e("utils/StringUtils"),u=e("strings"),d=e("filesystem/FileSystem"),p=e("utils/KeyEvent"),f=e("extensibility/Package"),h=e("utils/NativeApp"),m=e("text!htmlContent/install-extension-dialog.html"),g=0,v=1,y=2,_=3,b=4,E=5,w=6,S=7,C=8,I=9,k=10,x=11;n.prototype.$dlg=null,n.prototype.$url=null,n.prototype.$okButton=null,n.prototype.$cancelButton=null,n.prototype.$inputArea=null,n.prototype.$msgArea=null,n.prototype.$msg=null,n.prototype.$browseExtensionsButton=null,n.prototype._dialogDeferred=null,n.prototype._installer=null,n.prototype._state=null,n.prototype._enterState=function(e){var t,n,r=this,i=this._state;switch(this._state=e,e){case v:this.$msg.find(".spinner").remove(),this.$msgArea.hide(),this.$inputArea.show(),this.$okButton.prop("disabled",!0).text(u.INSTALL);break;case y:this.$okButton.prop("disabled",!1);break;case _:t=this.$url.val().trim(),this.$inputArea.hide(),this.$browseExtensionsButton.hide(),this.$msg.text(c.format(u.INSTALLING_FROM,t)).append("<span class='spinner inline spin'/>"),this.$msgArea.show(),this.$okButton.prop("disabled",!0),this._installer.install(t).done(function(e){r._installResult=e,r._enterState(e.installationStatus===f.InstallationStatuses.ALREADY_INSTALLED||e.installationStatus===f.InstallationStatuses.OLDER_VERSION||e.installationStatus===f.InstallationStatuses.SAME_VERSION?I:e.installationStatus===f.InstallationStatuses.NEEDS_UPDATE?x:b)}).fail(function(e){"CANCELED"===e?(console.assert(r._state===w||r._state===S),r._enterState(C)):(r._errorMessage=f.formatError(e),r._enterState(E))});break;case w:this.$cancelButton.prop("disabled",!0),this.$msg.text(u.CANCELING_INSTALL),this._installer.cancel(),window.setTimeout(function(){r._state===w&&r._enterState(S)},this._cancelTimeout);break;case S:this.$msg.text(u.CANCELING_HUNG),this.$okButton.removeAttr("disabled").text(u.CLOSE);break;case b:case E:case C:case x:n=e===b?u.INSTALL_SUCCEEDED:e===E?u.INSTALL_FAILED:e===x?u.EXTENSION_UPDATE_INSTALLED:u.INSTALL_CANCELED,this.$msg.html($("<strong/>").text(n)),this._errorMessage&&this.$msg.append($("<p/>").text(this._errorMessage)),this.$okButton.removeAttr("disabled").text(u.CLOSE),this.$cancelButton.hide();break;case I:var o=this._installResult,a=o.installationStatus,l=u["EXTENSION_"+a];a===f.InstallationStatuses.OLDER_VERSION&&(l=c.format(l,o.metadata.version,o.installedVersion)),this.$msg.text(l),this.$okButton.prop("disabled",!1).text(u.OVERWRITE);break;case k:this._enterState(g);break;case g:$(document.body).off(".installDialog"),s.cancelModalDialogIfOpen("install-extension-dialog"),i===b||i===x||i===k?this._dialogDeferred.resolve(this._installResult):this._dialogDeferred.reject()}},n.prototype._handleCancel=function(){if(this._state===_)this._enterState(w);else if(this._state===I){if(this._installResult&&this._installResult.localPath&&!this._installResult.keepFile){var e=this._installResult.localPath;d.getFileForPath(e).unlink()}this._enterState(g)}else this._state!==w&&this._enterState(g)},n.prototype._handleOk=function(){this._state===b||this._state===E||this._state===C||this._state===S||this._state===x?this._enterState(g):this._state===y?this._enterState(_):this._state===I&&this._enterState(k)},n.prototype._handleKeyUp=function(e){e.keyCode===p.DOM_VK_ESCAPE&&this._handleCancel()},n.prototype._handleUrlInput=function(){var e=this.$url.val().trim(),t=""!==e;t||this._state!==y?t&&this._state===v&&this._enterState(y):this._enterState(v)},n.prototype._close=function(){this._state!==g&&this._enterState(g)
36},n.prototype.show=function(e){if(this._state!==g)return this._dialogDeferred.promise();var t={Strings:u,isUpdate:this._isUpdate,includeBrowseExtensions:!!brackets.config.extension_listing_url};return s.showModalDialogUsingTemplate(Mustache.render(m,t),!1),this.$dlg=$(".install-extension-dialog.instance"),this.$url=this.$dlg.find(".url").focus(),this.$okButton=this.$dlg.find(".dialog-button[data-button-id='ok']"),this.$cancelButton=this.$dlg.find(".dialog-button[data-button-id='cancel']"),this.$inputArea=this.$dlg.find(".input-field"),this.$msgArea=this.$dlg.find(".message-field"),this.$msg=this.$msgArea.find(".message"),this.$browseExtensionsButton=this.$dlg.find(".browse-extensions"),this.$okButton.on("click",this._handleOk.bind(this)),this.$cancelButton.on("click",this._handleCancel.bind(this)),this.$url.on("input",this._handleUrlInput.bind(this)),this.$browseExtensionsButton.on("click",function(){h.openURLInDefaultBrowser(brackets.config.extension_listing_url)}),$(document.body).on("keyup.installDialog",this._handleKeyUp.bind(this)),this._enterState(v),e&&(this.$url.val(e),this._enterState(y),this._enterState(_)),this._dialogDeferred=new $.Deferred,this._dialogDeferred.promise()},r.prototype.install=function(e){if(this.pendingInstall)return console.error("Extension installation already pending"),(new $.Deferred).reject("DOWNLOAD_ID_IN_USE").promise();if(this._isLocalFile){var t=new $.Deferred;this.pendingInstall={promise:t.promise(),cancel:function(){}},f.installFromPath(e).then(function(e){e.keepFile=!0,t.resolve(e)},t.reject)}else this.pendingInstall=f.installFromURL(e);var n=this.pendingInstall.promise,r=this;return this.pendingInstall.promise.always(function(){r.pendingInstall=null}),n},r.prototype.cancel=function(){this.pendingInstall.cancel()},t.showDialog=i,t.installUsingDialog=o,t.updateUsingDialog=a,t._Dialog=n}),define("extensibility/registry_utils",["require","exports","module"],function(e,t){function n(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}t.lastVersionDate=function(){var e;return this.versions&&this.versions.length&&(e=this.versions[this.versions.length-1].published,e&&(e=new Date(e),e=e.toLocaleDateString(brackets.getLocale(),{year:"numeric",month:"2-digit",day:"2-digit"}))),e||""},t.formatUserId=function(){var e;if(this.owner){var t=this.owner.split(":");e=t[1]}return e},t.ownerLink=function(){var e;if(this.owner){var t=this.owner.split(":");"github"===t[0]&&(e="https://github.com/"+t[1])}return e},t.authorInfo=function(){var e="",r=t.ownerLink.call(this),i=t.formatUserId.call(this);return this.metadata&&this.metadata.author?e=n(this.metadata.author.name||this.metadata.author):i&&(e=n(i)),r&&(e="<a href='"+n(r)+"' title='"+n(r)+"'>"+e+"</a>"),e},t.sortRegistry=function(e,t){function n(e){return e.versions?new Date(e.versions[e.versions.length-1].published).getTime():Number.NEGATIVE_INFINITY}var r=[];return Object.keys(e).forEach(function(t){r.push(e[t])}),r.sort(function(e,r){return n(t&&r[t]||r)-n(t&&e[t]||e)}),r}}),define("utils/LocalizationUtils",["require","exports","module","strings"],function(e,t){function n(e){var t="LOCALE_"+e.toUpperCase().replace("-","_"),n=r[t];return void 0===n?e:n}var r=e("strings");t.getLocalizedLabel=n}),define("text!htmlContent/extension-manager-view-item.html",[],function(){return'<tr>\n <td class="ext-info">\n <span class="ext-name">{{#metadata.title}}{{metadata.title}}{{/metadata.title}}{{^metadata.title}}{{metadata.name}}{{/metadata.title}}</span>\n {{#authorInfo}}\n <span class="muted ext-author">{{{authorInfo}}}</span>\n {{/authorInfo}}\n <span class="muted ext-version">{{metadata.version}}</span>\n {{#hasVersionInfo}}\n <span class="muted ext-date"> &mdash; {{lastVersionDate}}</span>\n {{/hasVersionInfo}}\n </td>\n <td class="ext-desc">\n {{#showInstallButton}}\n <!-- Warnings when trying to install extension where latest/all versions not compatible -->\n {{^isCompatible}}\n <div class="alert warning">\n {{#requiresNewer}}{{Strings.EXTENSION_INCOMPATIBLE_NEWER}}{{/requiresNewer}}\n {{^requiresNewer}}{{Strings.EXTENSION_INCOMPATIBLE_OLDER}}{{/requiresNewer}}\n </div>\n {{/isCompatible}}\n {{#isCompatible}}\n {{^isCompatibleLatest}}\n <div class="alert warning">\n {{installWarning}}\n </div>\n {{/isCompatibleLatest}}\n {{/isCompatible}}\n {{/showInstallButton}}\n <span class="ext-full-description">\n {{#metadata.shortdescription}}\n {{metadata.shortdescription}}\n {{/metadata.shortdescription}}\n {{^metadata.shortdescription}}\n {{#metadata.description}}\n {{metadata.description}}\n {{/metadata.description}}\n {{^metadata.description}}\n <p class="muted"><em>{{Strings.EXTENSION_NO_DESCRIPTION}}</em></p>\n {{/metadata.description}}\n {{/metadata.shortdescription}}\n </span>\n {{#metadata.shortdescription}}\n <a data-extension-id="{{metadata.name}}" data-toggle-desc="expand-desc" title="{{Strings.VIEW_COMPLETE_DESCRIPTION}}" href="#">...</a>\n {{/metadata.shortdescription}}\n {{#metadata.homepage}}\n <p><a title="{{metadata.homepage}}" href="{{metadata.homepage}}">{{Strings.EXTENSION_MORE_INFO}}</a></p>\n {{/metadata.homepage}}\n {{#translated}}\n <br/>\n <span class="ext-translated" title="{{translatedLangs}}">{{extensionTranslated}}</span>\n {{/translated}}\n </td>\n <td class="ext-action">\n {{#showInstallButton}}\n <button class="btn btn-mini install" data-extension-id="{{metadata.name}}" {{^allowInstall}}disabled{{/allowInstall}}>\n {{^isInstalled}}{{Strings.INSTALL}}{{/isInstalled}}\n {{#isInstalled}}{{Strings.EXTENSION_INSTALLED}}{{/isInstalled}}\n </button>\n {{/showInstallButton}}\n {{#isInstalled}}\n {{#showUpdateButton}}\n <button class="btn btn-mini update" data-extension-id="{{metadata.name}}" {{^allowUpdate}}disabled title="{{updateNotAllowedReason}}"{{/allowUpdate}}>\n {{Strings.UPDATE}}\n </button>\n {{/showUpdateButton}}\n {{#removalAllowed}}\n <button class="btn btn-mini remove" data-extension-id="{{metadata.name}}" {{^allowRemove}}disabled title="{{Strings.CANT_REMOVE_DEV}}"{{/allowRemove}}>\n {{Strings.REMOVE}}\n </button>\n {{/removalAllowed}}\n {{#failedToStart}}\n {{^isMarkedForRemoval}}\n {{Strings.EXTENSION_ERROR}} {{#allowRemove}}(<a class="remove" data-extension-id="{{metadata.name}}">{{Strings.REMOVE}}</a>){{/allowRemove}}\n {{/isMarkedForRemoval}}\n {{/failedToStart}}\n {{#isMarkedForRemoval}}\n {{Strings.MARKED_FOR_REMOVAL}} (<a class="undo-remove" data-extension-id="{{metadata.name}}" href="#">{{Strings.UNDO_REMOVE}}</a>)\n {{/isMarkedForRemoval}}\n {{#isMarkedForUpdate}}\n {{Strings.MARKED_FOR_UPDATE}} (<a class="undo-update" data-extension-id="{{metadata.name}}" href="#">{{Strings.UNDO_UPDATE}}</a>)\n {{/isMarkedForUpdate}}\n {{/isInstalled}}\n </td>\n</tr>\n'}),define("extensibility/ExtensionManagerView",["require","exports","module","strings","utils/StringUtils","extensibility/ExtensionManager","extensibility/registry_utils","extensibility/InstallExtensionDialog","utils/LocalizationUtils","text!htmlContent/extension-manager-view-item.html"],function(e,t){function n(){}var r=e("strings"),i=e("utils/StringUtils"),o=e("extensibility/ExtensionManager"),a=e("extensibility/registry_utils"),s=e("extensibility/InstallExtensionDialog"),l=e("utils/LocalizationUtils"),c=e("text!htmlContent/extension-manager-view-item.html");n.prototype.initialize=function(e){var t=this,n=new $.Deferred;return this.model=e,this._itemTemplate=Mustache.compile(c),this._itemViews={},this.$el=$("<div class='extension-list tab-pane' id='"+this.model.source+"'/>"),this._$emptyMessage=$("<div class='empty-message'/>").appendTo(this.$el),this._$infoMessage=$("<div class='info-message'/>").appendTo(this.$el).html(this.model.infoMessage),this._$table=$("<table class='table'/>").appendTo(this.$el),this.model.initialize().done(function(){t._setupEventHandlers()}).always(function(){t._render(),n.resolve()}),n.promise()},n.prototype.$el=null,n.prototype.model=null,n.prototype._$emptyMessage=null,n.prototype._$table=null,n.prototype._itemTemplate=null,n.prototype._itemViews=null,n.prototype._toggleDescription=function(e,t,n){var i,o,a=this.model._getEntry(e);n?(i=a.metadata.description,o=r.VIEW_TRUNCATED_DESCRIPTION):(i=a.metadata.shortdescription,o=r.VIEW_COMPLETE_DESCRIPTION),t.data("toggle-desc",n?"trunc-desc":"expand-desc").attr("title",o).prev(".ext-full-description").text(i)},n.prototype._setupEventHandlers=function(){var e=this;$(this.model).on("filter",function(){e._render()}).on("change",function(t,n){var r=e.model.extensions,i=e._itemViews[n];if(e._updateMessage(),-1===e.model.filterSet.indexOf(n))i&&(i.remove(),delete e._itemViews[n]);else{var o=e._renderItem(r[n],e.model._getEntry(n));i&&(i.replaceWith(o),e._itemViews[n]=o)}}),this.$el.on("click","a",function(e){var t=$(e.target);t.hasClass("undo-remove")?o.markForRemoval(t.attr("data-extension-id"),!1):t.hasClass("remove")?o.markForRemoval(t.attr("data-extension-id"),!0):t.hasClass("undo-update")?o.removeUpdate(t.attr("data-extension-id")):"expand-desc"===t.data("toggle-desc")?this._toggleDescription(t.attr("data-extension-id"),t,!0):"trunc-desc"===t.data("toggle-desc")&&this._toggleDescription(t.attr("data-extension-id"),t,!1)}.bind(this)).on("click","button.install",function(t){e._installUsingDialog($(t.target).attr("data-extension-id"))}).on("click","button.update",function(t){e._installUsingDialog($(t.target).attr("data-extension-id"),!0)}).on("click","button.remove",function(e){o.markForRemoval($(e.target).attr("data-extension-id"),!0)})},n.prototype._renderItem=function(e,t){var n=$.extend({},t);if(n.Strings=r,n.isInstalled=!!e.installInfo,n.failedToStart=e.installInfo&&e.installInfo.status===o.START_FAILED,n.hasVersionInfo=!!t.versions,e.registryInfo){var s=o.getCompatibilityInfo(e.registryInfo,brackets.metadata.apiVersion);if(n.isCompatible=s.isCompatible,n.requiresNewer=s.requiresNewer,n.isCompatibleLatest=s.isLatestVersion,!n.isCompatibleLatest){var c=n.requiresNewer?r.EXTENSION_LATEST_INCOMPATIBLE_NEWER:r.EXTENSION_LATEST_INCOMPATIBLE_OLDER;n.installWarning=i.format(c,e.registryInfo.versions[e.registryInfo.versions.length-1].version,s.compatibleVersion)}}else n.isCompatible=n.isCompatibleLatest=!0;var u=brackets.getLocale(),d=u.split("-")[0];if(t.metadata["package-i18n"]&&[d,u].forEach(function(e){t.metadata["package-i18n"].hasOwnProperty(e)&&["title","description","homepage","keywords"].forEach(function(n){t.metadata["package-i18n"][e].hasOwnProperty(n)&&(t.metadata[n]=t.metadata["package-i18n"][e][n])})}),void 0!==t.metadata.description&&(t.metadata.shortdescription=i.truncate(t.metadata.description,200)),n.isMarkedForRemoval=o.isMarkedForRemoval(t.metadata.name),n.isMarkedForUpdate=o.isMarkedForUpdate(t.metadata.name),n.showInstallButton=(this.model.source===this.model.SOURCE_REGISTRY||this.model.source===this.model.SOURCE_THEMES)&&!n.updateAvailable,n.showUpdateButton=n.updateAvailable&&!n.isMarkedForUpdate&&!n.isMarkedForRemoval,n.allowInstall=n.isCompatible&&!n.isInstalled,Array.isArray(t.metadata.i18n)&&t.metadata.i18n.length>0){n.translated=!0,n.translatedLangs=t.metadata.i18n.map(function(e){return"root"===e&&(e="en"),{name:l.getLocalizedLabel(e),locale:e}}).sort(function(e,t){var n=[e.locale,t.locale],r=n.indexOf(u);return r>-1?r:(r=n.indexOf(d),r>-1?r:e.name.localeCompare(t.name))}).map(function(e){return e.name}).join(", "),n.translatedLangs=i.format(r.EXTENSION_TRANSLATED_LANGS,n.translatedLangs);var p=brackets.isLocaleDefault()&&t.metadata.i18n.indexOf(d)>-1||t.metadata.i18n.indexOf(u)>-1;n.extensionTranslated=i.format(p?r.EXTENSION_TRANSLATED_USER_LANG:r.EXTENSION_TRANSLATED_GENERAL,t.metadata.i18n.length)}var f=e.installInfo&&e.installInfo.locationType===o.LOCATION_USER;return n.allowRemove=f,n.allowUpdate=n.showUpdateButton&&n.isCompatible&&n.updateCompatible&&f,n.allowUpdate||(n.updateNotAllowedReason=f?r.CANT_UPDATE:r.CANT_UPDATE_DEV),n.removalAllowed="installed"===this.model.source&&!n.failedToStart&&!n.isMarkedForUpdate&&!n.isMarkedForRemoval,["lastVersionDate","authorInfo"].forEach(function(e){n[e]=a[e]}),$(this._itemTemplate(n))},n.prototype._updateMessage=function(){return this.model.message?(this._$emptyMessage.css("display","block"),this._$emptyMessage.html(this.model.message),this._$infoMessage.css("display","none"),this._$table.css("display","none"),!0):(this._$emptyMessage.css("display","none"),this._$infoMessage.css("display",this.model.infoMessage?"block":"none"),this._$table.css("display",""),!1)},n.prototype._render=function(){var e=this;this._$table.empty(),this._updateMessage(),this.model.filterSet.forEach(function(t){var n=e._itemViews[t];n||(n=e._renderItem(e.model.extensions[t],e.model._getEntry(t)),e._itemViews[t]=n),n.appendTo(e._$table)}),$(this).triggerHandler("render")},n.prototype._installUsingDialog=function(e,t){var n=this.model.extensions[e];if(n&&n.registryInfo){var r=o.getCompatibilityInfo(n.registryInfo,brackets.metadata.apiVersion),i=o.getExtensionURL(e,r.compatibleVersion);t?s.updateUsingDialog(i).done(o.updateFromDownload):s.installUsingDialog(i)}},n.prototype.filter=function(e){this.model.filter(e)},t.ExtensionManagerView=n}),define("extensibility/ExtensionManagerViewModel",["require","exports","module","thirdparty/lodash","extensibility/ExtensionManager","extensibility/registry_utils","strings"],function(e,t){function n(){this._handleStatusChange=this._handleStatusChange.bind(this),$(s).on("statusChange."+this.source,this._handleStatusChange).on("registryUpdate."+this.source,this._handleStatusChange)}function r(){n.call(this),this.infoMessage=c.REGISTRY_SANITY_CHECK_WARNING}function i(){n.call(this);var e=this;$(s).on("registryDownload",function(){e._sortFullSet(),e._setInitialFilter()})}function o(){n.call(this)}var a=e("thirdparty/lodash"),s=e("extensibility/ExtensionManager"),l=e("extensibility/registry_utils"),c=e("strings"),u=[["metadata","name"],["metadata","title"],["metadata","description"],["metadata","author","name"],["metadata","keywords"],["owner"]];n.prototype.SOURCE_REGISTRY="registry",n.prototype.SOURCE_THEMES="themes",n.prototype.SOURCE_INSTALLED="installed",n.prototype.extensions=null,n.prototype.source=null,n.prototype.filterSet=null,n.prototype.sortedFullSet=null,n.prototype._lastQuery=null,n.prototype.infoMessage=null,n.prototype.message=null,n.prototype.notifyCount=0,n.prototype._initializeFromSourcePromise=null,n.prototype.dispose=function(){$(s).off("."+this.source)},n.prototype._setInitialFilter=function(){this.filterSet=a.clone(this.sortedFullSet),$(this).triggerHandler("filter")},n.prototype._sortFullSet=function(){},n.prototype.initialize=function(){var e=this;return this._initializeFromSourcePromise=this._initializeFromSource().always(function(){e._updateMessage()}),this._initializeFromSourcePromise},n.prototype._handleStatusChange=function(e,t){$(this).triggerHandler("change",t)},n.prototype.filter=function(e,t){function n(e,t){var n=[];return e.forEach(function(e){var r=i._getEntry(e);r&&i._entryMatchesQuery(r,t)&&n.push(e)}),n}var r,i=this;r=!t&&this._lastQuery&&0===e.indexOf(this._lastQuery)?this.filterSet:this.sortedFullSet;var o,a=e.toLowerCase().split(/\s+/),s=r;for(o=0;o<a.length;o++)s=n(s,a[o]);this._lastQuery=e,this.filterSet=s,this._updateMessage(),$(this).triggerHandler("filter")},n.prototype._updateMessage=function(){this.message=this._initializeFromSourcePromise&&"rejected"===this._initializeFromSourcePromise.state()?c.EXTENSION_MANAGER_ERROR_LOAD:this.filterSet&&0===this.filterSet.length?this.sortedFullSet&&this.sortedFullSet.length?c.NO_EXTENSION_MATCHES:c.NO_EXTENSIONS:null},n.prototype._getEntry=function(){return null},n.prototype._entryMatchesQuery=function(e,t){return""===t||u.some(function(n){var r,i=e;for(r=0;r<n.length;r++)if(i=i[n[r]],!i)return!1;if(Array.isArray(i))return i.some(function(e){return-1!==e.toLowerCase().indexOf(t)});if("owner"===n[n.length-1]){var o=i.split(":");if(-1!==o[1].toLowerCase().indexOf(t))return!0}else if(-1!==i.toLowerCase().indexOf(t))return!0})},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.source=n.prototype.SOURCE_REGISTRY,r.prototype._initializeFromSource=function(){var e=this;return s.downloadRegistry().done(function(){e.extensions=s.extensions,e.sortedFullSet=l.sortRegistry(e.extensions,"registryInfo").filter(function(e){return void 0!==e.registryInfo&&void 0===e.registryInfo.metadata.theme}).map(function(e){return e.registryInfo.metadata.name}),e._setInitialFilter()}).fail(function(){e.extensions=[],e.sortedFullSet=[],e.filterSet=[]})},r.prototype._getEntry=function(e){var t=this.extensions[e];return t?t.registryInfo:t},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.source=n.prototype.SOURCE_INSTALLED,i.prototype._initializeFromSource=function(){var e=this;return this.extensions=s.extensions,this.sortedFullSet=Object.keys(this.extensions).filter(function(t){return e.extensions[t].installInfo&&e.extensions[t].installInfo.locationType!==s.LOCATION_DEFAULT}),this._sortFullSet(),this._setInitialFilter(),this._countUpdates(),(new $.Deferred).resolve().promise()},i.prototype._sortFullSet=function(){var e=this;this.sortedFullSet=this.sortedFullSet.sort(function(t,n){var r=e.extensions[t].installInfo.updateAvailable,i=e.extensions[n].installInfo.updateAvailable;if(r&&!i)return-1;if(!r&&i)return 1;var o=e.extensions[t].installInfo.metadata,a=e.extensions[n].installInfo.metadata,s=(o.title||o.name).toLocaleLowerCase(),l=(a.title||a.name).toLocaleLowerCase();return s.localeCompare(l)})},i.prototype._countUpdates=function(){var e=this;this.notifyCount=0,this.sortedFullSet.forEach(function(t){e.extensions[t].installInfo.updateCompatible&&!s.isMarkedForUpdate(t)&&e.notifyCount++})},i.prototype._handleStatusChange=function(e,t){var r=this.sortedFullSet.indexOf(t),i=!1;-1===r||this.extensions[t].installInfo?-1===r&&this.extensions[t].installInfo&&(this.sortedFullSet.push(t),this._sortFullSet(),i=!0):(this.sortedFullSet.splice(r,1),this._countUpdates(),i=!0),i&&this.filter(this._lastQuery||"",!0),this.extensions[t].installInfo&&this._countUpdates(),n.prototype._handleStatusChange.call(this,e,t)},i.prototype._getEntry=function(e){var t=this.extensions[e];return t?t.installInfo:t},o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype.source=n.prototype.SOURCE_THEMES,o.prototype._initializeFromSource=function(){var e=this;return s.downloadRegistry().done(function(){e.extensions=s.extensions,e.sortedFullSet=l.sortRegistry(e.extensions,"registryInfo").filter(function(e){return void 0!==e.registryInfo&&e.registryInfo.metadata.theme}).map(function(e){return e.registryInfo.metadata.name}),e._setInitialFilter()}).fail(function(){e.extensions=[],e.sortedFullSet=[],e.filterSet=[]})},o.prototype._getEntry=function(e){var t=this.extensions[e];return t?t.registryInfo:t},t.RegistryViewModel=r,t.ThemesViewModel=o,t.InstalledViewModel=i}),define("text!htmlContent/extension-manager-dialog.html",[],function(){return'<div class="extension-manager-dialog modal no-focus">\n <div class="modal-header">\n <ul class="nav nav-tabs">\n {{#showRegistry}}\n <li><a href="#registry" class="registry" data-toggle="tab"><img src="styles/images/extension-manager-registry.svg"/><br/>{{Strings.EXTENSIONS_AVAILABLE_TITLE}}</a></li>\n <li><a href="#themes" class="themes" data-toggle="tab"><img src="styles/images/themes-icon.svg"/><br/>{{Strings.EXTENSIONS_THEMES_TITLE}}</a></li>\n <!--<li><a href="#updates" class="updates" data-toggle="tab"><img src="styles/images/extension-manager-updates.svg"/><br/>{{Strings.EXTENSIONS_UPDATES_TITLE}}</a></li>-->\n {{/showRegistry}}\n <li><a href="#installed" class="installed" data-toggle="tab"><span class="notification"></span><img src="styles/images/extension-manager-installed.svg"/><br/>{{Strings.EXTENSIONS_INSTALLED_TITLE}}</a></li>\n </ul>\n <div>\n <button class="search-clear">&times;</button>\n <input class="search" type="text" placeholder="{{EXTENSION_SEARCH_PLACEHOLDER}}">\n </div>\n </div>\n <div class="modal-body no-padding table-striped tab-content">\n <div class=\'spinner large spin\'/>\n </div>\n <div class="modal-footer">\n <span id="install-drop-zone" class="btn left drag">\n <span class="install-drag-message">{{Strings.INSTALL_EXTENSION_DRAG}} <a class="install-from-url">{{Strings.INSTALL_FROM_URL}}</a></span>\n <span class="install-drop-message">{{Strings.INSTALL_EXTENSION_DROP}}</span>\n <span class="install-validating-message">{{Strings.INSTALL_EXTENSION_VALIDATING}}</span>\n <div id="install-drop-zone-mask"></div>\n </span>\n <button class="dialog-button btn primary" data-button-id="close">{{Strings.CLOSE}}</button>\n </div>\n</div>\n'}),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t,n,r,i=this.element,o=i.closest("ul:not(.dropdown-menu)"),a=i.attr("data-target");a||(a=i.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,"")),i.parent("li").hasClass("active")||(t=o.find(".active:last a")[0],r=e.Event("show",{relatedTarget:t}),i.trigger(r),r.isDefaultPrevented()||(n=e(a),this.activate(i.parent("li"),o),this.activate(n,n.parent(),function(){i.trigger({type:"shown",relatedTarget:t})})))},activate:function(t,n,r){function i(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),a?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var o=n.find("> .active"),a=r&&e.support.transition&&o.hasClass("fade");a?o.one(e.support.transition.end,i):i(),o.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),"string"==typeof n&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),define("widgets/bootstrap-tab",function(){}),define("extensibility/ExtensionManagerDialog",["require","exports","module","thirdparty/lodash","widgets/Dialogs","widgets/DefaultDialogs","filesystem/FileSystem","file/FileUtils","extensibility/Package","strings","utils/StringUtils","command/Commands","command/CommandManager","extensibility/InstallExtensionDialog","utils/AppInit","utils/Async","utils/KeyEvent","extensibility/ExtensionManager","extensibility/ExtensionManagerView","extensibility/ExtensionManagerViewModel","text!htmlContent/extension-manager-dialog.html","widgets/bootstrap-tab"],function(e,t){function n(e){e.stopPropagation(),e.preventDefault()}function r(){var e=b.hasExtensionsToRemove(),t=b.hasExtensionsToUpdate();if(e||t){var n=p.CHANGE_AND_RELOAD;e&&!t?n=p.REMOVE_AND_RELOAD:t&&!e&&(n=p.UPDATE_AND_RELOAD);var r=s.showModalDialog(l.DIALOG_ID_CHANGE_EXTENSIONS,p.CHANGE_AND_RELOAD_TITLE,p.CHANGE_AND_RELOAD_MESSAGE,[{className:s.DIALOG_BTN_CLASS_NORMAL,id:s.DIALOG_BTN_CANCEL,text:p.CANCEL},{className:s.DIALOG_BTN_CLASS_PRIMARY,id:s.DIALOG_BTN_OK,text:n}],!1),i=r.getElement();i.one("buttonClick",function(e,t){t===s.DIALOG_BTN_OK?(i.find(".dialog-button").prop("disabled",!0),i.find(".close").hide(),i.find(".dialog-message").text(p.PROCESSING_EXTENSIONS).append("<span class='spinner inline spin'/>"),b.removeMarkedExtensions().done(function(){b.updateExtensions().done(function(){r.close(),m.execute(h.APP_RELOAD)}).fail(function(e){r.close();var t=[];e.forEach(function(e){t.push(e.item),e.error&&e.error.forEach&&(console.error("Errors for ",e.item),e.error.forEach(function(e){console.error(d.formatError(e))}))}),s.showModalDialog(l.DIALOG_ID_ERROR,p.EXTENSION_MANAGER_UPDATE,f.format(p.EXTENSION_MANAGER_UPDATE_ERROR,t.join(", "))).done(function(){m.execute(h.APP_RELOAD)})})}).fail(function(e){r.close(),b.cleanupUpdates();var t=[];e.forEach(function(e){t.push(e.item)}),s.showModalDialog(l.DIALOG_ID_ERROR,p.EXTENSION_MANAGER_REMOVE,f.format(p.EXTENSION_MANAGER_REMOVE_ERROR,t.join(", "))).done(function(){m.execute(h.APP_RELOAD)})})):(r.close(),b.cleanupUpdates(),b.unmarkAllForRemoval())})}}function i(){var e,t=[],n=[],r=new $.Deferred;return brackets.app.getDroppedFiles(function(i,o){return i?(console.error(i),void r.resolve()):(e=y.doInParallel_aggregateErrors(o,function(e){var r=new $.Deferred;return c.resolve(e,function(i,o){var a,s=u.getFileExtension(e),l=o.isFile&&"zip"===s;return i?a=u.getFileErrorString(i):l||(a=p.INVALID_ZIP_FILE),a?void r.reject(a):void d.validate(e,{requirePackageJSON:!0}).done(function(e){if(e.errors.length)return void r.reject(d.formatError(e.errors));var i=e.metadata.name,a=b.extensions[i],s=a&&!!a.installInfo;s?n.push(o):t.push(o),r.resolve()}).fail(function(e){r.reject(d.formatError(e))})}),r.promise()}),void e.done(function(){var e=y.doSequentially(t,function(e){return g.installUsingDialog(e)}),i=e.then(function(){return y.doSequentially(n,function(e){return g.updateUsingDialog(e).done(function(e){b.updateFromDownload(e)})})});i.always(r.resolve)}).fail(function(e){r.reject(e)}))}),r.promise()}function o(){function e(){var e=k[C],t=""===h.val()&&(!e.filterSet||0===e.filterSet.length);return h.prop("disabled",t),m.prop("disabled",t),t}function t(e){k[C].scrollPos=$(".modal-body",d).scrollTop(),e.tab("show"),$(".modal-body",d).scrollTop(k[C].scrollPos||0),m.click()}function o(e){var t=k[e],n=d.find(".nav-tabs li").eq(e).find(".notification");t.notifyCount?(n.text(t.notifyCount),n.show()):n.hide()}var c,d,h,m,v=[],I={Strings:p,showRegistry:!!brackets.config.extension_registry},k=[];I.showRegistry&&(k.push(new w.RegistryViewModel),k.push(new w.ThemesViewModel)),k.push(new w.InstalledViewModel),c=s.showModalDialogUsingTemplate(Mustache.render(S,I)),c.done(function(){k.forEach(function(e){e.dispose()}),r()}),d=c.getElement(),h=$(".search",d),m=$(".search-clear",d),d.find(".nav-tabs a").on("click",function(){t($(this))}),d.on("keyup",function(e){if(e.keyCode===_.DOM_VK_TAB&&e.ctrlKey){var n=$(".nav-tabs a",d),r=C;e.shiftKey?r--:r++,r%=n.length,t(n.eq(r))}});var x=y.doInParallel(k,function(e,t){var n,r=new E,i=r.initialize(e);return i.always(function(){v[t]=r,n=e.notifyCount,o(t)}),$(e).on("change",function(){n!==e.notifyCount&&(n=e.notifyCount,o(t))}),i},!0);x.always(function(){$(".spinner",d).remove(),v.forEach(function(e){e.$el.appendTo($(".modal-body",d))}),$("a[data-toggle='tab']",d).each(function(t,n){$(n).on("show",function(){C=t,e()||d.find(".search").focus()})}),d.on("input",".search",function(){var e=$(this).val();v.forEach(function(t){t.filter(e)})}).on("click",".search-clear",function(){h.val(""),v.forEach(function(e){e.filter("")}),e()||h.focus()}),k.forEach(function(t,n){$(t).on("change",function(){C===n&&e()})}),$("#toolbar-extension-manager").hasClass("updatesAvailable")?d.find(".nav-tabs a.installed").tab("show"):d.find(".nav-tabs a:first").tab("show")}),$(".extension-manager-dialog .install-from-url").click(function(){g.showDialog().done(b.updateFromDownload)});var T=$("#install-drop-zone"),D=$("#install-drop-zone-mask");return T.on("dragover",function(e){if(n(e),e.originalEvent.dataTransfer.files){var t=e.originalEvent.dataTransfer.items,r=!1;r=a.every(t,function(e){if("file"===e.kind){var t=e.webkitGetAsEntry(),n=u.getFileExtension(t.fullPath);return t.isFile&&"zip"===n}return!1}),r?(T.width(T.width()),T.removeClass("drag"),T.addClass("drop")):e.originalEvent.dataTransfer.dropEffect="none"}}).on("drop",n),D.on("dragover",function(e){n(e),e.originalEvent.dataTransfer.dropEffect="copy"}).on("dragleave",function(){T.removeClass("drop"),T.addClass("drag")}).on("drop",function(e){n(e),e.originalEvent.dataTransfer.files&&(i().fail(function(e){var t=p.INSTALL_EXTENSION_DROP_ERROR;t+="<ul class='dialog-list'>",e.forEach(function(e){t+="<li><span class='dialog-filename'>",t+=f.breakableUrl(e.item),t+="</span>: "+e.error+"</li>"}),t+="</ul>",s.showModalDialog(l.DIALOG_ID_ERROR,p.EXTENSION_MANAGER_TITLE,t)}).always(function(){T.removeClass("validating"),T.addClass("drag")}),T.removeClass("drop"),T.addClass("validating"))}),(new $.Deferred).resolve(c).promise()}var a=e("thirdparty/lodash"),s=e("widgets/Dialogs"),l=e("widgets/DefaultDialogs"),c=e("filesystem/FileSystem"),u=e("file/FileUtils"),d=e("extensibility/Package"),p=e("strings"),f=e("utils/StringUtils"),h=e("command/Commands"),m=e("command/CommandManager"),g=e("extensibility/InstallExtensionDialog"),v=e("utils/AppInit"),y=e("utils/Async"),_=e("utils/KeyEvent"),b=e("extensibility/ExtensionManager"),E=e("extensibility/ExtensionManagerView").ExtensionManagerView,w=e("extensibility/ExtensionManagerViewModel"),S=e("text!htmlContent/extension-manager-dialog.html");e("widgets/bootstrap-tab");var C;m.register(p.CMD_EXTENSION_MANAGER,h.FILE_EXTENSION_MANAGER,o),v.appReady(function(){$("#toolbar-extension-manager").click(o)}),t._performChanges=r}),define("text!htmlContent/image-view.html",[],function(){return'<div class="image-view">\n <div class="image-centering">\n <div class="image-header">\n <div class="image-data"></div>\n <div class="image-path"></div> \n </div>\n <div class="image">\n <div class="image-scale"></div>\n <img class="image-preview" src="file:///{{fullPath}}?ver={{now}}">\n <div class="image-tip">\n <table class="tip-container">\n <tr>\n <td class="variable">x: </td>\n <td class="x-value"></td>\n </tr>\n <tr>\n <td class="variable">y: </td>\n <td class="y-value"></td>\n </tr>\n </table>\n </div>\n <div class="horz-guide image-guide"></div>\n <div class="vert-guide image-guide"></div>\n </div>\n </div>\n</div>'}),define("editor/ImageViewer",["require","exports","module","document/DocumentManager","text!htmlContent/image-view.html","project/ProjectManager","language/LanguageManager","view/MainViewFactory","strings","utils/StringUtils","filesystem/FileSystem","file/FileUtils","thirdparty/lodash"],function(e,t){function n(e,t){this.file=e,this.$el=$(Mustache.render(a,{fullPath:e.fullPath,now:(new Date).valueOf()})),t.append(this.$el),this._naturalWidth=0,this._naturalHeight=0,this._scale=100,this._scaleDivInfo=null,this.relPath=s.makeProjectRelativeIfPossible(this.file.fullPath),this.$imagePath=this.$el.find(".image-path"),this.$imagePreview=this.$el.find(".image-preview"),this.$imageData=this.$el.find(".image-data"),this.$image=this.$el.find(".image"),this.$imageTip=this.$el.find(".image-tip"),this.$imageGuides=this.$el.find(".image-guide"),this.$imageScale=this.$el.find(".image-scale"),this.$x_value=this.$el.find(".x-value"),this.$y_value=this.$el.find(".y-value"),this.$horzGuide=this.$el.find(".horz-guide"),this.$vertGuide=this.$el.find(".vert-guide"),this.$imagePath.text(this.relPath).attr("title",this.relPath),this.$imagePreview.on("load",h.bind(this._onImageLoaded,this)),m[e.fullPath]=this
37}function r(e,t){var r=t.getViewForPath(e.fullPath);return r?t.showView(r):(r=new n(e,t.$content),t.addView(r,!0)),(new $.Deferred).resolve().promise()}function i(e,t){if(t&&!t.isDirectory){var n=m[t.fullPath];n&&n.refresh()}}var o=e("document/DocumentManager"),a=e("text!htmlContent/image-view.html"),s=e("project/ProjectManager"),l=e("language/LanguageManager"),c=e("view/MainViewFactory"),u=e("strings"),d=e("utils/StringUtils"),p=e("filesystem/FileSystem"),f=e("file/FileUtils"),h=e("thirdparty/lodash"),m={};n.prototype._onFilenameChange=function(e,t,n){this.file.fullPath===n&&(this.relPath=s.makeProjectRelativeIfPossible(n),this.$imagePath.text(this.relPath).attr("title",this.relPath))},n.prototype._onImageLoaded=function(e){this._naturalWidth=e.currentTarget.naturalWidth,this._naturalHeight=e.currentTarget.naturalHeight;var t=f.getFileExtension(this.file.fullPath),n=this._naturalWidth+" &times; "+this._naturalHeight+" "+u.UNIT_PIXELS;"ico"===t&&(n+=" ("+u.IMAGE_VIEWER_LARGEST_ICON+")");var r=this;this.file.stat(function(e,t){if(e)r.$imageData.html(n);else{var i="";t.size&&(i=" &mdash; "+d.prettyPrintBytes(t.size,2));var o=n+i;r.$imageData.html(o).attr("title",o.replace("&times;","x").replace("&mdash;","-"))}}),$(o).on("fileNameChange",h.bind(this._onFilenameChange,this)),this.$imageTip.hide(),this.$imageGuides.hide(),this.$image.on("mousemove.ImageView",".image-preview",h.bind(this._showImageTip,this)).on("mouseleave.ImageView",".image-preview",h.bind(this._hideImageTip,this)),this._updateScale()},n.prototype._updateScale=function(){var e=this.$imagePreview.width();e&&e<this._naturalWidth?(this._scale=e/this._naturalWidth*100,this.$imageScale.text(Math.floor(this._scale)+"%").css("left",this.$imagePreview.position().left+5).show()):(this._scale=100,this._scaleDivInfo=null,this.$imageScale.text("").hide())},n.prototype._showImageTip=function(e){if(0!==Math.floor(this._scale)){var t=Math.round(100*e.offsetX/this._scale),n=Math.round(100*e.offsetY/this._scale),r=this.$imagePreview.position(),i=e.offsetX+r.left,o=e.offsetY+r.top,a=this.$imagePreview.width(),s=this.$imagePreview.height(),l=$(window).width(),c=4===this._naturalWidth.toString().length,u=112,d=120,p=10,f=-54,h=-82,m=-90;if(0>t||t>=this._naturalWidth||0>n||n>=this._naturalHeight)return this._hideImageTip(e),void this.$imagePreview.css("cursor","auto");this.$imagePreview.css("cursor","none"),this._handleMouseEnterOrExitScaleSticker(i,o),(e.pageX+u>l||c&&e.pageX+d>l)&&(p=c?m:h),this.$x_value.text(t+"px"),this.$y_value.text(n+"px"),this.$imageTip.css({left:i+p,top:o+f}).show(),this.$horzGuide.css({left:r.left,top:o,width:a-1}).show(),this.$vertGuide.css({left:i,top:r.top,height:s-1}).show()}},n.prototype._hideImageTip=function(e){var t=$(e.target),n=t.position(),r=this.$imagePreview.position(),i=r.left+this.$imagePreview.width(),o=r.top+this.$imagePreview.height(),a=n.left+e.offsetX,s=n.top+e.offsetY;(a<r.left||a>=i||s<r.top||s>=o)&&(this._hideGuidesAndTip(),this._scaleDivInfo&&(this._scaleDivInfo=null,this.$imageScale.show()))},n.prototype._hideGuidesAndTip=function(){this.$imageTip.hide(),this.$imageGuides.hide()},n.prototype._handleMouseEnterOrExitScaleSticker=function(e,t){var n,r,i,o,a=this.$imagePreview.position(),s=this.$imageScale.position(),l=this.$imagePreview.width(),c=this.$imagePreview.height();this._scaleDivInfo?(n=this._scaleDivInfo.left,r=this._scaleDivInfo.top,i=this._scaleDivInfo.right,o=this._scaleDivInfo.bottom,l+a.left<i&&(i=l+a.left),c+a.top<o&&(o=c+a.top)):(n=s.left,r=s.top,i=this.$imageScale.width()+n,o=this.$imageScale.height()+r),this._scaleDivInfo?(n>e||e>i||r>t||t>o)&&(this._scaleDivInfo=null,this.$imageScale.show()):e>=n&&i>=e&&t>=r&&o>=t&&e<a.left+l&&t<a.top+c&&(this._scaleDivInfo={left:s.left,top:s.top,right:i,bottom:o},this.$imageScale.hide())},n.prototype.getFile=function(){return this.file},n.prototype.updateLayout=function(){this._hideGuidesAndTip();var e=this.$el.parent(),t=e.position(),n=e.innerWidth(),r=e.innerHeight(),i=e.outerWidth(),o=e.outerHeight();this.$el.css({top:t.top+(o-r)/2,left:t.left+(i-n)/2,width:n,height:r}),this._updateScale()},n.prototype.destroy=function(){delete m[this.file.fullPath],$(o).off("fileNameChange",h.bind(this._onFilenameChange,this)),this.$image.off(".ImageView"),this.$el.remove()},n.prototype.refresh=function(){var e=this.$imagePreview.attr("src"),t=(new Date).valueOf(),n=e.indexOf("?");n>0&&(e=e.slice(0,n)),e=e+"?ver="+t,this.$imagePreview.attr("src",e)},p.on("change",i),c.registerViewFactory({canOpenFile:function(e){var t=l.getLanguageForPath(e);return"image"===t.getId()},openFile:function(e,t){return r(e,t)}}),t.ImageView=n}),define("utils/CollectionUtils",["require","exports","module","thirdparty/lodash"],function(e,t){function n(e,t){return console.warn("CollectionUtils.indexOf is deprecated. Use _.findIndex instead."),a.findIndex(e,t)}function r(e,t){console.warn("CollectionUtils.forEach is deprecated. Use _.forEach instead."),a.forEach(e,t)}function i(e,t){return console.warn("CollectionUtils.some is deprecated. Use _.some instead."),a.some(e,t)}function o(e,t){return console.warn("CollectionUtils.hasProperty is deprecated. Use _.has instead."),a.has(e,t)}var a=e("thirdparty/lodash");t.indexOf=n,t.forEach=r,t.some=i,t.hasProperty=o}),define("project/FileIndexManager",["require","exports","module","project/ProjectManager"],function(e,t){function n(){console.error("Warning: FileIndexManager is deprecated. Use ProjectManager.getAllFiles() instead")}function r(e){if("css"===e)return a.getLanguageFilter("css");if("all"===e)return null;throw new Error("Invalid index name:",e)}function i(e){return n(),a.getAllFiles(r(e))}function o(e,t){n();var i=r(e);return a.getAllFiles(function(e){return i&&!i(e)?!1:e.name===t})}var a=e("project/ProjectManager");t.getFileInfoList=i,t.getFilenameMatches=o}),define("file/NativeFileError",[],function(){var e={};return e.NOT_FOUND_ERR="NotFoundError",e.SECURITY_ERR="SecurityError",e.ABORT_ERR="AbortError",e.NOT_READABLE_ERR="NotReadableError",e.NO_MODIFICATION_ALLOWED_ERR="NoModificationAllowedError",e.INVALID_STATE_ERR="InvalidStateError",e.SYNTAX_ERR="SyntaxError",e.INVALID_MODIFICATION_ERR="InvalidModificationError",e.QUOTA_EXCEEDED_ERR="QuotaExceededError",e.TYPE_MISMATCH_ERR="TypeMismatchError",e.PATH_EXISTS_ERR="PathExistsError",e}),define("file/NativeFileSystem",["require","exports","module","filesystem/FileSystem","filesystem/File","filesystem/Directory","file/NativeFileError"],function(e,t){function n(e,t){console.error("Warning: '"+e+"' is deprecated. Use '"+t+"' instead")}var r=e("filesystem/FileSystem"),i=e("filesystem/File"),o=e("filesystem/Directory"),a=e("file/NativeFileError"),s={showOpenDialog:function(e,t,i,o,a,s,l){n("NativeFileSystem.showOpenDialog()","FileSystem.showOpenDialog()"),r.showOpenDialog(e,t,i,o,a,function(e,t){e?l&&l(e):s(t)})},showSaveDialog:function(e,t,i,o,a){n("NativeFileSystem.showSaveDialog()","FileSystem.showSaveDialog()"),r.showSaveDialog(e,t,i,function(e,t){e?a&&a(e):o(t)})},requestNativeFileSystem:function(e,t,i){n("NativeFileSystem.requestNativeFileSystem()","FileSystem.resolve()"),r.resolve(e,function(e,n){if(e)i(e);else{var r={root:n};t(r)}})},resolveNativeFileSystemPath:function(e,t,i){n("NativeFileSystem.resolveNativeFileSystemPath()","FileSystem.resolve()"),r.resolve(e,function(e,n){e?i(e):t(n)})}};s.FileEntry=function(e){return n("new NativeFileSystem.FileEntry()","FileSystem.getFileForPath()"),r.getFileForPath(e)},s.DirectoryEntry=function(e){return n("new NativeFileSystem.DirectoryEntry()","FileSystem.getDirectoryForPath()"),r.getDirectoryForPath(e)},i.prototype.createWriter=function(e){n("File.createWriter()","File.write()");var t=this;e({write:function(e){var n=this;n.onwritestart&&n.onwritestart(),t.write(e,function(e){e?n.onerror&&n.onerror(e):(n.onwrite&&n.onwrite(),n.onwriteend&&n.onwriteend())})}})},o.prototype.createReader=function(){n("Directory.createReader()","Directory.getContents()");var e=this;return{readEntries:function(t,n){e.getContents(function(e,r){e?n(e):t(r)})}}},o.prototype.getFile=function(e,t,i,o){if(t&&t.create)throw new Error("Directory.getFile() is deprecated and no longer supports 'create: true'. Use File.write(\"\") instead.");n("Directory.getFile()","FileSystem.resolve()"),"/"!==e[0]&&":"!==e[1]&&(e=this.fullPath+e),r.resolve(e,function(e,t){e?o(e):t.isDirectory?o(a.TYPE_MISMATCH_ERR):i(t)})},o.prototype.getDirectory=function(){throw new Error("Directory.getDirectory() has been removed. Use FileSystem.getDirectoryForPath() and/or Directory.create() instead.")},t.NativeFileSystem=s}),define("view/PanelManager",["require","exports","module","view/WorkspaceManager","utils/DeprecationWarning"],function(e,t){function n(e,n){i.deprecateEvent(t,r,e,n,"PanelManager."+e,"MainViewManager."+n)}var r=e("view/WorkspaceManager"),i=e("utils/DeprecationWarning");t.createBottomPanel=function(e,t,n){return i.deprecationWarning("Use WorkspaceManager.createBottomPanel() instead of PanelManager.createBottomPanel().",!0),r.createBottomPanel(e,t,n)},n("editorAreaResize","workspaceUpdateLayout")}),define("brackets",["require","exports","module","widgets/bootstrap-dropdown","widgets/bootstrap-modal","widgets/bootstrap-twipsy-mod","thirdparty/path-utils/path-utils.min","thirdparty/smart-auto-complete-local/jquery.smart_autocomplete","thirdparty/CodeMirror2/addon/fold/xml-fold","thirdparty/CodeMirror2/addon/edit/matchtags","thirdparty/CodeMirror2/addon/edit/matchbrackets","thirdparty/CodeMirror2/addon/edit/closebrackets","thirdparty/CodeMirror2/addon/edit/closetag","thirdparty/CodeMirror2/addon/scroll/scrollpastend","thirdparty/CodeMirror2/addon/selection/active-line","thirdparty/CodeMirror2/addon/selection/mark-selection","thirdparty/CodeMirror2/addon/mode/multiplex","thirdparty/CodeMirror2/addon/mode/overlay","thirdparty/CodeMirror2/addon/search/match-highlighter","thirdparty/CodeMirror2/addon/search/searchcursor","thirdparty/CodeMirror2/keymap/sublime","utils/AppInit","language/LanguageManager","project/ProjectManager","document/DocumentManager","editor/EditorManager","language/JSUtils","project/WorkingSetView","document/DocumentCommandHandlers","project/FileViewController","project/FileSyncManager","command/KeyBindingManager","command/Commands","command/CommandManager","editor/CodeHintManager","utils/PerfUtils","filesystem/FileSystem","command/Menus","text!htmlContent/main-view.html","strings","widgets/Dialogs","widgets/DefaultDialogs","utils/ExtensionLoader","utils/Async","utils/UpdateNotification","utils/UrlParams","preferences/PreferencesManager","utils/ExtensionUtils","utils/DragAndDrop","language/CodeInspection","utils/NativeApp","utils/DeprecationWarning","view/ViewCommandHandlers","view/MainViewManager","utils/Global","editor/CSSInlineEditor","project/WorkingSetSort","search/QuickOpen","file/FileUtils","project/SidebarView","utils/Resizer","LiveDevelopment/main","utils/NodeConnection","utils/NodeDomain","utils/ColorUtils","view/ThemeManager","thirdparty/lodash","thirdparty/CodeMirror2/lib/codemirror","command/DefaultMenus","document/ChangedDocumentTracker","editor/EditorStatusBar","editor/EditorCommandHandlers","editor/EditorOptionHandlers","help/HelpCommandHandlers","search/FindInFilesUI","search/FindReplace","extensibility/InstallExtensionDialog","extensibility/ExtensionManagerDialog","editor/ImageViewer","utils/CollectionUtils","project/FileIndexManager","file/NativeFileSystem","file/NativeFileError","view/PanelManager","language/CSSUtils","document/Document","LiveDevelopment/Agents/DOMAgent","filesystem/File","search/FileFilters","file/FileUtils","search/FindInFiles","search/FindInFilesUI","language/HTMLInstrumentation","LiveDevelopment/Inspector/Inspector","extensibility/InstallExtensionDialog","LiveDevelopment/LiveDevelopment","LiveDevelopment/LiveDevServerManager","view/MainViewFactory","editor/MultiRangeInlineEditor","LiveDevelopment/Agents/RemoteAgent","search/ScrollTrackMarkers","utils/UpdateNotification"],function(e){function t(){brackets.test={CodeHintManager:v,CodeInspection:L,CommandManager:g,Commands:m,CSSUtils:e("language/CSSUtils"),DefaultDialogs:C,Dialogs:S,DocumentCommandHandlers:d,DocumentManager:s,DocumentModule:e("document/Document"),DOMAgent:e("LiveDevelopment/Agents/DOMAgent"),DragAndDrop:O,EditorManager:l,ExtensionLoader:I,ExtensionUtils:M,File:e("filesystem/File"),FileFilters:e("search/FileFilters"),FileSyncManager:f,FileSystem:_,FileViewController:p,FileUtils:e("file/FileUtils"),FindInFiles:e("search/FindInFiles"),FindInFilesUI:e("search/FindInFilesUI"),HTMLInstrumentation:e("language/HTMLInstrumentation"),Inspector:e("LiveDevelopment/Inspector/Inspector"),InstallExtensionDialog:e("extensibility/InstallExtensionDialog"),JSUtils:c,KeyBindingManager:h,LanguageManager:o,LiveDevelopment:e("LiveDevelopment/LiveDevelopment"),LiveDevServerManager:e("LiveDevelopment/LiveDevServerManager"),MainViewManager:P,MainViewFactory:e("view/MainViewFactory"),Menus:b,MultiRangeInlineEditor:e("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,NativeApp:R,PerfUtils:y,PreferencesManager:D,ProjectManager:a,RemoteAgent:e("LiveDevelopment/Agents/RemoteAgent"),ScrollTrackMarkers:e("search/ScrollTrackMarkers"),UpdateNotification:e("utils/UpdateNotification"),WorkingSetView:u,doneLoading:!1},i.appReady(function(){brackets.test.doneLoading=!0})}function n(){y.addMeasurement("window.document Ready");var e=/Mac OS X 10\D([\d+])\D/.exec(navigator.userAgent);if(e&&e[1]&&Number(e[1])>=7){var n=$("<div style='position:fixed;left:-50px;width:50px;height:50px;overflow:auto;'><div style='width:100px;height:100px;'/></div>").appendTo(window.document.body);n.outerWidth()===n.get(0).clientWidth&&$(".sidebar").removeClass("quiet-scrollbars"),n.remove()}k.waitForAll([o.ready,D.ready]).always(function(){var e=U.get("extensions"),n=I.init(e?e.split(","):null);n.always(function(){i._dispatchReady(i.EXTENSIONS_LOADED),N.restoreFontSize();var e=a.getInitialProjectPath();a.openProject(e).always(function(){t();var n=new $.Deferred;U.get("skipSampleProjectLoad")||D.getViewState("afterFirstLaunch")?n.resolve():(D.setViewState("afterFirstLaunch","true"),a.isWelcomeProjectPath(e)?_.resolve(e+"index.html",function(e,t){if(e)n.reject();else{var r=g.execute(m.CMD_ADD_TO_WORKINGSET_AND_OPEN,{fullPath:t.fullPath});r.then(n.resolve,n.reject)}}):n.resolve()),n.always(function(){i._dispatchReady(i.APP_READY),y.addMeasurement("Application Startup"),D._isUserScopeCorrupt()&&S.showModalDialog(C.DIALOG_ID_ERROR,w.ERROR_PREFS_CORRUPT_TITLE,w.ERROR_PREFS_CORRUPT).done(function(){g.execute(m.FILE_OPEN_PREFERENCES)})}),brackets.app.getPendingFilesToOpen&&brackets.app.getPendingFilesToOpen(function(e,t){O.openDroppedFiles(t)})})})}),U.get("skipUpdateCheck")||brackets.inBrowser||i.appReady(function(){x.launchAutomaticUpdate()})}function r(){$("body").addClass("platform-"+brackets.platform),$("body").addClass(brackets.inBrowser?"in-browser":"in-appshell"),brackets.nativeMenus?$("body").addClass("has-appshell-menus"):!function(){var e=$.fn.focus;$.fn.focus=function(){return this.hasClass("dropdown-toggle")?void 0:e.apply(this,arguments)}}(),$("body").html(Mustache.render(E,w)),$("title").text(brackets.config.app_title),$(window.document.body).on("dragover",function(e){var t="none";e.originalEvent.dataTransfer.files&&(e.stopPropagation(),e.preventDefault(),0===$(".modal.instance").length&&O.isValidDrop(e.originalEvent.dataTransfer.items)&&(t="copy"),e.originalEvent.dataTransfer.dropEffect=t)}).on("drop",function(e){e.originalEvent.dataTransfer.files&&(e.stopPropagation(),e.preventDefault(),brackets.app.getDroppedFiles(function(e,t){e||O.openDroppedFiles(t)}))}),$(window).focus(function(){f.syncOpenDocuments()}),$("html").on("mousedown",".inline-widget",function(e){1===e.button&&e.preventDefault()}),$("html").on("mousedown",".no-focus",function(e){var t=$(e.target),n=t.is("input[type=text]")||t.is("input[type=number]")||t.is("input[type=password]")||t.is("input:not([type])")||t.is("textarea")||t.is("select");n||e.preventDefault()}),window.document.body.addEventListener("click",function(e){for(var t,n=e.target;n;){if("A"===n.tagName){t=n.getAttribute("href"),t&&!t.match(/^#/)&&R.openURLInDefaultBrowser(t),e.preventDefault();break}n=n.parentElement}},!0);var e=window.open;window.open=function(){return e.apply(window,arguments)}}e("widgets/bootstrap-dropdown"),e("widgets/bootstrap-modal"),e("widgets/bootstrap-twipsy-mod"),e("thirdparty/path-utils/path-utils.min"),e("thirdparty/smart-auto-complete-local/jquery.smart_autocomplete"),e("thirdparty/CodeMirror2/addon/fold/xml-fold"),e("thirdparty/CodeMirror2/addon/edit/matchtags"),e("thirdparty/CodeMirror2/addon/edit/matchbrackets"),e("thirdparty/CodeMirror2/addon/edit/closebrackets"),e("thirdparty/CodeMirror2/addon/edit/closetag"),e("thirdparty/CodeMirror2/addon/scroll/scrollpastend"),e("thirdparty/CodeMirror2/addon/selection/active-line"),e("thirdparty/CodeMirror2/addon/selection/mark-selection"),e("thirdparty/CodeMirror2/addon/mode/multiplex"),e("thirdparty/CodeMirror2/addon/mode/overlay"),e("thirdparty/CodeMirror2/addon/search/match-highlighter"),e("thirdparty/CodeMirror2/addon/search/searchcursor"),e("thirdparty/CodeMirror2/keymap/sublime");var i=e("utils/AppInit"),o=e("language/LanguageManager"),a=e("project/ProjectManager"),s=e("document/DocumentManager"),l=e("editor/EditorManager"),c=e("language/JSUtils"),u=e("project/WorkingSetView"),d=e("document/DocumentCommandHandlers"),p=e("project/FileViewController"),f=e("project/FileSyncManager"),h=e("command/KeyBindingManager"),m=e("command/Commands"),g=e("command/CommandManager"),v=e("editor/CodeHintManager"),y=e("utils/PerfUtils"),_=e("filesystem/FileSystem"),b=e("command/Menus"),E=e("text!htmlContent/main-view.html"),w=e("strings"),S=e("widgets/Dialogs"),C=e("widgets/DefaultDialogs"),I=e("utils/ExtensionLoader"),k=e("utils/Async"),x=e("utils/UpdateNotification"),T=e("utils/UrlParams").UrlParams,D=e("preferences/PreferencesManager"),M=e("utils/ExtensionUtils"),O=e("utils/DragAndDrop"),L=e("language/CodeInspection"),R=e("utils/NativeApp"),A=e("utils/DeprecationWarning"),N=e("view/ViewCommandHandlers"),P=e("view/MainViewManager");e("utils/Global"),e("editor/CSSInlineEditor"),e("project/WorkingSetSort"),e("search/QuickOpen"),e("file/FileUtils"),e("project/SidebarView"),e("utils/Resizer"),e("LiveDevelopment/main"),e("utils/NodeConnection"),e("utils/NodeDomain"),e("utils/ColorUtils"),e("view/ThemeManager"),e("thirdparty/lodash");var F=e("thirdparty/CodeMirror2/lib/codemirror");Object.defineProperty(window,"CodeMirror",{get:function(){return A.deprecationWarning('Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.',!0),F}}),e("command/DefaultMenus"),e("document/ChangedDocumentTracker"),e("editor/EditorStatusBar"),e("editor/EditorCommandHandlers"),e("editor/EditorOptionHandlers"),e("help/HelpCommandHandlers"),e("search/FindInFilesUI"),e("search/FindReplace"),e("extensibility/InstallExtensionDialog"),e("extensibility/ExtensionManagerDialog"),e("editor/ImageViewer"),e("utils/CollectionUtils"),e("project/FileIndexManager"),e("file/NativeFileSystem"),e("file/NativeFileError"),e("view/PanelManager"),y.addMeasurement("brackets module dependencies resolved");var U=new T;U.parse();var j=y.markStart("User viewstate loading");D._smUserScopeLoading.always(function(){y.addMeasurement(j),r(),i._dispatchReady(i.HTML_READY),$(window.document).ready(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/apl/apl",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("apl",function(){var e={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},t={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},n=/[\.\/⌿⍀¨⍣]/,r=/⍬/,i=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,o=/←/,a=/[⍝#].*$/,s=function(e){var t;return t=!1,function(n){return t=n,n===e?"\\"===t:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(l,c){var u,d,p;return l.eatSpace()?null:(u=l.next(),'"'===u||"'"===u?(l.eatWhile(s(u)),l.next(),c.prev=!0,"string"):/[\[{\(]/.test(u)?(c.prev=!1,null):/[\]}\)]/.test(u)?(c.prev=!0,null):r.test(u)?(c.prev=!1,"niladic"):/[¯\d]/.test(u)?(c.func?(c.func=!1,c.prev=!1):c.prev=!0,l.eatWhile(/[\w\.]/),"number"):n.test(u)?"operator apl-"+e[u]:o.test(u)?"apl-arrow":i.test(u)?(d="apl-",null!=t[u]&&(d+=c.prev?t[u][1]:t[u][0]),c.func=!0,c.prev=!1,"function "+d):a.test(u)?(l.skipToEnd(),"comment"):"∘"===u&&"."===l.peek()?(l.next(),"function jot-dot"):(l.eatWhile(/[\w\$_]/),p=l.current(),c.prev=!0,"keyword"))}}}),e.defineMIME("text/apl","apl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/asterisk/asterisk",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("asterisk",function(){function e(e,r){var i="",o="";if(o=e.next(),";"==o)return e.skipToEnd(),"comment";if("["==o)return e.skipTo("]"),e.eat("]"),"header";if('"'==o)return e.skipTo('"'),"string";if("'"==o)return e.skipTo("'"),"string-2";if("#"==o&&(e.eatWhile(/\w/),i=e.current(),-1!==n.indexOf(i)))return e.skipToEnd(),"strong";if("$"==o){var a=e.peek();if("{"==a)return e.skipTo("}"),e.eat("}"),"variable-3"}if(e.eatWhile(/\w/),i=e.current(),-1!==t.indexOf(i)){switch(r.extenStart=!0,i){case"same":r.extenSame=!0;break;case"include":case"switch":case"ignorepat":r.extenInclude=!0}return"atom"}}var t=["exten","same","include","ignorepat","switch"],n=["#include","#exec"],r=["addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi","alarmreceiver","amd","answer","authenticate","background","backgrounddetect","bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent","changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge","congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge","dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility","datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa","dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy","externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif","goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete","ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus","jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme","meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete","minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode","mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish","originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce","parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones","privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten","readfile","receivefax","receivefax","receivefax","record","removequeuemember","resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun","saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax","sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags","setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel","slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground","speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound","speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor","stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec","trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate","vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring","waitforsilence","waitmusiconhold","waituntil","while","zapateller"];return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(t,n){var i="",o="";return t.eatSpace()?null:n.extenStart?(t.eatWhile(/[^\s]/),i=t.current(),/^=>?$/.test(i)?(n.extenExten=!0,n.extenStart=!1,"strong"):(n.extenStart=!1,t.skipToEnd(),"error")):n.extenExten?(n.extenExten=!1,n.extenPriority=!0,t.eatWhile(/[^,]/),n.extenInclude&&(t.skipToEnd(),n.extenPriority=!1,n.extenInclude=!1),n.extenSame&&(n.extenPriority=!1,n.extenSame=!1,n.extenApplication=!0),"tag"):n.extenPriority?(n.extenPriority=!1,n.extenApplication=!0,o=t.next(),n.extenSame?null:(t.eatWhile(/[^,]/),"number")):n.extenApplication?(t.eatWhile(/,/),i=t.current(),","===i?null:(t.eatWhile(/\w/),i=t.current().toLowerCase(),n.extenApplication=!1,-1!==r.indexOf(i)?"def strong":null)):e(t,n)}}}),e.defineMIME("text/x-asterisk","asterisk")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/clike/clike",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=n;break}}return"meta"}function r(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return n?(t.cpp11RawStringDelim=n[1],t.tokenize=o,o(e,t)):!1}return e.match(/(u8|u|U|L)/)?e.match(/["']/,!1)?"string":!1:(e.next(),!1)}function i(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function o(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function a(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}e.defineMode("clike",function(t,n){function r(e,t){var n=e.next();if(v[n]){var r=v[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return c=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(_.test(n))return e.eatWhile(_),"operator";e.eatWhile(/[\w\$_]/);var a=e.current();return f.propertyIsEnumerable(a)?(m.propertyIsEnumerable(a)&&(c="newstatement"),"keyword"):h.propertyIsEnumerable(a)?(m.propertyIsEnumerable(a)&&(c="newstatement"),"builtin"):g.propertyIsEnumerable(a)?"atom":"variable"}function i(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!y)&&(n.tokenize=null),"string"}}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function a(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e,t,n){var r=e.indented;return e.context&&"statement"==e.context.type&&(r=e.context.indented),e.context=new a(r,t,n,null,e.context)}function l(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u=t.indentUnit,d=n.statementIndentUnit||u,p=n.dontAlignCalls,f=n.keywords||{},h=n.builtin||{},m=n.blockKeywords||{},g=n.atoms||{},v=n.hooks||{},y=n.multiLineStrings,_=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=n.type)if("{"==c)s(t,e.column(),"}");else if("["==c)s(t,e.column(),"]");else if("("==c)s(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=l(t);for("}"==n.type&&(n=l(t));"statement"==n.type;)n=l(t)}else c==n.type?l(t):(("}"==n.type||"top"==n.type)&&";"!=c||"statement"==n.type&&"newstatement"==c)&&s(t,e.column(),"statement");else l(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:d):!i.align||p&&")"==i.type?")"!=i.type||a?i.indented+(a?0:u):i.indented+d:i.column+(a?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";a(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(s),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),a(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(s+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":n,u:r,U:r,L:r,R:r},modeProps:{fold:["brace","include"]}}),a("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),a("text/x-csharp",{name:"clike",keywords:t("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=i,i(e,t)):(e.eatWhile(/[\w\$_]/),"meta")
38}}}),a("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}}),a(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadowconst attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smootstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),a("text/x-nesc",{name:"clike",keywords:t(s+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":n},modeProps:{fold:["brace","include"]}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/clojure/clojure",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,n){this.indent=e,this.type=t,this.prev=n}function r(e,t,r){e.indentStack=new n(t,r,e.indentStack)}function i(e){e.indentStack=e.indentStack.prev}function o(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(E.hex),!0):("+"!=e&&"-"!=e||!E.digit.test(t.peek())||(t.eat(E.sign),e=t.next()),E.digit.test(e)?(t.eat(e),t.eatWhile(E.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(E.digit)),t.eat(E.exponent)&&(t.eat(E.sign),t.eatWhile(E.digit)),!0):!1)}function a(e){var t=e.next();t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)||"u"===t&&e.match(/[0-9a-z]{4}/i,!0)}var s="builtin",l="comment",c="string",u="string-2",d="atom",p="number",f="bracket",h="keyword",m=e.indentUnit||2,g=e.indentUnit||2,v=t("true false nil"),y=t("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),_=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),b=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),E={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var w,S=!1;null!=(w=e.next());){if('"'==w&&!S){t.mode=!1;break}S=!S&&"\\"==w}n=c;break;default:var C=e.next();if('"'==C)t.mode="string",n=c;else if("\\"==C)a(e),n=u;else if("'"!=C||E.digit_or_colon.test(e.peek()))if(";"==C)e.skipToEnd(),n=l;else if(o(C,e))n=p;else if("("==C||"["==C||"{"==C){var I,k="",x=e.column();if("("==C)for(;null!=(I=e.eat(E.keyword_char));)k+=I;k.length>0&&(b.propertyIsEnumerable(k)||/^(?:def|with)/.test(k))?r(t,x+m,C):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,x+g,C):r(t,x+e.current().length,C)),e.backUp(e.current().length-1),n=f}else if(")"==C||"]"==C||"}"==C)n=f,null!=t.indentStack&&t.indentStack.type==(")"==C?"(":"]"==C?"[":"{")&&i(t);else{if(":"==C)return e.eatWhile(E.symbol),d;e.eatWhile(E.symbol),n=y&&y.propertyIsEnumerable(e.current())?h:_&&_.propertyIsEnumerable(e.current())?s:v&&v.propertyIsEnumerable(e.current())?d:null}else n=d}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/cobol/cobol",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("cobol",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(h.hex),!0):("+"!=e&&"-"!=e||!h.digit.test(t.peek())||(t.eat(h.sign),e=t.next()),h.digit.test(e)?(t.eat(e),t.eatWhile(h.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(h.digit)),t.eat(h.exponent)&&(t.eat(h.sign),t.eatWhile(h.digit)),!0):!1)}var n="builtin",r="comment",i="string",o="atom",a="number",s="keyword",l="header",c="def",u="link",d=e("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "),p=e("ACCEPT ACCESS ACQUIRE ADD ADDRESS ADVANCING AFTER ALIAS ALL ALPHABET ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALSO ALTER ALTERNATE AND ANY ARE AREA AREAS ARITHMETIC ASCENDING ASSIGN AT ATTRIBUTE AUTHOR AUTO AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP BEFORE BELL BINARY BIT BITS BLANK BLINK BLOCK BOOLEAN BOTTOM BY CALL CANCEL CD CF CH CHARACTER CHARACTERS CLASS CLOCK-UNITS CLOSE COBOL CODE CODE-SET COL COLLATING COLUMN COMMA COMMIT COMMITMENT COMMON COMMUNICATION COMP COMP-0 COMP-1 COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS CONVERTING COPY CORR CORRESPONDING COUNT CRT CRT-UNDER CURRENCY CURRENT CURSOR DATA DATE DATE-COMPILED DATE-WRITTEN DAY DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION DOWN DROP DUPLICATE DUPLICATES DYNAMIC EBCDIC EGI EJECT ELSE EMI EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING END-WRITE END-XML ENTER ENTRY ENVIRONMENT EOP EQUAL EQUALS ERASE ERROR ESI EVALUATE EVERY EXCEEDS EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL FILE-STREAM FILES FILLER FINAL FIND FINISH FIRST FOOTING FOR FOREGROUND-COLOR FOREGROUND-COLOUR FORMAT FREE FROM FULL FUNCTION GENERATE GET GIVING GLOBAL GO GOBACK GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL ID IDENTIFICATION IF IN INDEX INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED INDIC INDICATE INDICATOR INDICATORS INITIAL INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT INSTALLATION INTO INVALID INVOKE IS JUST JUSTIFIED KANJI KEEP KEY LABEL LAST LD LEADING LEFT LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE LOCALE LOCALLY LOCK MEMBER MEMORY MERGE MESSAGE METACLASS MODE MODIFIED MODIFY MODULES MOVE MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE NEXT NO NO-ECHO NONE NOT NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS OF OFF OMITTED ON ONLY OPEN OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL PADDING PAGE PAGE-COUNTER PARSE PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE PREFIX PRESENT PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID PROMPT PROTECTED PURGE QUEUE QUOTE QUOTES RANDOM RD READ READY REALM RECEIVE RECONNECT RECORD RECORD-NAME RECORDS RECURSIVE REDEFINES REEL REFERENCE REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE REMAINDER REMOVAL RENAMES REPEATED REPLACE REPLACING REPORT REPORTING REPORTS REPOSITORY REQUIRED RERUN RESERVE RESET RETAINING RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO REVERSED REWIND REWRITE RF RH RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED RUN SAME SCREEN SD SEARCH SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SHARED SIGN SIZE SKIP1 SKIP2 SKIP3 SORT SORT-MERGE SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 START STARTING STATUS STOP STORE STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT TABLE TALLYING TAPE TENANT TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TITLE TO TOP TRAILING TRAILING-SIGN TRANSACTION TYPE TYPEDEF UNDERLINE UNEQUAL UNIT UNSTRING UNTIL UP UPDATE UPON USAGE USAGE-MODE USE USING VALID VALIDATE VALUE VALUES VARYING VLR WAIT WHEN WHEN-COMPILED WITH WITHIN WORDS WORKING-STORAGE WRITE XML XML-CODE XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL "),f=e("- * ** / + < <= = > >= "),h={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,m){if(null==m.indentStack&&e.sol()&&(m.indentation=6),e.eatSpace())return null;var g=null;switch(m.mode){case"string":for(var v=!1;null!=(v=e.next());)if('"'==v||"'"==v){m.mode=!1;break}g=i;break;default:var y=e.next(),_=e.column();if(_>=0&&5>=_)g=c;else if(_>=72&&79>=_)e.skipToEnd(),g=l;else if("*"==y&&6==_)e.skipToEnd(),g=r;else if('"'==y||"'"==y)m.mode="string",g=i;else if("'"!=y||h.digit_or_colon.test(e.peek()))if("."==y)g=u;else if(t(y,e))g=a;else{if(e.current().match(h.symbol))for(;71>_&&void 0!==e.eat(h.symbol);)_++;g=p&&p.propertyIsEnumerable(e.current().toUpperCase())?s:f&&f.propertyIsEnumerable(e.current().toUpperCase())?n:d&&d.propertyIsEnumerable(e.current().toUpperCase())?o:null}else g=o}return g},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent}}}),e.defineMIME("text/x-cobol","cobol")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/coffeescript/coffeescript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("coffeescript",function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var o=e.indentation();return o>n&&"coffee"==t.scope.type?"indent":n>o?"dedent":null}n>0&&a(e,t)}if(e.eatSpace())return null;var s=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=i,t.tokenize(e,t);if("#"===s)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var h=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(h=!0),e.match(/^-?\d+\.\d*/)&&(h=!0),e.match(/^-?\.\d+/)&&(h=!0),h)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(v))return t.tokenize=r(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(y)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=r(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(c)||e.match(f)?"operator":e.match(u)?"punctuation":e.match(b)?"atom":e.match(g)?"keyword":e.match(d)?"variable":e.match(p)?"property":(e.next(),l)}function r(t,r,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),r&&o.eol())return i}else{if(o.match(t))return a.tokenize=n,i;o.eat(/['"\/]/)}return r&&(e.mode.singleLineStringErrors?i=l:a.tokenize=n),i}}function i(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=n;break}e.eatWhile("#")}return"comment"}function o(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,s=n.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){i=s.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function a(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":l;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||o(e,t);var i="[({".indexOf(r);if(-1!==i&&o(e,t,"])}".slice(i,i+1)),h.exec(r)&&o(e,t),"then"==r&&a(e,t),"dedent"===n&&a(e,t))return l;if(i="])}".indexOf(r),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var l="error",c=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,f=t(["and","or","not","is","isnt","in","instanceof","typeof"]),h=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],m=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until","extends"],g=t(h.concat(m));h=t(h);var v=/^('{3}|\"{3}|['\"])/,y=/^(\/{3}|\/)/,_=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],b=t(_),E={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=s(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==r.type&&r.prev;)r=r.prev;var o=i&&r.type===t.charAt(0);return r.align?r.alignOffset-(o?1:0):(o?r.prev:r).offset},lineComment:"#",fold:"indent"};return E}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/commonlisp/commonlisp",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("commonlisp",function(e){function t(e){for(var t;t=e.next();)if("\\"==t)e.next();else if(!l.test(t)){e.backUp(1);break}return e.current()}function n(e,n){if(e.eatSpace())return o="ws",null;if(e.match(s))return"number";var a=e.next();if("\\"==a&&(a=e.next()),'"'==a)return(n.tokenize=r)(e,n);if("("==a)return o="open","bracket";if(")"==a||"]"==a)return o="close","bracket";if(";"==a)return e.skipToEnd(),o="ws","comment";if(/['`,@]/.test(a))return null;if("|"==a)return e.skipTo("|")?(e.next(),"symbol"):(e.skipToEnd(),"error");if("#"==a){var a=e.next();return"["==a?(o="open","bracket"):/[+\-=\.']/.test(a)?null:/\d/.test(a)&&e.match(/^\d*#/)?null:"|"==a?(n.tokenize=i)(e,n):":"==a?(t(e),"meta"):"error"}var l=t(e);return"."==l?null:(o="symbol","nil"==l||"t"==l?"atom":":"==l.charAt(0)?"keyword":"&"==l.charAt(0)?"variable-2":"variable")}function r(e,t){for(var r,i=!1;r=e.next();){if('"'==r&&!i){t.tokenize=n;break}i=!i&&"\\"==r}return"string"}function i(e,t){for(var r,i;r=e.next();){if("#"==r&&"|"==i){t.tokenize=n;break}i=r}return o="ws","comment"}var o,a=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,s=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,l=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},tokenize:n}},token:function(t,n){t.sol()&&"number"!=typeof n.ctx.indentTo&&(n.ctx.indentTo=n.ctx.start+1),o=null;var r=n.tokenize(t,n);return"ws"!=o&&(null==n.ctx.indentTo?n.ctx.indentTo="symbol"==o&&a.test(t.current())?n.ctx.start+e.indentUnit:"next":"next"==n.ctx.indentTo&&(n.ctx.indentTo=t.column())),"open"==o?n.ctx={prev:n.ctx,start:t.column(),indentTo:null}:"close"==o&&(n.ctx=n.ctx.prev||n.ctx),r},indent:function(e){var t=e.ctx.indentTo;return"number"==typeof t?t:e.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),e.defineMIME("text/x-common-lisp","commonlisp")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/css/css",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}function r(e,t){return e.skipTo("-->")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return f=t,e}function i(e,t){var n=e.next();if(g[n]){var i=g[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match("rl(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:o(")"),r(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n){return e.context=new s(n,t.indentation()+m,e.context),n}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,n){return I[n.context.type](e,t,n)}function d(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function p(e){var t=e.current().toLowerCase();h=w.hasOwnProperty(t)?"atom":E.hasOwnProperty(t)?"keyword":"variable"}n.propertyKeywords||(n=e.resolveMode("text/css"));var f,h,m=t.indentUnit,g=n.tokenHooks,v=n.mediaTypes||{},y=n.mediaFeatures||{},_=n.propertyKeywords||{},b=n.nonStandardPropertyKeywords||{},E=n.colorKeywords||{},w=n.valueKeywords||{},S=n.fontProperties||{},C=n.allowNested,I={};return I.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if("@media"==e)return l(n,t,"media");if("@font-face"==e)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(C&&"("==e)return l(n,t,"parens")}return n.context.type},I.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return _.hasOwnProperty(r)?(h="property","maybeprop"):b.hasOwnProperty(r)?(h="string-2","maybeprop"):C?(h=t.match(/^\s*:/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":C||"hash"!=e&&"qualifier"!=e?I.top(e,t,n):(h="error","block")},I.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},I.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&C)return l(n,t,"propBlock");if("}"==e||"{"==e)return d(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)p(t);else if("interpolation"==e)return l(n,t,"interpolation")}else h+=" error";return"prop"},I.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(h="property","maybeprop"):n.context.type},I.parens=function(e,t,n){return"{"==e||"}"==e?d(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):("word"==e&&p(t),"parens")},I.pseudo=function(e,t,n){return"word"==e?(h="variable-3",n.context.type):u(e,t,n)},I.media=function(e,t,n){if("("==e)return l(n,t,"media_parens");if("}"==e)return d(e,t,n);if("{"==e)return c(n)&&l(n,t,C?"block":"top");if("word"==e){var r=t.current().toLowerCase();h="only"==r||"not"==r||"and"==r?"keyword":v.hasOwnProperty(r)?"attribute":y.hasOwnProperty(r)?"property":"error"}return n.context.type},I.media_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?d(e,t,n,2):I.media(e,t,n)},I.font_face_before=function(e,t,n){return"{"==e?l(n,t,"font_face"):u(e,t,n)},I.font_face=function(e,t,n){return"}"==e?c(n):"word"==e?(h=S.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},I.keyframes=function(e,t,n){return"word"==e?(h="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},I.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?d(e,t,n):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},I.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?d(e,t,n):("variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",context:new s("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(f=n[1],n=n[0]),h=n,t.state=I[t.state](f,e,t),h},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),!n.prev||("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"font_face"!=n.type)&&(")"!=r||"parens"!=n.type&&"media_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"media"!=n.type)||(i=n.indent-m,n=n.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],s=t(a),l=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],c=t(l),u=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],d=t(u),p=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],f=t(p),h=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],m=t(h),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],v=t(g),y=i.concat(a).concat(l).concat(u).concat(p).concat(h);
39e.registerHelper("hintWords","css",y),e.defineMIME("text/css",{mediaTypes:o,mediaFeatures:s,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:f,valueKeywords:m,fontProperties:v,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=r,r(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:f,valueKeywords:m,fontProperties:v,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:f,valueKeywords:m,fontProperties:v,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/cypher/cypher",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};e.defineMode("cypher",function(n){var r,i=function(e){var t=e.next(),n=null;if('"'===t||"'"===t)return e.match(/.+?["']/),"string";if(/[{}\(\),\.;\[\]]/.test(t))return n=t,"node";if("/"===t&&e.eat("/"))return e.skipToEnd(),"comment";if(d.test(t))return e.eatWhile(d),null;if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var r=e.current();return l.test(r)?"builtin":c.test(r)?"def":u.test(r)?"keyword":"variable"},o=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},a=function(e){return e.indent=e.context.indent,e.context=e.context.prev},s=n.indentUnit,l=t(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","right","round","rtrim","shortestPath","sign","sin","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","trim","type","upper"]),c=t(["all","and","any","has","in","none","not","or","single","xor"]),u=t(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","distinct","drop","else","end","false","fieldterminator","foreach","from","headers","in","index","is","limit","load","match","merge","null","on","optional","order","periodic","remove","return","scan","set","skip","start","then","true","union","unique","unwind","using","when","where","with"]),d=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:i,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!==n&&t.context&&null==t.context.align&&"pattern"!==t.context.type&&(t.context.align=!0),"("===r)o(t,")",e.column());else if("["===r)o(t,"]",e.column());else if("{"===r)o(t,"}",e.column());else if(/[\]\}\)]/.test(r)){for(;t.context&&"pattern"===t.context.type;)a(t);t.context&&r===t.context.type&&a(t)}else"."===r&&t.context&&"pattern"===t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?o(t,"pattern",e.column()):"pattern"!==t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(t,n){var r=n&&n.charAt(0),i=t.context;if(/[\]\}]/.test(r))for(;i&&"pattern"===i.type;)i=i.prev;var o=i&&r===i.type;return i?"keywords"===i.type?e.commands.newlineAndIndent:i.align?i.col+(o?0:1):i.indent+(o?0:s):0}}}),e.modeExtensions.cypher={autoFormatLineBreaks:function(e){for(var t,n,r,n=e.split("\n"),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,t=0;t<n.length;t++)n[t]=n[t].replace(r," \n$1 ").trim();return n.join("\n")}},e.defineMIME("application/x-cypher-query","cypher")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/d/d",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}e.defineMode("d",function(t,n){function r(e,t){var n=e.next();if(v[n]){var r=v[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n||"`"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return u=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("+"))return t.tokenize=o,a(e,t);if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(_.test(n))return e.eatWhile(_),"operator";e.eatWhile(/[\w\$_]/);var s=e.current();return f.propertyIsEnumerable(s)?(m.propertyIsEnumerable(s)&&(u="newstatement"),"keyword"):h.propertyIsEnumerable(s)?(m.propertyIsEnumerable(s)&&(u="newstatement"),"builtin"):g.propertyIsEnumerable(s)?"atom":"variable"}function i(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!y)&&(n.tokenize=null),"string"}}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="+"==n}return"comment"}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e,t,n){var r=e.indented;return e.context&&"statement"==e.context.type&&(r=e.context.indented),e.context=new s(r,t,n,null,e.context)}function c(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var u,d=t.indentUnit,p=n.statementIndentUnit||d,f=n.keywords||{},h=n.builtin||{},m=n.blockKeywords||{},g=n.atoms||{},v=n.hooks||{},y=n.multiLineStrings,_=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new s((e||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;u=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u&&","!=u||"statement"!=n.type)if("{"==u)l(t,e.column(),"}");else if("["==u)l(t,e.column(),"]");else if("("==u)l(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=c(t);for("}"==n.type&&(n=c(t));"statement"==n.type;)n=c(t)}else u==n.type?c(t):(("}"==n.type||"top"==n.type)&&";"!=u||"statement"==n.type&&"newstatement"==u)&&l(t,e.column(),"statement");else c(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:p):i.align?i.column+(a?0:1):i.indented+(a?0:d)},electricChars:"{}"}});var n="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";e.defineMIME("text/x-d",{name:"d",keywords:t("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+n),blockKeywords:t(n),builtin:t("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:t("exit failure success true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/diff/diff",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("diff",function(){var e={"+":"positive","-":"negative","@":"meta"};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||0===n)return t.skipToEnd(),("error "+(e[t.string.charAt(0)]||"")).replace(/ $/,"");var r=e[t.peek()]||t.skipToEnd();return-1===n?t.skipToEnd():t.pos=n,r}}}),e.defineMIME("text/x-diff","diff")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("xml",function(t,n){function r(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(a("atom","]]>")):null:e.match("--")?n(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(s(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(S=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==r){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=r,S=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return S="equals",null;if("<"==n){t.tokenize=r,t.state=d,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=o(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=r;break}n.next()}return e}}function s(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=s(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=r;break}return n.tokenize=s(e-1),n.tokenize(t,n)}}return"meta"}}function l(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(I.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!I.contextGrabbers.hasOwnProperty(n)||!I.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?f:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),C="tag",g):(C="error",p)}function f(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&I.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==r?(C="tag",h):(C="tag error",m)}return C="error",m}function h(e,t,n){return"endTag"!=e?(C="error",h):(c(n),d)}function m(e,t,n){return C="error",h(e,t,n)}function g(e,t,n){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||I.autoSelfClosers.hasOwnProperty(r)?u(n,r):(u(n,r),n.context=new l(n,r,i==n.indented)),d}return C="error",g}function v(e,t,n){return"equals"==e?y:(I.allowMissing||(C="error"),g(e,t,n))}function y(e,t,n){return"string"==e?_:"word"==e&&I.allowUnquoted?(C="string",g):(C="error",g(e,t,n))}function _(e,t,n){return"string"==e?_:g(e,t,n)}var b=t.indentUnit,E=n.multilineTagIndentFactor||1,w=n.multilineTagIndentPastTag;null==w&&(w=!0);var S,C,I=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},k=n.alignCDATA;return{startState:function(){return{tokenize:r,state:d,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;S=null;var n=t.tokenize(e,t);return(n||S)&&"comment"!=n&&(C=null,t.state=t.state(S||n,e,t),C&&(n="error"==C?n+" error":C)),n},indent:function(t,n,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+b;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return w?t.tagStart+t.tagName.length+2:t.tagStart+b*E;if(k&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;a;){if(a.tagName==s[2]){a=a.prev;break}if(!I.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(s)for(;a;){var l=I.contextGrabbers[a.tagName];if(!l||!l.hasOwnProperty(s[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+b:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/javascript/javascript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return ht=e,mt=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=a(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=s,s(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(r(e),e.eatWhile(/[gimy]/),i("regexp","string-2")):(e.eatWhile(St),i("operator","operator",e.current()));if("`"==n)return t.tokenize=l,l(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if(St.test(n))return e.eatWhile(St),i("operator","operator",e.current());if(Et.test(n)){e.eatWhile(Et);var o=e.current(),c=wt.propertyIsEnumerable(o)&&wt[o];return c&&"."!=t.lastType?i(c.type,c.style,o):i("variable","variable",o)}}function a(e){return function(t,n){var r,a=!1;if(yt&&"@"==t.peek()&&t.match(Ct))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;return a||(n.tokenize=o),i("string","string")}}function s(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),s=It.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Et.test(a))i=!0;else if(i&&!r){++o;break}}i&&!r&&(t.fatArrowAt=o)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,i){var o=e.cc;for(xt.state=e,xt.stream=i,xt.marked=null,xt.cc=o,xt.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():_t?w:E;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return xt.marked?xt.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function f(){for(var e=arguments.length-1;e>=0;e--)xt.cc.push(arguments[e])}function h(){return f.apply(null,arguments),!0}function m(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=xt.state;if(r.context){if(xt.marked="def",t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function g(){xt.state.context={prev:xt.state.context,vars:xt.state.localVars},xt.state.localVars=Tt}function v(){xt.state.localVars=xt.state.context.vars,xt.state.context=xt.state.context.prev}function y(e,t){var n=function(){var n=xt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,xt.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function _(){var e=xt.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function b(e){function t(n){return n==e?h():";"==e?f():h(t)}return t}function E(e,t){return"var"==e?h(y("vardef",t.length),W,b(";"),_):"keyword a"==e?h(y("form"),w,E,_):"keyword b"==e?h(y("form"),E,_):"{"==e?h(y("}"),j,_):";"==e?h():"if"==e?("else"==xt.state.lexical.info&&xt.state.cc[xt.state.cc.length-1]==_&&xt.state.cc.pop()(),h(y("form"),w,E,_,K)):"function"==e?h(et):"for"==e?h(y("form"),X,E,_):"variable"==e?h(y("stat"),R):"switch"==e?h(y("form"),w,y("}","switch"),b("{"),j,_,_):"case"==e?h(w,b(":")):"default"==e?h(b(":")):"catch"==e?h(y("form"),g,b("("),tt,b(")"),E,_,v):"module"==e?h(y("form"),g,at,v,_):"class"==e?h(y("form"),nt,_):"export"==e?h(y("form"),st,_):"import"==e?h(y("form"),lt,_):f(y("stat"),w,b(";"),_)}function w(e){return C(e,!1)}function S(e){return C(e,!0)}function C(e,t){if(xt.state.fatArrowAt==xt.stream.start){var n=t?L:O;if("("==e)return h(g,y(")"),$(H,")"),_,b("=>"),n,v);if("variable"==e)return f(g,H,b("=>"),n,v)}var r=t?T:x;return kt.hasOwnProperty(e)?h(r):"function"==e?h(et,r):"keyword c"==e?h(t?k:I):"("==e?h(y(")"),I,ft,b(")"),_,r):"operator"==e||"spread"==e?h(t?S:w):"["==e?h(y("]"),dt,_,r):"{"==e?U(N,"}",null,r):"quasi"==e?f(D,r):h()}function I(e){return e.match(/[;\}\)\],]/)?f():f(w)}function k(e){return e.match(/[;\}\)\],]/)?f():f(S)}function x(e,t){return","==e?h(w):T(e,t,!1)}function T(e,t,n){var r=0==n?x:T,i=0==n?w:S;return"=>"==e?h(g,n?L:O,v):"operator"==e?/\+\+|--/.test(t)?h(r):"?"==t?h(w,b(":"),i):h(i):"quasi"==e?f(D,r):";"!=e?"("==e?U(S,")","call",r):"."==e?h(A,r):"["==e?h(y("]"),I,b("]"),_,r):void 0:void 0}function D(e,t){return"quasi"!=e?f():"${"!=t.slice(t.length-2)?h(D):h(w,M)}function M(e){return"}"==e?(xt.marked="string-2",xt.state.tokenize=l,h(D)):void 0}function O(e){return c(xt.stream,xt.state),f("{"==e?E:w)}function L(e){return c(xt.stream,xt.state),f("{"==e?E:S)}function R(e){return":"==e?h(_,E):f(x,b(";"),_)}function A(e){return"variable"==e?(xt.marked="property",h()):void 0}function N(e,t){return"variable"==e||"keyword"==xt.style?(xt.marked="property",h("get"==t||"set"==t?P:F)):"number"==e||"string"==e?(xt.marked=yt?"property":xt.style+" property",h(F)):"jsonld-keyword"==e?h(F):"["==e?h(w,b("]"),F):void 0}function P(e){return"variable"!=e?f(F):(xt.marked="property",h(et))}function F(e){return":"==e?h(S):"("==e?f(et):void 0}function $(e,t){function n(r){if(","==r){var i=xt.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),h(e,n)}return r==t?h():h(b(t))}return function(r){return r==t?h():f(e,n)}}function U(e,t,n){for(var r=3;r<arguments.length;r++)xt.cc.push(arguments[r]);return h(y(t,n),$(e,t),_)}function j(e){return"}"==e?h():f(E,j)}function V(e){return bt&&":"==e?h(B):void 0}function B(e){return"variable"==e?(xt.marked="variable-3",h()):void 0}function W(){return f(H,V,z,G)}function H(e,t){return"variable"==e?(m(t),h()):"["==e?U(H,"]"):"{"==e?U(q,"}"):void 0}function q(e,t){return"variable"!=e||xt.stream.match(/^\s*:/,!1)?("variable"==e&&(xt.marked="property"),h(b(":"),H,z)):(m(t),h(z))}function z(e,t){return"="==t?h(S):void 0}function G(e){return","==e?h(W):void 0}function K(e,t){return"keyword b"==e&&"else"==t?h(y("form","else"),E,_):void 0}function X(e){return"("==e?h(y(")"),Y,b(")"),_):void 0}function Y(e){return"var"==e?h(W,b(";"),J):";"==e?h(J):"variable"==e?h(Q):f(w,b(";"),J)}function Q(e,t){return"in"==t||"of"==t?(xt.marked="keyword",h(w)):h(x,J)}function J(e,t){return";"==e?h(Z):"in"==t||"of"==t?(xt.marked="keyword",h(w)):f(w,b(";"),Z)}function Z(e){")"!=e&&h(w)}function et(e,t){return"*"==t?(xt.marked="keyword",h(et)):"variable"==e?(m(t),h(et)):"("==e?h(g,y(")"),$(tt,")"),_,E,v):void 0}function tt(e){return"spread"==e?h(tt):f(H,V)}function nt(e,t){return"variable"==e?(m(t),h(rt)):void 0}function rt(e,t){return"extends"==t?h(w,rt):"{"==e?h(y("}"),it,_):void 0}function it(e,t){return"variable"==e||"keyword"==xt.style?(xt.marked="property","get"==t||"set"==t?h(ot,et,it):h(et,it)):"*"==t?(xt.marked="keyword",h(it)):";"==e?h(it):"}"==e?h():void 0}function ot(e){return"variable"!=e?f():(xt.marked="property",h())}function at(e,t){return"string"==e?h(E):"variable"==e?(m(t),h(ut)):void 0}function st(e,t){return"*"==t?(xt.marked="keyword",h(ut,b(";"))):"default"==t?(xt.marked="keyword",h(w,b(";"))):f(E)}function lt(e){return"string"==e?h():f(ct,ut)}function ct(e,t){return"{"==e?U(ct,"}"):("variable"==e&&m(t),h())}function ut(e,t){return"from"==t?(xt.marked="keyword",h(w)):void 0}function dt(e){return"]"==e?h():f(S,pt)}function pt(e){return"for"==e?f(ft,b("]")):","==e?h($(S,"]")):f($(S,"]"))}function ft(e){return"for"==e?h(X,ft):"if"==e?h(w,ft):void 0}var ht,mt,gt=t.indentUnit,vt=n.statementIndent,yt=n.jsonld,_t=n.json||yt,bt=n.typescript,Et=n.wordCharacters||/[\w$]/,wt=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(bt){var s={type:"variable",style:"variable-3"},l={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:s,number:s,bool:s,any:s};for(var c in l)a[c]=l[c]}return a}(),St=/[+\-*&%=<>!?|~^]/,Ct=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,It="([{}])",kt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},xt={state:null,column:null,marked:null,cc:null},Tt={name:"this",next:{name:"arguments"}};return _.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-gt,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=s&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==ht?n:(t.lastType="operator"!=ht||"++"!=mt&&"--"!=mt?ht:"incdec",p(t,n,ht,mt,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=o)return 0;var i=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==_)a=a.prev;else if(c!=K)break}"stat"==a.type&&"}"==i&&(a=a.prev),vt&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,d=i==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==i?a.indented:"form"==u?a.indented+gt:"stat"==u?a.indented+("operator"==t.lastType||","==t.lastType?vt||gt:0):"switch"!=a.info||d||0==n.doubleIndentSwitch?a.align?a.column+(d?0:1):a.indented+(d?0:gt):a.indented+(/^(?:case|default)\b/.test(r)?gt:2*gt)},electricChars:":{}",blockCommentStart:_t?null:"/*",blockCommentEnd:_t?null:"*/",lineComment:_t?null:"//",fold:"brace",helperType:_t?"json":"javascript",jsonldMode:yt,jsonMode:_t}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/htmlmixed/htmlmixed",["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){e.defineMode("htmlmixed",function(t,n){function r(e,t){var n=t.htmlState.tagName;n&&(n=n.toLowerCase());var r=s.token(e,t.htmlState);if("script"==n&&/\btag\b/.test(r)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var u=0;u<c.length;++u){var d=c[u];if("string"==typeof d.matches?i==d.matches:d.matches.test(i)){d.mode&&(t.token=o,t.localMode=d.mode,t.localState=d.mode.startState&&d.mode.startState(s.indent(t.htmlState,"")));break}}}else"style"==n&&/\btag\b/.test(r)&&">"==e.current()&&(t.token=a,t.localMode=l,t.localState=l.startState(s.indent(t.htmlState,"")));return r}function i(e,t,n){var r,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(r=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i)),n}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,r(e,t)):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,r(e,t)):i(e,/<\/\s*style\s*>/,l.token(e,t.localState))}var s=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),l=e.getMode(t,"css"),c=[],u=n&&n.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var d=0;d<u.length;++d){var p=u[d];c.push({matches:p.matches,mode:p.mode&&e.getMode(t,p.mode)})}return c.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){var e=s.startState();return{token:r,localMode:null,localState:null,htmlState:e}},copyState:function(t){if(t.localState)var n=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?s.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||s}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/django/django",["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){e.defineMode("django:inner",function(){function e(e,n){e.eatWhile(/[^\{]/);var r=e.next();return"{"==r&&(r=e.eat(/\{|%|#/))?(n.tokenize=t(r),"tag"):void 0}function t(t){return"{"==t&&(t="}"),function(r,i){var o=r.next();return o==t&&r.eat("}")?(i.tokenize=e,"tag"):r.match(n)?"keyword":"#"==t?"comment":"string"}}var n=["block","endblock","for","endfor","in","true","false","loop","none","self","super","if","endif","as","not","and","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","length","comment","endcomment","empty"];return n=new RegExp("^(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,t){return t.tokenize(e,t)}}}),e.defineMode("django",function(t){var n=e.getMode(t,"text/html"),r=e.getMode(t,"django:inner");return e.overlayMode(n,r)}),e.defineMIME("text/x-django","django")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/dtd/dtd",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("dtd",function(e){function t(e,t){return a=t,e}function n(e,n){var a=e.next();if("<"!=a||!e.eat("!")){if("<"==a&&e.eat("?"))return n.tokenize=o("meta","?>"),t("meta",a);if("#"==a&&e.eatWhile(/[\w]/))return t("atom","tag");if("|"==a)return t("keyword","seperator");if(a.match(/[\(\)\[\]\-\.,\+\?>]/))return t(null,a);if(a.match(/[\[\]]/))return t("rule",a);if('"'==a||"'"==a)return n.tokenize=i(a),n.tokenize(e,n);if(e.eatWhile(/[a-zA-Z\?\+\d]/)){var s=e.current();return null!==s.substr(s.length-1,s.length).match(/\?|\+/)&&e.backUp(1),t("tag","tag")}return"%"==a||"*"==a?t("number","number"):(e.eatWhile(/[\w\\\-_%.{,]/),t(null,null))}return e.eatWhile(/[\-]/)?(n.tokenize=r,r(e,n)):e.eatWhile(/[\w]/)?t("keyword","doindent"):void 0}function r(e,r){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){r.tokenize=n;break}o="-"==i?o+1:0}return t("comment","comment")}function i(e){return function(r,i){for(var o,a=!1;null!=(o=r.next());){if(o==e&&!a){i.tokenize=n;
40break}a=!a&&"\\"==o}return t("string","tag")}}function o(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=n;break}r.next()}return e}}var a,s=e.indentUnit;return{startState:function(e){return{tokenize:n,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"["==e.current()||"doindent"===a||"["==a?t.stack.push("rule"):"endtag"===a?t.stack[t.stack.length-1]="endtag":"]"==e.current()||"]"==a||">"==a&&"rule"==r?t.stack.pop():"["==a&&t.stack.push("["),n},indent:function(e,t){var n=e.stack.length;return t.match(/\]\s+|\]/)?n-=1:">"===t.substr(t.length-1,t.length)&&("<"===t.substr(0,1)||"doindent"==a&&t.length>1||("doindent"==a?n--:">"==a&&t.length>1||"tag"==a&&">"!==t||("tag"==a&&"rule"==e.stack[e.stack.length-1]?n--:"tag"==a?n++:">"===t&&"rule"==e.stack[e.stack.length-1]&&">"===a?n--:">"===t&&"rule"==e.stack[e.stack.length-1]||("<"!==t.substr(0,1)&&">"===t.substr(0,1)?n-=1:">"===t||(n-=1)))),(null==a||"]"==a)&&n--),e.baseIndent+n*s},electricChars:"]>"}}),e.defineMIME("application/xml-dtd","dtd")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/dylan/dylan",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("dylan",function(){function e(e,t,n){return t.tokenize=n,n(e,t)}function t(e,t,n){return h=e,m=n,t}function n(n,o){var a=n.peek();if("'"==a||'"'==a)return n.next(),e(n,o,i(a,"string","string"));if("/"==a)return n.next(),n.eat("*")?e(n,o,r):n.eat("/")?(n.skipToEnd(),t("comment","comment")):(n.skipTo(" "),t("operator","operator"));if(/\d/.test(a))return n.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),t("number","number");if("#"==a)return n.next(),a=n.peek(),'"'==a?(n.next(),e(n,o,i('"',"symbol","string-2"))):"b"==a?(n.next(),n.eatWhile(/[01]/),t("number","number")):"x"==a?(n.next(),n.eatWhile(/[\da-f]/i),t("number","number")):"o"==a?(n.next(),n.eatWhile(/[0-7]/),t("number","number")):(n.eatWhile(/[-a-zA-Z]/),t("hash","keyword"));if(n.match("end"))return t("end","keyword");for(var u in l)if(l.hasOwnProperty(u)){var d=l[u];if(d instanceof Array&&d.some(function(e){return n.match(e)})||n.match(d))return t(u,c[u],n.current())}return n.match("define")?t("definition","def"):(n.eatWhile(/[\w\-]/),p[n.current()]?t(p[n.current()],f[n.current()],n.current()):n.current().match(s)?t("variable","variable"):(n.next(),t("other","variable-2")))}function r(e,r){for(var i,o=!1;i=e.next();){if("/"==i&&o){r.tokenize=n;break}o="*"==i}return t("comment","comment")}function i(e,r,i){return function(o,a){for(var s,l=!1;null!=(s=o.next());)if(s==e){l=!0;break}return l&&(a.tokenize=n),t(r,i)}}var o={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};o.otherDefinition=o.unnamedDefinition.concat(o.namedDefinition).concat(o.otherParameterizedDefinition),o.definition=o.typeParameterizedDefinition.concat(o.otherDefinition),o.parameterizedDefinition=o.typeParameterizedDefinition.concat(o.otherParameterizedDefinition),o.simpleDefinition=o.constantSimpleDefinition.concat(o.variableSimpleDefinition).concat(o.otherSimpleDefinition),o.keyword=o.statement.concat(o.separator).concat(o.other);var a="[-_a-zA-Z?!*@<>$%]+",s=new RegExp("^"+a),l={symbolKeyword:a+":",symbolClass:"<"+a+">",symbolGlobal:"\\*"+a+"\\*",symbolConstant:"\\$"+a},c={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var u in l)l.hasOwnProperty(u)&&(l[u]=new RegExp("^"+l[u]));l.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var d={};d.keyword="keyword",d.definition="def",d.simpleDefinition="def",d.signalingCalls="builtin";var p={},f={};["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(e){o[e].forEach(function(t){p[t]=e,f[t]=d[e]})});var h,m;return{startState:function(){return{tokenize:n,currentIndent:0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"/*",blockCommentEnd:"*/"}}),e.defineMIME("text/x-dylan","dylan")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/ecl/ecl",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("ecl",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return t.startOfLine?(e.skipToEnd(),"meta"):!1}function r(e,t){var n=e.next();if(_[n]){var r=_[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return u=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(b.test(n))return e.eatWhile(b),"operator";e.eatWhile(/[\w\$_]/);var a=e.current().toLowerCase();if(p.propertyIsEnumerable(a))return v.propertyIsEnumerable(a)&&(u="newstatement"),"keyword";if(f.propertyIsEnumerable(a))return v.propertyIsEnumerable(a)&&(u="newstatement"),"variable";if(h.propertyIsEnumerable(a))return v.propertyIsEnumerable(a)&&(u="newstatement"),"variable-2";if(m.propertyIsEnumerable(a))return v.propertyIsEnumerable(a)&&(u="newstatement"),"variable-3";if(g.propertyIsEnumerable(a))return v.propertyIsEnumerable(a)&&(u="newstatement"),"builtin";for(var s=a.length-1;s>=0&&(!isNaN(a[s])||"_"==a[s]);)--s;if(s>0){var l=a.substr(0,s+1);if(m.propertyIsEnumerable(l))return v.propertyIsEnumerable(l)&&(u="newstatement"),"variable-3"}return y.propertyIsEnumerable(a)?"atom":null}function i(e){return function(t,n){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&!c)&&(n.tokenize=r),"string"}}function o(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=r;break}i="*"==n}return"comment"}function a(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e,t,n){return e.context=new a(e.indented,t,n,null,e.context)}function l(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u,d=e.indentUnit,p=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),f=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),h=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),m=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),g=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),v=t("catch class do else finally for if switch try while"),y=t("true false null"),_={"#":n},b=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;u=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u||"statement"!=n.type)if("{"==u)s(t,e.column(),"}");else if("["==u)s(t,e.column(),"]");else if("("==u)s(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=l(t);for("}"==n.type&&(n=l(t));"statement"==n.type;)n=l(t)}else u==n.type?l(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==u)&&s(t,e.column(),"statement");else l(t);return t.startOfLine=!1,i},indent:function(e,t){if(e.tokenize!=r&&null!=e.tokenize)return 0;var n=e.context,i=t&&t.charAt(0);"statement"==n.type&&"}"==i&&(n=n.prev);var o=i==n.type;return"statement"==n.type?n.indented+("{"==i?0:d):n.align?n.column+(o?0:1):n.indented+(o?0:d)},electricChars:"{}"}}),e.defineMIME("text/x-ecl","ecl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/eiffel/eiffel",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("eiffel",function(){function e(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function t(e,t,n){return n.tokenize.push(e),e(t,n)}function n(e,n){if(i=null,e.eatSpace())return null;var o=e.next();return'"'==o||"'"==o?t(r(o,"string"),e,n):"-"==o&&e.eat("-")?(e.skipToEnd(),"comment"):":"==o&&e.eat("=")?"operator":/[0-9]/.test(o)?(e.eatWhile(/[xXbBCc0-9\.]/),e.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(o)?(e.eatWhile(/[a-zA-Z_0-9]/),e.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(o)?(e.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function r(e,t,n){return function(r,i){for(var o,a=!1;null!=(o=r.next());){if(o==e&&(n||!a)){i.tokenize.pop();break}a=!a&&"%"==o}return t}}var i,o=e(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),a=e([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[n]}},token:function(e,t){var n=t.tokenize[t.tokenize.length-1](e,t);if("ident"==n){var r=e.current();n=o.propertyIsEnumerable(e.current())?"keyword":a.propertyIsEnumerable(e.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(r)?"tag":/^0[bB][0-1]+$/g.test(r)?"number":/^0[cC][0-7]+$/g.test(r)?"number":/^0[xX][a-fA-F0-9]+$/g.test(r)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(r)?"number":/^[0-9]+$/g.test(r)?"number":"variable"}return n},lineComment:"--"}}),e.defineMIME("text/x-eiffel","eiffel")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/erlang/erlang",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){function n(e,t){if(t.in_string)return t.in_string=!o(e),u(t,e,"string");if(t.in_atom)return t.in_atom=!a(e),u(t,e,"atom");if(e.eatSpace())return u(t,e,"whitespace");if(!h(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return c(e.current(),k)?u(t,e,"type"):u(t,e,"attribute");var n=e.next();if("%"==n)return e.skipToEnd(),u(t,e,"comment");if(":"==n)return u(t,e,"colon");if("?"==n)return e.eatSpace(),e.eatWhile(U),u(t,e,"macro");if("#"==n)return e.eatSpace(),e.eatWhile(U),u(t,e,"record");if("$"==n)return"\\"!=e.next()||e.match(j)?u(t,e,"number"):u(t,e,"error");if("."==n)return u(t,e,"dot");if("'"==n){if(!(t.in_atom=!a(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return u(t,e,"function")}return u(t,e,"atom")}if('"'==n)return t.in_string=!o(e),u(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return e.eatWhile(U),u(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(e.eatWhile(U),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");var s=e.current();return c(s,x)?u(t,e,"keyword"):c(s,M)?u(t,e,"operator"):e.match(/\s*\(/,!1)?!c(s,$)||":"==h(t).token&&"erlang"!=h(t,2).token?c(s,F)?u(t,e,"guard"):u(t,e,"function"):u(t,e,"builtin"):c(s,M)?u(t,e,"operator"):":"==l(e)?"erlang"==s?u(t,e,"builtin"):u(t,e,"function"):c(s,["true","false"])?u(t,e,"boolean"):c(s,["true","false"])?u(t,e,"boolean"):u(t,e,"atom")}var d=/[0-9]/,p=/[0-9a-zA-Z]/;return d.test(n)?(e.eatWhile(d),e.eat("#")?e.eatWhile(p)||e.backUp(1):e.eat(".")&&(e.eatWhile(d)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(d)||e.backUp(2):e.eatWhile(d)||e.backUp(1)):e.backUp(1)),u(t,e,"number")):r(e,R,A)?u(t,e,"open_paren"):r(e,N,P)?u(t,e,"close_paren"):i(e,T,D)?u(t,e,"separator"):i(e,O,L)?u(t,e,"operator"):u(t,e,null)}function r(e,t,n){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),c(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function i(e,t,n){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0<e.current().length;){if(c(e.current(),n))return!0;e.backUp(1)}e.next()}return!1}function o(e){return s(e,'"',"\\")}function a(e){return s(e,"'","\\")}function s(e,t,n){for(;!e.eol();){var r=e.next();if(r==t)return!0;r==n&&e.next()}return!1}function l(e){var t=e.match(/([\n\s]+|%[^\n]*\n)*(.)/,!1);return t?t.pop():""}function c(e,t){return-1<t.indexOf(e)}function u(e,t,n){switch(m(e,p(n,t)),n){case"atom":return"atom";case"attribute":return"attribute";case"boolean":return"atom";case"builtin":return"builtin";case"close_paren":return null;case"colon":return null;case"comment":return"comment";case"dot":return null;case"error":return"error";case"fun":return"meta";case"function":return"tag";case"guard":return"property";case"keyword":return"keyword";case"macro":return"variable-2";case"number":return"number";case"open_paren":return null;case"operator":return"operator";case"record":return"bracket";case"separator":return null;case"string":return"string";case"type":return"def";case"variable":return"variable";default:return null}}function d(e,t,n,r){return{token:e,column:t,indent:n,type:r}}function p(e,t){return d(t.current(),t.column(),t.indentation(),e)}function f(e){return d(e,0,0,e)}function h(e,t){var n=e.tokenStack.length,r=t?t:1;return r>n?!1:e.tokenStack[n-r]}function m(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=g(e.tokenStack,t),e.tokenStack=v(e.tokenStack))}function g(e,t){var n=e.length-1;return n>0&&"record"===e[n].type&&"dot"===t.type?e.pop():n>0&&"group"===e[n].type?(e.pop(),e.push(t)):e.push(t),e}function v(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return y(e,{g:["{"]});case"]":return y(e,{i:["["]});case")":return y(e,{i:["("]});case">>":return y(e,{i:["<<"]});case"end":return y(e,{i:["begin","case","fun","if","receive","try"]});case",":return y(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return y(e,{r:["when"],m:["try","if","case","receive"]});case";":return y(e,{E:["case","fun","if","receive","try","when"]});case"catch":return y(e,{e:["try"]});case"of":return y(e,{e:["case"]});case"after":return y(e,{e:["receive","try"]});default:return e}}function y(e,t){for(var n in t)for(var r=e.length-1,i=t[n],o=r-1;o>-1;o--)if(c(e[o].token,i)){var a=e.slice(0,o);switch(n){case"m":return a.concat(e[o]).concat(e[r]);case"r":return a.concat(e[r]);case"i":return a;case"g":return a.concat(f("group"));case"E":return a.concat(e[o]);case"e":return a.concat(e[o])}}return"E"==n?[]:e}function _(n,r){var i,o=t.indentUnit,a=b(r),s=h(n,1),l=h(n,2);return n.in_string||n.in_atom?e.Pass:l?"when"==s.token?s.column+o:"when"===a&&"function"===l.type?l.indent+o:"("===a&&"fun"===s.token?s.column+3:"catch"===a&&(i=S(n,["try"]))?i.column:c(a,["end","after","of"])?(i=S(n,["begin","case","fun","if","receive","try"]),i?i.column:e.Pass):c(a,P)?(i=S(n,A),i?i.column:e.Pass):c(s.token,[",","|","||"])||c(a,[",","|","||"])?(i=E(n),i?i.column+i.token.length:o):"->"==s.token?c(l.token,["receive","case","if","try"])?l.column+o+o:l.column+o:c(s.token,A)?s.column+s.token.length:(i=w(n),I(i)?i.column+o:0):0}function b(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return I(t)&&0===t.index?t[0]:""}function E(e){var t=e.tokenStack.slice(0,-1),n=C(t,"type",["open_paren"]);return I(t[n])?t[n]:!1}function w(e){var t=e.tokenStack,n=C(t,"type",["open_paren","separator","keyword"]),r=C(t,"type",["operator"]);return I(n)&&I(r)&&r>n?t[n+1]:I(n)?t[n]:!1}function S(e,t){var n=e.tokenStack,r=C(n,"token",t);return I(n[r])?n[r]:!1}function C(e,t,n){for(var r=e.length-1;r>-1;r--)if(c(e[r][t],n))return r;return!1}function I(e){return e!==!1&&null!=e}var k=["-type","-spec","-export_type","-opaque"],x=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],T=/[\->,;]/,D=["->",";",","],M=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],O=/[\+\-\*\/<>=\|:!]/,L=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],R=/[<\(\[\{]/,A=["<<","(","[","{"],N=/[>\)\]\}]/,P=["}","]",")",">>"],F=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],$=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],U=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,j=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return n(e,t)},indent:function(e,t){return _(e,t)},lineComment:"%"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/fortran/fortran",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("fortran",function(){function e(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function t(e,t){if(e.match(s))return"operator";var l=e.next();if("!"==l)return e.skipToEnd(),"comment";if('"'==l||"'"==l)return t.tokenize=n(l),t.tokenize(e,t);if(/[\[\]\(\),]/.test(l))return null;if(/\d/.test(l))return e.eatWhile(/[\w\.]/),"number";if(a.test(l))return e.eatWhile(a),"operator";e.eatWhile(/[\w\$_]/);var c=e.current().toLowerCase();return r.hasOwnProperty(c)?"keyword":i.hasOwnProperty(c)||o.hasOwnProperty(c)?"builtin":"variable"}function n(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i)&&(n.tokenize=null),"string"}}var r=e(["abstract","accept","allocatable","allocate","array","assign","asynchronous","backspace","bind","block","byte","call","case","class","close","common","contains","continue","cycle","data","deallocate","decode","deferred","dimension","do","elemental","else","encode","end","endif","entry","enumerator","equivalence","exit","external","extrinsic","final","forall","format","function","generic","go","goto","if","implicit","import","include","inquire","intent","interface","intrinsic","module","namelist","non_intrinsic","non_overridable","none","nopass","nullify","open","optional","options","parameter","pass","pause","pointer","print","private","program","protected","public","pure","read","recursive","result","return","rewind","save","select","sequence","stop","subroutine","target","then","to","type","use","value","volatile","where","while","write"]),i=e(["abort","abs","access","achar","acos","adjustl","adjustr","aimag","aint","alarm","all","allocated","alog","amax","amin","amod","and","anint","any","asin","associated","atan","besj","besjn","besy","besyn","bit_size","btest","cabs","ccos","ceiling","cexp","char","chdir","chmod","clog","cmplx","command_argument_count","complex","conjg","cos","cosh","count","cpu_time","cshift","csin","csqrt","ctime","c_funloc","c_loc","c_associated","c_null_ptr","c_null_funptr","c_f_pointer","c_null_char","c_alert","c_backspace","c_form_feed","c_new_line","c_carriage_return","c_horizontal_tab","c_vertical_tab","dabs","dacos","dasin","datan","date_and_time","dbesj","dbesj","dbesjn","dbesy","dbesy","dbesyn","dble","dcos","dcosh","ddim","derf","derfc","dexp","digits","dim","dint","dlog","dlog","dmax","dmin","dmod","dnint","dot_product","dprod","dsign","dsinh","dsin","dsqrt","dtanh","dtan","dtime","eoshift","epsilon","erf","erfc","etime","exit","exp","exponent","extends_type_of","fdate","fget","fgetc","float","floor","flush","fnum","fputc","fput","fraction","fseek","fstat","ftell","gerror","getarg","get_command","get_command_argument","get_environment_variable","getcwd","getenv","getgid","getlog","getpid","getuid","gmtime","hostnm","huge","iabs","iachar","iand","iargc","ibclr","ibits","ibset","ichar","idate","idim","idint","idnint","ieor","ierrno","ifix","imag","imagpart","index","int","ior","irand","isatty","ishft","ishftc","isign","iso_c_binding","is_iostat_end","is_iostat_eor","itime","kill","kind","lbound","len","len_trim","lge","lgt","link","lle","llt","lnblnk","loc","log","logical","long","lshift","lstat","ltime","matmul","max","maxexponent","maxloc","maxval","mclock","merge","move_alloc","min","minexponent","minloc","minval","mod","modulo","mvbits","nearest","new_line","nint","not","or","pack","perror","precision","present","product","radix","rand","random_number","random_seed","range","real","realpart","rename","repeat","reshape","rrspacing","rshift","same_type_as","scale","scan","second","selected_int_kind","selected_real_kind","set_exponent","shape","short","sign","signal","sinh","sin","sleep","sngl","spacing","spread","sqrt","srand","stat","sum","symlnk","system","system_clock","tan","tanh","time","tiny","transfer","transpose","trim","ttynam","ubound","umask","unlink","unpack","verify","xor","zabs","zcos","zexp","zlog","zsin","zsqrt"]),o=e(["c_bool","c_char","c_double","c_double_complex","c_float","c_float_complex","c_funptr","c_int","c_int16_t","c_int32_t","c_int64_t","c_int8_t","c_int_fast16_t","c_int_fast32_t","c_int_fast64_t","c_int_fast8_t","c_int_least16_t","c_int_least32_t","c_int_least64_t","c_int_least8_t","c_intmax_t","c_intptr_t","c_long","c_long_double","c_long_double_complex","c_long_long","c_ptr","c_short","c_signed_char","c_size_t","character","complex","double","integer","logical","real"]),a=/[+\-*&=<>\/\:]/,s=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var r=(n.tokenize||t)(e,n);return"comment"==r||"meta"==r?r:r}}}),e.defineMIME("text/x-fortran","fortran")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/gas/gas",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("gas",function(e,t){function n(){s="#",c.ax="variable",c.eax="variable-2",c.rax="variable-3",c.bx="variable",c.ebx="variable-2",c.rbx="variable-3",c.cx="variable",c.ecx="variable-2",c.rcx="variable-3",c.dx="variable",c.edx="variable-2",c.rdx="variable-3",c.si="variable",c.esi="variable-2",c.rsi="variable-3",c.di="variable",c.edi="variable-2",c.rdi="variable-3",c.sp="variable",c.esp="variable-2",c.rsp="variable-3",c.bp="variable",c.ebp="variable-2",c.rbp="variable-3",c.ip="variable",c.eip="variable-2",c.rip="variable-3",c.cs="keyword",c.ds="keyword",c.ss="keyword",c.es="keyword",c.fs="keyword",c.gs="keyword"}function r(){s="@",l.syntax="builtin",c.r0="variable",c.r1="variable",c.r2="variable",c.r3="variable",c.r4="variable",c.r5="variable",c.r6="variable",c.r7="variable",c.r8="variable",c.r9="variable",c.r10="variable",c.r11="variable",c.r12="variable",c.sp="variable-2",c.lr="variable-2",c.pc="variable-2",c.r13=c.sp,c.r14=c.lr,c.r15=c.pc,a.push(function(e,t){return"#"===e?(t.eatWhile(/\w/),"number"):void 0})}function i(e,t){for(var n,r=!1;null!=(n=e.next());){if(n===t&&!r)return!1;r=!r&&"\\"===n}return r}function o(e,t){for(var n,r=!1;null!=(n=e.next());){if("/"===n&&r){t.tokenize=null;break}r="*"===n}return"comment"}var a=[],s="",l={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},c={},u=(t.architecture||"x86").toLowerCase();return"x86"===u?n(t):("arm"===u||"armv6"===u)&&r(t),{startState:function(){return{tokenize:null}},token:function(e,t){if(t.tokenize)return t.tokenize(e,t);if(e.eatSpace())return null;var n,r,u=e.next();if("/"===u&&e.eat("*"))return t.tokenize=o,o(e,t);if(u===s)return e.skipToEnd(),"comment";if('"'===u)return i(e,'"'),"string";if("."===u)return e.eatWhile(/\w/),r=e.current().toLowerCase(),n=l[r],n||null;if("="===u)return e.eatWhile(/\w/),"tag";if("{"===u)return"braket";if("}"===u)return"braket";if(/\d/.test(u))return"0"===u&&e.eat("x")?(e.eatWhile(/[0-9a-fA-F]/),"number"):(e.eatWhile(/\d/),"number");if(/\w/.test(u))return e.eatWhile(/\w/),e.eat(":")?"tag":(r=e.current().toLowerCase(),n=c[r],n||null);for(var d=0;d<a.length;d++)if(n=a[d](u,e,t))return n},lineComment:s,blockCommentStart:"/*",blockCommentEnd:"*/"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror",require("../xml/xml"))):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/markdown/markdown",["../../lib/codemirror","../xml/xml"],e):e(CodeMirror)}(function(e){e.defineMode("markdown",function(t,n){function r(e,t,n){return t.f=t.inline=n,n(e,t)}function i(e,t,n){return t.f=t.block=n,n(e,t)}function o(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.quote=0,_||e.f!=s||(e.f=d,e.block=a),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function a(e,t){var o=e.sol(),a=t.list!==!1;t.list!==!1&&t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.list!==!1&&t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):t.list!==!1&&(t.list=!1,t.listDepth=0);var s=null;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),I;if(e.eatSpace())return null;if(s=e.match(W))return t.header=s[0].length<=6?s[0].length:6,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,c(t);if(t.prevLineHasContent&&(s=e.match(H)))return t.header="="==s[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,c(t);if(e.eat(">"))return t.indentation++,t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),c(t);if("["===e.peek())return r(e,t,m);if(e.match(U,!0))return M;if((!t.prevLineHasContent||a)&&(e.match(j,!1)||e.match(V,!1))){var u=null;return e.match(j,!0)?u="ul":(e.match(V,!0),u="ol"),t.indentation+=4,t.list=!0,t.listDepth++,n.taskLists&&e.match(B,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+u]),c(t)}return n.fencedCodeBlocks&&e.match(/^```([\w+#]*)/,!0)?(t.localMode=w(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),i(e,t,l),n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,c(t)):r(e,t,t.inline)
41}function s(e,t){var n=b.token(e,t.htmlState);return(_&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=d,t.block=a,t.htmlState=null),n}function l(e,t){if(e.sol()&&e.match(/^```/,!0)){t.localMode=t.localState=null,t.f=d,t.block=a,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=c(t);return t.code=!1,r}return t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),I)}function c(e){var t=[];if(e.formatting){t.push(L),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(L+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(L+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?L+"-"+e.formatting[r]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref)return t.push(P),t.length?t.join(" "):null;if(e.strong&&t.push($),e.em&&t.push(F),e.linkText&&t.push(N),e.code&&t.push(I),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(k),t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?k+"-"+e.quote:k+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?T:D:x)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function u(e,t){return e.match(q,!0)?c(t):void 0}function d(t,r){var o=r.text(t,r);if("undefined"!=typeof o)return o;if(r.list)return r.list=null,c(r);if(r.taskList){var a="x"!==t.match(B,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,c(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),c(r);var l=t.sol(),u=t.next();if("\\"===u&&(t.next(),n.highlightFormatting)){var d=c(r);return d?d+" formatting-escape":"formatting-escape"}if(r.linkTitle){r.linkTitle=!1;var h=u;"("===u&&(h=")"),h=(h+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var m="^\\s*(?:[^"+h+"\\\\]+|\\\\\\\\|\\\\.)"+h;if(t.match(new RegExp(m),!0))return P}if("`"===u){var g=r.formatting;n.highlightFormatting&&(r.formatting="code");var v=c(r),y=t.pos;t.eatWhile("`");var _=1+t.pos-y;return r.code?_===S?(r.code=!1,v):(r.formatting=g,c(r)):(S=_,r.code=!0,c(r))}if(r.code)return c(r);if("!"===u&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=f,O;if("["===u&&t.match(/.*\](\(| ?\[)/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),c(r);if("]"===u&&r.linkText){n.highlightFormatting&&(r.formatting="link");var d=c(r);return r.linkText=!1,r.inline=r.f=f,d}if("<"===u&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link");var d=c(r);return d?d+=" ":d="",d+R}if("<"===u&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link");var d=c(r);return d?d+=" ":d="",d+A}if("<"===u&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){var E=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(E)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(b),i(t,r,s)}if("<"===u&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var w=!1;if(!n.underscoresBreakWords&&"_"===u&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var I=t.string.charAt(C);"_"!==I&&I.match(/(\w)/,!1)&&(w=!0)}}if("*"===u||"_"===u&&!w)if(l&&" "===t.peek());else{if(r.strong===u&&t.eat(u)){n.highlightFormatting&&(r.formatting="strong");var v=c(r);return r.strong=!1,v}if(!r.strong&&t.eat(u))return r.strong=u,n.highlightFormatting&&(r.formatting="strong"),c(r);if(r.em===u){n.highlightFormatting&&(r.formatting="em");var v=c(r);return r.em=!1,v}if(!r.em)return r.em=u,n.highlightFormatting&&(r.formatting="em"),c(r)}else if(" "===u&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return c(r);t.backUp(1)}return" "===u&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),c(r)}function p(e,t){var r=e.next();if(">"===r){t.f=t.inline=d,n.highlightFormatting&&(t.formatting="link");var i=c(t);return i?i+=" ":i="",i+R}return e.match(/^[^>]+/,!0),R}function f(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=h("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,c(t)):"error"}function h(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=d,n.highlightFormatting&&(r.formatting="link-string");var o=c(r);return r.linkHref=!1,o}return t.match(y(e),!0)&&t.backUp(1),r.linkHref=!0,c(r)}}function m(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=g,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,c(t)):r(e,t,d)}function g(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=v,n.highlightFormatting&&(t.formatting="link");var r=c(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),N}function v(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=d,P)}function y(e){return z[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),z[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),z[e]}var _=e.modes.hasOwnProperty("xml"),b=e.getMode(t,_?{name:"xml",htmlMode:!0}:"text/plain"),E={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},w=function(){var n,r,i={},o={},a=[];for(var s in e.modes)e.modes.propertyIsEnumerable(s)&&a.push(s);for(n=0;n<a.length;n++)i[a[n]]=a[n];var l=[];for(var s in e.mimeModes)e.mimeModes.propertyIsEnumerable(s)&&l.push({mime:s,mode:e.mimeModes[s]});for(n=0;n<l.length;n++)r=l[n].mime,o[r]=l[n].mime;for(var c in E)(E[c]in i||E[c]in o)&&(i[c]=E[c]);return function(n){return i[n]?e.getMode(t,i[n]):null}}();void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.fencedCodeBlocks&&(n.fencedCodeBlocks=!1),void 0===n.taskLists&&(n.taskLists=!1);var S=0,C="header",I="comment",k="quote",x="variable-2",T="variable-3",D="keyword",M="hr",O="tag",L="formatting",R="link",A="link",N="link",P="string",F="em",$="strong",U=/^([*\-=_])(?:\s*\1){2,}\s*$/,j=/^[*\-+]\s+/,V=/^[0-9]+\.\s+/,B=/^\[(x| )\](?=\s)/,W=/^#+/,H=/^(?:\={1,}|-{1,})$/,q=/^[^#!\[\]*_\\<>` "'(]+/,z=[],G={startState:function(){return{f:a,prevLineHasContent:!1,thisLineHasContent:!1,block:a,htmlState:null,indentation:0,inline:d,text:u,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(b,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,header:t.header,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var n=!!t.header;if(t.header=0,e.match(/^\s*$/,!0)||n)return t.prevLineHasContent=!1,o(t),n?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var a=t.indentation+i;if(t.indentationDiff=a-t.indentation,t.indentation=a,r>0)return null}var s=t.f(e,t);return e.start==e.pos?this.token(e,t):s},innerMode:function(e){return e.block==s?{state:e.htmlState,mode:b}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:G}},blankLine:o,getType:c,fold:"markdown"};return G},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/gfm/gfm",["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){e.defineMode("gfm",function(t,n){function r(e){return e.code=!1,null}var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var r=1+e.pos-n;return t.code?r===i&&(t.code=!1):(i=r,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0};for(var s in n)a[s]=n[s];return a.name="markdown",e.defineMIME("gfmBase",a),e.overlayMode(e.getMode(t,"gfmBase"),o)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/gherkin/gherkin",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(e,t){if(e.sol()&&(t.lineNumber++,t.inKeywordLine=!1,t.inMultilineTable&&(t.tableHeaderLine=!1,e.match(/\s*\|/,!1)||(t.allowMultilineArgument=!1,t.inMultilineTable=!1))),e.eatSpace(),t.allowMultilineArgument){if(t.inMultilineString)return e.match('"""')?(t.inMultilineString=!1,t.allowMultilineArgument=!1):e.match(/.*/),"string";if(t.inMultilineTable)return e.match(/\|\s*/)?"bracket":(e.match(/[^\|]*/),t.tableHeaderLine?"header":"string");if(e.match('"""'))return t.inMultilineString=!0,"string";if(e.match("|"))return t.inMultilineTable=!0,t.tableHeaderLine=!0,"bracket"}return e.match(/#.*/)?"comment":!t.inKeywordLine&&e.match(/@\S+/)?"tag":!t.inKeywordLine&&t.allowFeature&&e.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(t.allowScenario=!0,t.allowBackground=!0,t.allowPlaceholders=!1,t.allowSteps=!1,t.allowMultilineArgument=!1,t.inKeywordLine=!0,"keyword"):!t.inKeywordLine&&t.allowBackground&&e.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(t.allowPlaceholders=!1,t.allowSteps=!0,t.allowBackground=!1,t.allowMultilineArgument=!1,t.inKeywordLine=!0,"keyword"):!t.inKeywordLine&&t.allowScenario&&e.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(t.allowPlaceholders=!0,t.allowSteps=!0,t.allowMultilineArgument=!1,t.inKeywordLine=!0,"keyword"):t.allowScenario&&e.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(t.allowPlaceholders=!1,t.allowSteps=!0,t.allowBackground=!1,t.allowMultilineArgument=!0,"keyword"):!t.inKeywordLine&&t.allowScenario&&e.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(t.allowPlaceholders=!1,t.allowSteps=!0,t.allowBackground=!1,t.allowMultilineArgument=!1,t.inKeywordLine=!0,"keyword"):!t.inKeywordLine&&t.allowSteps&&e.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(t.inStep=!0,t.allowPlaceholders=!0,t.allowMultilineArgument=!0,t.inKeywordLine=!0,"keyword"):e.match(/"[^"]*"?/)?"string":t.allowPlaceholders&&e.match(/<[^>]*>?/)?"variable":(e.next(),e.eatWhile(/[^@"<#]/),null)}}}),e.defineMIME("text/x-feature","gherkin")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/go/go",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("go",function(e){function t(e,t){var i=e.next();if('"'==i||"'"==i||"`"==i)return t.tokenize=n(i),t.tokenize(e,t);if(/[\d\.]/.test(i))return"."==i?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==i?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(i))return s=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=r,r(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(i))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_]/);var o=e.current();return c.propertyIsEnumerable(o)?(("case"==o||"default"==o)&&(s="case"),"keyword"):u.propertyIsEnumerable(o)?"atom":"variable"}function n(e){return function(n,r){for(var i,o=!1,a=!1;null!=(i=n.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&"`"!=e)&&(r.tokenize=t),"string"}}function r(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="*"==r}return"comment"}function i(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function o(e,t,n){return e.context=new i(e.indented,t,n,null,e.context)}function a(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var s,l=e.indentUnit,c={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},u={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var r=n.context;if(e.sol()&&(null==r.align&&(r.align=!1),n.indented=e.indentation(),n.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;s=null;var i=(n.tokenize||t)(e,n);return"comment"==i?i:(null==r.align&&(r.align=!0),"{"==s?o(n,e.column(),"}"):"["==s?o(n,e.column(),"]"):"("==s?o(n,e.column(),")"):"case"==s?r.type="case":"}"==s&&"}"==r.type?r=a(n):s==r.type&&a(n),n.startOfLine=!1,i)},indent:function(e,n){if(e.tokenize!=t&&null!=e.tokenize)return 0;var r=e.context,i=n&&n.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(n))return e.context.type="}",r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:l)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/groovy/groovy",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("groovy",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){var n=e.next();if('"'==n||"'"==n)return r(n,e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return u=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),e.eat(/eE/)&&(e.eat(/\+\-/),e.eatWhile(/\d/)),"number";if("/"==n){if(e.eat("*"))return t.tokenize.push(o),o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment";if(a(t.lastToken))return r(n,e,t)}if("-"==n&&e.eat(">"))return u="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),"@"==n)return e.eatWhile(/[\w\$_\.]/),"meta";if("."==t.lastToken)return"property";if(e.eat(":"))return u="proplabel","property";var i=e.current();return f.propertyIsEnumerable(i)?"atom":d.propertyIsEnumerable(i)?(p.propertyIsEnumerable(i)&&(u="newstatement"),"keyword"):"variable"}function r(e,t,n){function r(t,n){for(var r,a=!1,s=!o;null!=(r=t.next());){if(r==e&&!a){if(!o)break;if(t.match(e+e)){s=!0;break}}if('"'==e&&"$"==r&&!a&&t.eat("{"))return n.tokenize.push(i()),"string";a=!a&&"\\"==r}return s&&n.tokenize.pop(),"string"}var o=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";o=!0}return n.tokenize.push(r),r(t,n)}function i(){function e(e,r){if("}"==e.peek()){if(t--,0==t)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](e,r)}else"{"==e.peek()&&t++;return n(e,r)}var t=1;return e.isBase=!0,e}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function a(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e,t,n){return e.context=new s(e.indented,t,n,null,e.context)}function c(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var u,d=t("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),p=t("catch class do else finally for if switch try while enum interface def"),f=t("null true false this");return n.isBase=!0,{startState:function(t){return{tokenize:[n],context:new s((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||a(t.lastToken)||(c(t),n=t.context)),e.eatSpace())return null;u=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u||"statement"!=n.type)if("->"==u&&"statement"==n.type&&"}"==n.prev.type)c(t),t.context.align=!1;else if("{"==u)l(t,e.column(),"}");else if("["==u)l(t,e.column(),"]");else if("("==u)l(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=c(t);for("}"==n.type&&(n=c(t));"statement"==n.type;)n=c(t)}else u==n.type?c(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==u)&&l(t,e.column(),"statement");else c(t);return t.startOfLine=!1,t.lastToken=u||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||a(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}",fold:"brace"}}),e.defineMIME("text/x-groovy","groovy")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/ruby/ruby",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(l),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var d=0;e.current().length<u;){var p=e.next();if("("==p?d+=1:")"==p&&(d-=1),0>d)break}if(e.backUp(e.current().length-o),0==d)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",m=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(f.propertyIsEnumerable(g)&&(g=f[g]),n(a(g,h,m,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(s(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_]/)?(e.eatWhile(/[\w]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_]/))return e.eat("@"),e.eatWhile(/[\w]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_]/.test(i))return e.eatWhile(/[\w]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(){var e=1;return function(t,n){if("}"==t.peek()){if(e--,0==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else"{"==t.peek()&&e++;return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,s){var l,c=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=(l=a.next());){if(l==e&&(r||!c)){s.tokenize.pop();break}if(n&&"#"==l&&!c){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}c=!c&&"\\"==l}return t}}function s(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),d=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),p=t(["end","until"]),f={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,d.propertyIsEnumerable(o)?n="indent":p.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(c||r&&"comment"!=r)&&(t.lastTok=i),"|"==c&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==f[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de",lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/haml/haml",["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],e):e(CodeMirror)}(function(e){e.defineMode("haml",function(t){function n(e){return function(t,n){var o=t.peek();return o==e&&1==n.rubyState.tokenize.length?(t.next(),n.tokenize=i,"closeAttributeTag"):r(t,n)}}function r(e,t){return e.match("-#")?(e.skipToEnd(),"comment"):a.token(e,t.rubyState)}function i(e,t){var i=e.peek();if("comment"==t.previousToken.style&&t.indented>t.previousToken.indented)return e.skipToEnd(),"commentLine";if(t.startOfLine){if("!"==i&&e.match("!!"))return e.skipToEnd(),"tag";if(e.match(/^%[\w:#\.]+=/))return t.tokenize=r,"hamlTag";if(e.match(/^%[\w:]+/))return"hamlTag";if("/"==i)return e.skipToEnd(),"comment"}if((t.startOfLine||"hamlTag"==t.previousToken.style)&&("#"==i||"."==i))return e.match(/[\w-#\.]*/),"hamlAttribute";if(t.startOfLine&&!e.match("-->",!1)&&("="==i||"-"==i))return t.tokenize=r,t.tokenize(e,t);if("hamlTag"==t.previousToken.style||"closeAttributeTag"==t.previousToken.style||"hamlAttribute"==t.previousToken.style){if("("==i)return t.tokenize=n(")"),t.tokenize(e,t);if("{"==i)return t.tokenize=n("}"),t.tokenize(e,t)}return o.token(e,t.htmlState)}var o=e.getMode(t,{name:"htmlmixed"}),a=e.getMode(t,"ruby");return{startState:function(){var e=o.startState(),t=a.startState();return{htmlState:e,rubyState:t,indented:0,previousToken:{style:null,indented:0},tokenize:i}},copyState:function(t){return{htmlState:e.copyState(o,t.htmlState),rubyState:e.copyState(a,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}
42},token:function(e,t){if(e.sol()&&(t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;var n=t.tokenize(e,t);if(t.startOfLine=!1,n&&"commentLine"!=n&&(t.previousToken={style:n,indented:t.indented}),e.eol()&&t.tokenize==r){e.backUp(1);var o=e.peek();e.next(),o&&","!=o&&(t.tokenize=i)}return"hamlTag"==n?n="tag":"commentLine"==n?n="comment":"hamlAttribute"==n?n="attribute":"closeAttributeTag"==n&&(n=null),n}}},"htmlmixed","ruby"),e.defineMIME("text/x-haml","haml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/haskell/haskell",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("haskell",function(e,t){function n(e,t,n){return t(n),n(e,t)}function r(e,t){if(e.eatWhile(m))return null;var r=e.next();if(h.test(r)){if("{"==r&&e.eat("-")){var a="comment";return e.eat("#")&&(a="meta"),n(e,t,i(a,1))}return null}if("'"==r)return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if('"'==r)return n(e,t,o);if(l.test(r))return e.eatWhile(p),e.eat(".")?"qualifier":"variable-2";if(s.test(r))return e.eatWhile(p),"variable";if(c.test(r)){if("0"==r){if(e.eat(/[xX]/))return e.eatWhile(u),"integer";if(e.eat(/[oO]/))return e.eatWhile(d),"number"}e.eatWhile(c);var a="number";return e.match(/^\.\d+/)&&(a="number"),e.eat(/[eE]/)&&(a="number",e.eat(/[-+]/),e.eatWhile(c)),a}if("."==r&&e.eat("."))return"keyword";if(f.test(r)){if("-"==r&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(f)))return e.skipToEnd(),"comment";var a="variable";return":"==r&&(a="variable-2"),e.eatWhile(f),a}return"error"}function i(e,t){return 0==t?r:function(n,o){for(var a=t;!n.eol();){var s=n.next();if("{"==s&&n.eat("-"))++a;else if("-"==s&&n.eat("}")&&(--a,0==a))return o(r),e}return o(i(e,a)),e}}function o(e,t){for(;!e.eol();){var n=e.next();if('"'==n)return t(r),"string";if("\\"==n){if(e.eol()||e.eat(m))return t(a),"string";e.eat("&")||e.next()}}return t(r),"error"}function a(e,t){return e.eat("\\")?n(e,t,o):(e.next(),t(r),"error")}var s=/[a-z_]/,l=/[A-Z]/,c=/\d/,u=/[0-9A-Fa-f]/,d=/[0-7]/,p=/[a-z_A-Z0-9']/,f=/[-!#$%&*+.\/<=>?@\\^|~:]/,h=/[(),;[\]`{}]/,m=/[ \t\v\f]/,g=function(){function e(e){return function(){for(var t=0;t<arguments.length;t++)n[arguments[t]]=e}}var n={};e("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_"),e("keyword")("..",":","::","=","\\",'"',"<-","->","@","~","=>"),e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var r=t.overrideKeywords;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);return n}();return{startState:function(){return{f:r}},copyState:function(e){return{f:e.f}},token:function(e,t){var n=t.f(e,function(e){t.f=e}),r=e.current();return g.hasOwnProperty(r)?g[r]:n},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),e.defineMIME("text/x-haskell","haskell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/haxe/haxe",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("haxe",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function r(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t&&!r)return!1;r=!r&&"\\"==n}return r}function i(e,t,n){return H=e,q=n,t}function o(e,t){var o=e.next();if('"'==o||"'"==o)return n(e,t,a(o));if(/[\[\]{}\(\),;\:\.]/.test(o))return i(o);if("0"==o&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(o)||"-"==o&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if(t.reAllowed&&"~"==o&&e.eat(/\//))return r(e,"/"),e.eatWhile(/[gimsu]/),i("regexp","string-2");if("/"==o)return e.eat("*")?n(e,t,s):e.eat("/")?(e.skipToEnd(),i("comment","comment")):(e.eatWhile(K),i("operator",null,e.current()));if("#"==o)return e.skipToEnd(),i("conditional","meta");if("@"==o)return e.eat(/:/),e.eatWhile(/[\w_]/),i("metadata","meta");if(K.test(o))return e.eatWhile(K),i("operator",null,e.current());var l;if(/[A-Z]/.test(o))return e.eatWhile(/[\w_<>]/),l=e.current(),i("type","variable-3",l);e.eatWhile(/[\w_]/);var l=e.current(),c=G.propertyIsEnumerable(l)&&G[l];return c&&t.kwAllowed?i(c.type,c.style,l):i("variable","variable",l)}function a(e){return function(t,n){return r(t,e)||(n.tokenize=o),i("string","string")}}function s(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function c(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function u(e,t,n,r,i){var o=e.cc;for(Y.state=e,Y.stream=i,Y.marked=null,Y.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():E;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Y.marked?Y.marked:"variable"==n&&c(e,r)?"variable-2":"variable"==n&&d(e,r)?"variable-3":t}}}function d(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;for(var n=e.importedtypes.length,r=0;n>r;r++)if(e.importedtypes[r]==t)return!0}function p(e){for(var t=Y.state,n=t.importedtypes;n;n=n.next)if(n.name==e)return;t.importedtypes={name:e,next:t.importedtypes}}function f(){for(var e=arguments.length-1;e>=0;e--)Y.cc.push(arguments[e])}function h(){return f.apply(null,arguments),!0}function m(e){var t=Y.state;if(t.context){Y.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function g(){Y.state.context||(Y.state.localVars=Q),Y.state.context={prev:Y.state.context,vars:Y.state.localVars}}function v(){Y.state.localVars=Y.state.context.vars,Y.state.context=Y.state.context.prev}function y(e,t){var n=function(){var n=Y.state;n.lexical=new l(n.indented,Y.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function _(){var e=Y.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function b(e){function t(n){return n==e?h():";"==e?f():h(t)}return t}function E(e){return"@"==e?h(k):"var"==e?h(y("vardef"),N,b(";"),_):"keyword a"==e?h(y("form"),w,E,_):"keyword b"==e?h(y("form"),E,_):"{"==e?h(y("}"),g,A,_,v):";"==e?h():"attribute"==e?h(I):"function"==e?h(U):"for"==e?h(y("form"),b("("),y(")"),F,b(")"),_,E,_):"variable"==e?h(y("stat"),M):"switch"==e?h(y("form"),w,y("}","switch"),b("{"),A,_,_):"case"==e?h(w,b(":")):"default"==e?h(b(":")):"catch"==e?h(y("form"),g,b("("),W,b(")"),E,_,v):"import"==e?h(T,b(";")):"typedef"==e?h(D):f(y("stat"),w,b(";"),_)}function w(e){return X.hasOwnProperty(e)?h(C):"function"==e?h(U):"keyword c"==e?h(S):"("==e?h(y(")"),S,b(")"),_,C):"operator"==e?h(w):"["==e?h(y("]"),R(w,"]"),_,C):"{"==e?h(y("}"),R(L,"}"),_,C):h()}function S(e){return e.match(/[;\}\)\],]/)?f():f(w)}function C(e,t){if("operator"==e&&/\+\+|--/.test(t))return h(C);if("operator"==e||":"==e)return h(w);if(";"!=e)return"("==e?h(y(")"),R(w,")"),_,C):"."==e?h(O,C):"["==e?h(y("]"),w,b("]"),_,C):void 0}function I(e){return"attribute"==e?h(I):"function"==e?h(U):"var"==e?h(N):void 0}function k(e){return":"==e?h(k):"variable"==e?h(k):"("==e?h(y(")"),R(x,")"),_,E):void 0}function x(e){return"variable"==e?h():void 0}function T(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(p(t),h()):"variable"==e||"property"==e||"."==e||"*"==t?h(T):void 0}function D(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(p(t),h()):"type"==e&&/[A-Z]/.test(t.charAt(0))?h():void 0}function M(e){return":"==e?h(_,E):f(C,b(";"),_)}function O(e){return"variable"==e?(Y.marked="property",h()):void 0}function L(e){return"variable"==e&&(Y.marked="property"),X.hasOwnProperty(e)?h(b(":"),w):void 0}function R(e,t){function n(r){return","==r?h(e,n):r==t?h():h(b(t))}return function(r){return r==t?h():f(e,n)}}function A(e){return"}"==e?h():f(E,A)}function N(e,t){return"variable"==e?(m(t),h(j,P)):h()}function P(e,t){return"="==t?h(w,P):","==e?h(N):void 0}function F(e,t){return"variable"==e&&m(t),h(y(")"),g,$,w,_,E,v)}function $(e,t){return"in"==t?h():void 0}function U(e,t){return"variable"==e?(m(t),h(U)):"new"==t?h(U):"("==e?h(y(")"),g,R(W,")"),_,j,E,v):void 0}function j(e){return":"==e?h(V):void 0}function V(e){return"type"==e?h():"variable"==e?h():"{"==e?h(y("}"),R(B,"}"),_):void 0}function B(e){return"variable"==e?h(j):void 0}function W(e,t){return"variable"==e?(m(t),h(j)):void 0}var H,q,z=e.indentUnit,G=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={type:"attribute",style:"attribute"},s=e("typedef");return{"if":t,"while":t,"else":n,"do":n,"try":n,"return":r,"break":r,"continue":r,"new":r,"throw":r,"var":e("var"),inline:a,"static":a,using:e("import"),"public":a,"private":a,cast:e("cast"),"import":e("import"),macro:e("macro"),"function":e("function"),"catch":e("catch"),untyped:e("untyped"),callback:e("cb"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,never:e("property_access"),trace:e("trace"),"class":s,"abstract":s,"enum":s,"interface":s,typedef:s,"extends":s,"implements":s,dynamic:s,"true":o,"false":o,"null":o}}(),K=/[+\-*&%=<>!?|]/,X={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Y={state:null,column:null,marked:null,cc:null},Q={name:"this",next:null};return _.lex=!0,{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:o,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new l((e||0)-z,0,"block",!1),localVars:t.localVars,importedtypes:n,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==H?n:(t.reAllowed=!("operator"!=H&&"keyword c"!=H&&!H.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=H,u(t,n,H,q,e))},indent:function(e,t){if(e.tokenize!=o)return 0;var n=t&&t.charAt(0),r=e.lexical;"stat"==r.type&&"}"==n&&(r=r.prev);var i=r.type,a=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+z:"switch"!=r.info||a?r.align?r.column+(a?0:1):r.indented+(a?0:z):r.indented+(/^(?:case|default)\b/.test(t)?z:2*z)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-haxe","haxe"),e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var n=e.peek(),r=e.sol();if("#"==n)return e.skipToEnd(),"comment";if(r&&"-"==n){var i="variable-2";return e.eat(/-/),"-"==e.peek()&&(e.eat(/-/),i="keyword a"),"D"==e.peek()&&(e.eat(/[D]/),i="keyword c",t.define=!0),e.eatWhile(/[A-Z]/i),i}var n=e.peek();return 0==t.inString&&"'"==n&&(t.inString=!0,n=e.next()),1==t.inString?(e.skipTo("'")||e.skipToEnd(),"'"==e.peek()&&(e.next(),t.inString=!1),"string"):(e.next(),null)},lineComment:"#"}}),e.defineMIME("text/x-hxml","hxml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/htmlembedded/htmlembedded",["../../lib/codemirror","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){e.defineMode("htmlembedded",function(t,n){function r(e,t){return e.match(s,!1)?(t.token=i,o.token(e,t.scriptState)):a.token(e,t.htmlState)}function i(e,t){return e.match(l,!1)?(t.token=r,a.token(e,t.htmlState)):o.token(e,t.scriptState)}var o,a,s=n.scriptStartRegex||/^<%/i,l=n.scriptEndRegex||/^%>/i;return{startState:function(){return o=o||e.getMode(t,n.scriptingModeSpec),a=a||e.getMode(t,"htmlmixed"),{token:n.startOpen?i:r,htmlState:e.startState(a),scriptState:e.startState(o)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==r?a.indent(e.htmlState,t):o.indent?o.indent(e.scriptState,t):void 0},copyState:function(t){return{token:t.token,htmlState:e.copyState(a,t.htmlState),scriptState:e.copyState(o,t.scriptState)}},innerMode:function(e){return e.token==i?{state:e.scriptState,mode:o}:{state:e.htmlState,mode:a}}}},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/http/http",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("http",function(){function e(e,t){return e.skipToEnd(),t.cur=a,"error"}function t(t,r){return t.match(/^HTTP\/\d\.\d/)?(r.cur=n,"keyword"):t.match(/^[A-Z]+/)&&/[ \t]/.test(t.peek())?(r.cur=i,"keyword"):e(t,r)}function n(t,n){var i=t.match(/^\d+/);if(!i)return e(t,n);n.cur=r;var o=Number(i[0]);return o>=100&&200>o?"positive informational":o>=200&&300>o?"positive success":o>=300&&400>o?"positive redirect":o>=400&&500>o?"negative client-error":o>=500&&600>o?"negative server-error":"error"}function r(e,t){return e.skipToEnd(),t.cur=a,null}function i(e,t){return e.eatWhile(/\S/),t.cur=o,"string-2"}function o(t,n){return t.match(/^HTTP\/\d\.\d$/)?(n.cur=a,"keyword"):e(t,n)}function a(e){return e.sol()&&!e.eat(/[ \t]/)?e.match(/^.*?:/)?"atom":(e.skipToEnd(),"error"):(e.skipToEnd(),"string")}function s(e){return e.skipToEnd(),null}return{token:function(e,t){var n=t.cur;return n!=a&&n!=s&&e.eatSpace()?null:n(e,t)},blankLine:function(e){e.cur=s},startState:function(){return{cur:t}}}}),e.defineMIME("message/http","http")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/jade/jade",["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Q.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Q.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Q.token(e,t.jsState);return n||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?G:void 0}function s(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function l(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Q.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,z):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,z):void 0}function d(e){return e.match(/^default\b/)?z:void 0}function p(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",z):void 0}function f(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",z):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",z):void 0}function m(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",z):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",z):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,z):void 0}function y(e,t){if(t.isIncludeFiltered){var n=x(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function _(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,z):void 0}function b(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,s(e,t)):void 0}function E(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function w(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,z):void 0}function S(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,z):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,z;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function I(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,z):void 0}function k(e,t){var n;return(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function x(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),j(n,r,i),"atom"}}function T(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function D(e){return e.match(/^#([\w-]+)/)?K:void 0}function M(e){return e.match(/^\.([\w-]+)/)?X:void 0}function O(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function L(e,t){if(t.isAttrs){if(Y[e.peek()]&&t.attrsNest.push(Y[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Q.startState(),t.attributeIsType="script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?!0:!1),"attribute";var n=Q.token(e,t.jsState);if(t.attributeIsType&&"string"===n&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),L(e,t)}catch(r){}return t.attrValue+=e.current(),n||!0}}function R(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function A(e){return e.sol()&&e.eatSpace()?"indent":void 0}function N(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function P(e){return e.match(/^: */)?"colon":void 0}function F(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(j(e,t,"htmlmixed"),t.innerModeForLine=!0,V(e,t,!0)):void 0}function $(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),j(e,t,n),"dot"}}function U(e){return e.next(),null}function j(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function V(e,t,n){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||n?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function B(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function W(){return new n}function H(e){return e.copy()}function q(e,t){var n=V(e,t)||B(e,t)||l(e,t)||y(e,t)||C(e,t)||L(e,t)||r(e,t)||i(e,t)||E(e,t)||o(e,t)||a(e,t)||s(e,t)||c(e,t)||u(e,t)||d(e,t)||p(e,t)||f(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||_(e,t)||b(e,t)||w(e,t)||S(e,t)||I(e,t)||k(e,t)||x(e,t)||T(e,t)||D(e,t)||M(e,t)||O(e,t)||R(e,t)||A(e,t)||F(e,t)||N(e,t)||P(e,t)||$(e,t)||U(e,t);return n===!0?null:n}var z="keyword",G="meta",K="builtin",X="qualifier",Y={"{":"}","(":")","[":"]"},Q=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Q,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:W,copyState:H,token:q}}),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/jinja2/jinja2",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("jinja2",function(){function e(e,a){var s=e.peek();if(a.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.sign){if(a.sign=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.instring)return s==a.instring&&(a.instring=!1),e.next(),"string";if("'"==s||'"'==s)return a.instring=s,e.next(),"string";if(e.match(a.intag+"}")||e.eat("-")&&e.match(a.intag+"}"))return a.intag=!1,"tag";if(e.match(n))return a.operator=!0,"operator";if(e.match(r))a.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(t))return"keyword";if(e.match(i))return"atom";if(e.match(o))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(s=e.eat("#"))return a.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(s=e.eat(/\{|%/))return a.intag=s,"{"==s&&(a.intag="}"),e.eat("-"),"tag"}e.next()}var t=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],n=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,i=["true","false"],o=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return t=new RegExp("(("+t.join(")|(")+"))\\b"),i=new RegExp("(("+i.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,t){return t.tokenize(e,t)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/julia/julia",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("julia",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){var t=i(e);return"["==t||"{"==t?!0:!1}function i(e){return 0==e.scopes.length?null:e.scopes[e.scopes.length-1]}function o(e,t){var n=t.leaving_expr;if(e.sol()&&(n=!1),t.leaving_expr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/^\.{2,3}/))return"operator";if(e.eatSpace())return null;var o=e.peek();if("#"===o)return e.skipToEnd(),"comment";"["===o&&t.scopes.push("["),"{"===o&&t.scopes.push("{");var s=i(t);"["===s&&"]"===o&&(t.scopes.pop(),t.leaving_expr=!0),"{"===s&&"}"===o&&(t.scopes.pop(),t.leaving_expr=!0),")"===o&&(t.leaving_expr=!0);var p;if(!r(t)&&(p=e.match(_,!1))&&t.scopes.push(p),!r(t)&&e.match(b,!1)&&t.scopes.pop(),r(t)&&e.match(/^end/))return"number";if(e.match(/^=>/))return"operator";if(e.match(/^[0-9\.]/,!1)){var f=RegExp(/^im\b/),h=!1;if(e.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(h=!0),e.match(/^\d+\.(?!\.)\d*/)&&(h=!0),e.match(/^\.\d+/)&&(h=!0),h)return e.match(f),t.leaving_expr=!0,"number";var m=!1;if(e.match(/^0x[0-9a-f]+/i)&&(m=!0),e.match(/^0b[01]+/i)&&(m=!0),e.match(/^0o[0-7]+/i)&&(m=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^0(?![\dx])/i)&&(m=!0),m)return e.match(f),t.leaving_expr=!0,"number"}return e.match(/^(::)|(<:)/)?"operator":!n&&e.match(w)?"string":e.match(c)?"operator":e.match(g)?(t.tokenize=a(e.current()),t.tokenize(e,t)):e.match(E)?"meta":e.match(u)?null:e.match(v)?"keyword":e.match(y)?"builtin":e.match(d)?(t.leaving_expr=!0,"variable"):(e.next(),l)}function a(e){function n(n,a){for(;!n.eol();)if(n.eatWhile(/[^'"\\]/),n.eat("\\")){if(n.next(),r&&n.eol())return i}else{if(n.match(e))return a.tokenize=o,i;n.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return l;a.tokenize=o}return i}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length,i="string";return n.isString=!0,n}function s(e,t){S=null;var n=t.tokenize(e,t),r=e.current();return"."===r?(n=e.match(d,!1)?null:l,null===n&&"meta"===t.lastStyle&&(n="meta"),n):n}var l="error",c=t.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,u=t.delimiters||/^[;,()[\]{}]/,d=t.identifiers||/^[_A-Za-z][_A-Za-z0-9]*!*/,p=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],f=["end","else","elseif","catch","finally"],h=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],m=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],g=/^(`|'|"{3}|([br]?"))/,v=n(h),y=n(m),_=n(p),b=n(f),E=/^@[_A-Za-z][_A-Za-z0-9]*/,w=/^:[_A-Za-z][_A-Za-z0-9]*/,S=null,C={startState:function(){return{tokenize:o,scopes:[],leaving_expr:!1}},token:function(e,t){var n=s(e,t);return t.lastStyle=n,n},indent:function(e,t){var n=0;return("end"==t||"]"==t||"}"==t||"else"==t||"elseif"==t||"catch"==t||"finally"==t)&&(n=-1),4*(e.scopes.length+n)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return C}),e.defineMIME("text/x-julia","julia")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/kotlin/kotlin",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("kotlin",function(e,t){function n(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function r(e,t){var n=e.next();if('"'==n||"'"==n)return i(n,e,t);if("."==n&&e.eat("*"))return"word";if(/[\[\]{}\(\),;\:\.]/.test(n))return p=n,null;if(/\d/.test(n))return e.eat(/eE/)&&(e.eat(/\+\-/),e.eatWhile(/\d/)),"number";if("/"==n){if(e.eat("*"))return t.tokenize.push(s),s(e,t);if(e.eat("/"))return e.skipToEnd(),"comment";if(l(t.lastToken))return i(n,e,t)}if("-"==n&&e.eat(">"))return p="->",null;if(/[\-+*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[\-+*&%=<>|~]/),"operator";e.eatWhile(/[\w\$_]/);var r=e.current();return v.propertyIsEnumerable(r)?"atom":m.propertyIsEnumerable(r)?(g.propertyIsEnumerable(r)&&(p="newstatement"),"softKeyword"):h.propertyIsEnumerable(r)?(g.propertyIsEnumerable(r)&&(p="newstatement"),"keyword"):"word"}function i(e,t,n){function r(t,n){for(var s,l=!1,c=!i;null!=(s=t.next());){if(s==e&&!l){if(!i)break;if(t.match(e+e)){c=!0;break}}if('"'==e&&"$"==s&&!l&&t.eat("{"))return n.tokenize.push(o()),"string";if("$"==s&&!l&&!t.eat(" "))return n.tokenize.push(a()),"string";l=!l&&"\\"==s}return f&&n.tokenize.push(r),c&&n.tokenize.pop(),"string"}var i=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";i=!0}return n.tokenize.push(r),r(t,n)}function o(){function e(e,n){if("}"==e.peek()){if(t--,0==t)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](e,n)}else"{"==e.peek()&&t++;return r(e,n)}var t=1;return e.isBase=!0,e}function a(){function e(e,t){if(e.eat(/[\w]/)){var n=e.eatWhile(/[\w]/);if(n)return t.tokenize.pop(),"word"}return t.tokenize.pop(),"string"}return e.isBase=!0,e}function s(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function l(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e
43}function c(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function u(e,t,n){return e.context=new c(e.indented,t,n,null,e.context)}function d(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var p,f=t.multiLineStrings,h=n("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),m=n("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),g=n("catch class do else finally for if where try while enum"),v=n("null true false this");return r.isBase=!0,{startState:function(t){return{tokenize:[r],context:new c((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||l(t.lastToken)||(d(t),n=t.context)),e.eatSpace())return null;p=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=p&&":"!=p||"statement"!=n.type)if("->"==p&&"statement"==n.type&&"}"==n.prev.type)d(t),t.context.align=!1;else if("{"==p)u(t,e.column(),"}");else if("["==p)u(t,e.column(),"]");else if("("==p)u(t,e.column(),")");else if("}"==p){for(;"statement"==n.type;)n=d(t);for("}"==n.type&&(n=d(t));"statement"==n.type;)n=d(t)}else p==n.type?d(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==p)&&u(t,e.column(),"statement");else d(t);return t.startOfLine=!1,t.lastToken=p||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||l(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}"}}),e.defineMIME("text/x-kotlin","kotlin")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/livescript/livescript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("livescript",function(){var e=function(e,t){var n=t.next||"start";if(n){t.next=t.next;var r=o[n];if(r.splice){for(var i=0;i<r.length;++i){var a,s=r[i];if(s.regex&&(a=e.match(s.regex)))return t.next=s.next||t.next,s.token}return e.next(),"error"}if(e.match(s=o[n]))return s.regex&&e.match(s.regex)?(t.next=s.next,s.token):(e.next(),"error")}return e.next(),"error"},t={startState:function(){return{next:"start",lastToken:null}},token:function(t,n){for(;t.pos==t.start;)var r=e(t,n);return n.lastToken={style:r,indent:t.indentation(),content:t.current()},r.replace(/\./g," ")},indent:function(e){var t=e.lastToken.indent;return e.lastToken.content.match(n)&&(t+=2),t}};return t});var t="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",n=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+t+")?))\\s*$"),r="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",i={token:"string",regex:".+"},o={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+r},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+r},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+r},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+r},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+r},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+r},{token:"identifier",regex:t+"\\s*:(?![:=])"},{token:"variable",regex:t},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:t,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},i],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},i],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},i],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},i],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},i],words:[{token:"string",regex:".*?\\]>",next:"key"},i]};for(var a in o){var s=o[a];if(s.splice)for(var l=0,c=s.length;c>l;++l){var u=s[l];"string"==typeof u.regex&&(o[a][l].regex=new RegExp("^"+u.regex))}else"string"==typeof u.regex&&(o[a].regex=new RegExp("^"+s.regex))}e.defineMIME("text/x-livescript","livescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/lua/lua",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=s(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function s(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var l=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),d=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),p=r(["function","if","repeat","do","\\(","{"]),f=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(d.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(p.test(r)?++t.indentDepth:f.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/mirc/mirc",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMIME("text/mirc","mirc"),e.defineMode("mirc",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(e,n){var c=n.beforeParams;n.beforeParams=!1;var u=e.next();if(/[\[\]{}\(\),\.]/.test(u))return"("==u&&c?n.inParams=!0:")"==u&&(n.inParams=!1),null;if(/\d/.test(u))return e.eatWhile(/[\w\.]/),"number";if("\\"==u)return e.eat("\\"),e.eat(/./),"number";if("/"==u&&e.eat("*"))return t(e,n,r);if(";"==u&&e.match(/ *\( *\(/))return t(e,n,i);if(";"!=u||n.inParams){if('"'==u)return e.eat(/"/),"keyword";if("$"==u)return e.eatWhile(/[$_a-z0-9A-Z\.:]/),o&&o.propertyIsEnumerable(e.current().toLowerCase())?"keyword":(n.beforeParams=!0,"builtin");if("%"==u)return e.eatWhile(/[^,^\s^\(^\)]/),n.beforeParams=!0,"string";if(l.test(u))return e.eatWhile(l),"operator";e.eatWhile(/[\w\$_{}]/);var d=e.current().toLowerCase();return a&&a.propertyIsEnumerable(d)?"keyword":s&&s.propertyIsEnumerable(d)?(n.beforeParams=!0,"keyword"):null}return e.skipToEnd(),"comment"}function r(e,t){for(var r,i=!1;r=e.next();){if("/"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function i(e,t){for(var r,i=0;r=e.next();){if(";"==r&&2==i){t.tokenize=n;break}")"==r?i++:" "!=r&&(i=0)}return"meta"}var o=e("$! $$ $& $? $+ $abook $abs $active $activecid $activewid $address $addtok $agent $agentname $agentstat $agentver $alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime $asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind $binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes $chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color $com $comcall $comchan $comerr $compact $compress $comval $cos $count $cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight $dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress $deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll $dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error $eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir $finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve $fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt $group $halted $hash $height $hfind $hget $highlight $hnick $hotline $hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil $inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect $insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile $isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive $lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock $lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer $maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext $menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode $modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile $nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly $opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree $pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo $readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex $reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline $sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin $site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname $sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped $syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp $timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel $ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver $version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor"),a=e("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice away background ban bcopy beep bread break breplace bset btrunc bunset bwrite channel clear clearall cline clipboard close cnick color comclose comopen comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver debug dec describe dialog did didtok disable disconnect dlevel dline dll dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable events exit fclose filter findtext finger firewall flash flist flood flush flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear ialmark identd if ignore iline inc invite iuser join kick linesep links list load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice qme qmsg query queryn quit raw reload remini remote remove rename renwin reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini say scid scon server set showmirc signam sline sockaccept sockclose socklist socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs elseif else goto menu nicklist status title icon size option text edit button check radio box scroll list combo link tab item"),s=e("if elseif else and not or eq ne in ni for foreach while switch"),l=/[+\-*&%=<>!?^\/\|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/mllike/mllike",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("mllike",function(e,t){function n(e,n){var a=e.next();if('"'===a)return n.tokenize=r,n.tokenize(e,n);if("("===a&&e.eat("*"))return n.commentLevel++,n.tokenize=i,n.tokenize(e,n);if("~"===a)return e.eatWhile(/\w/),"variable-2";if("`"===a)return e.eatWhile(/\w/),"quote";if("/"===a&&t.slashComments&&e.eat("/"))return e.skipToEnd(),"comment";if(/\d/.test(a))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(a))return"operator";e.eatWhile(/\w/);var s=e.current();return o[s]||"variable"}function r(e,t){for(var r,i=!1,o=!1;null!=(r=e.next());){if('"'===r&&!o){i=!0;break}o=!o&&"\\"===r}return i&&!o&&(t.tokenize=n),"string"}function i(e,t){for(var r,i;t.commentLevel>0&&null!=(i=e.next());)"("===r&&"*"===i&&t.commentLevel++,"*"===r&&")"===i&&t.commentLevel--,r=i;return t.commentLevel<=0&&(t.tokenize=n),"comment"}var o={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},a=t.extraWords||{};for(var s in a)a.hasOwnProperty(s)&&(o[s]=t.extraWords[s]);return{startState:function(){return{tokenize:n,commentLevel:0}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:t.slashComments?"//":null}}),e.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),e.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/modelica/modelica",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}e.defineMode("modelica",function(t,n){function r(e,t){return e.skipToEnd(),t.tokenize=null,"comment"}function i(e,t){for(var n,r=!1;n=e.next();){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return"comment"}function o(e,t){for(var n,r=!1;null!=(n=e.next());){if('"'==n&&!r){t.tokenize=null,t.sol=!1;break}r=!r&&"\\"==n}return"string"}function a(e,t){for(e.eatWhile(m);e.eat(m)||e.eat(g););var n=e.current();return!t.sol||"package"!=n&&"model"!=n&&"when"!=n&&"connector"!=n?t.sol&&"end"==n&&t.level>0&&t.level--:t.level++,t.tokenize=null,t.sol=!1,u.propertyIsEnumerable(n)?"keyword":d.propertyIsEnumerable(n)?"builtin":p.propertyIsEnumerable(n)?"atom":"variable"}function s(e,t){for(;e.eat(/[^']/););return t.tokenize=null,t.sol=!1,e.eat("'")?"variable":"error"}function l(e,t){return e.eatWhile(m),e.eat(".")&&e.eatWhile(m),(e.eat("e")||e.eat("E"))&&(e.eat("-")||e.eat("+"),e.eatWhile(m)),t.tokenize=null,t.sol=!1,"number"}var c=t.indentUnit,u=n.keywords||{},d=n.builtin||{},p=n.atoms||{},f=/[;=\(:\),{}.*<>+\-\/^\[\]]/,h=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,m=/[0-9]/,g=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(e,t){if(null!=t.tokenize)return t.tokenize(e,t);if(e.sol()&&(t.sol=!0),e.eatSpace())return t.tokenize=null,null;var n=e.next();if("/"==n&&e.eat("/"))t.tokenize=r;else if("/"==n&&e.eat("*"))t.tokenize=i;else{if(h.test(n+e.peek()))return e.next(),t.tokenize=null,"operator";if(f.test(n))return t.tokenize=null,"operator";if(g.test(n))t.tokenize=a;else if("'"==n&&e.peek()&&"'"!=e.peek())t.tokenize=s;else if('"'==n)t.tokenize=o;else{if(!m.test(n))return t.tokenize=null,"error";t.tokenize=l}}return t.tokenize(e,t)},indent:function(t,n){if(null!=t.tokenize)return e.Pass;var r=t.level;return/(algorithm)/.test(n)&&r--,/(equation)/.test(n)&&r--,/(initial algorithm)/.test(n)&&r--,/(initial equation)/.test(n)&&r--,/(end)/.test(n)&&r--,r>0?c*r:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var r="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",i="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",o="Real Boolean Integer String";n(["text/x-modelica"],{name:"modelica",keywords:t(r),builtin:t(i),atoms:t(o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/nginx/nginx",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return s=t,e}function r(e,t){e.eatWhile(/[\w\$_]/);var r=e.current();if(l.propertyIsEnumerable(r))return"keyword";if(c.propertyIsEnumerable(r))return"variable-2";if(u.propertyIsEnumerable(r))return"string-2";var s=e.next();return"@"==s?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==s&&e.eat("*")?(t.tokenize=i,i(e,t)):"<"==s&&e.eat("!")?(t.tokenize=o,o(e,t)):"="!=s?"~"!=s&&"|"!=s||!e.eat("=")?'"'==s||"'"==s?(t.tokenize=a(s),t.tokenize(e,t)):"#"==s?(e.skipToEnd(),n("comment","comment")):"!"==s?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(s)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(s)?n(null,"select-op"):/[;{}:\[\]]/.test(s)?n(null,s):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var s,l=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),d=e.indentUnit;return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==s&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==r&&"comment"!=s&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*d},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/ntriples/ntriples",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("ntriples",function(){function e(e,n){var r,i=e.location;r=i==t.PRE_SUBJECT&&"<"==n?t.WRITING_SUB_URI:i==t.PRE_SUBJECT&&"_"==n?t.WRITING_BNODE_URI:i==t.PRE_PRED&&"<"==n?t.WRITING_PRED_URI:i==t.PRE_OBJ&&"<"==n?t.WRITING_OBJ_URI:i==t.PRE_OBJ&&"_"==n?t.WRITING_OBJ_BNODE:i==t.PRE_OBJ&&'"'==n?t.WRITING_OBJ_LITERAL:i==t.WRITING_SUB_URI&&">"==n?t.PRE_PRED:i==t.WRITING_BNODE_URI&&" "==n?t.PRE_PRED:i==t.WRITING_PRED_URI&&">"==n?t.PRE_OBJ:i==t.WRITING_OBJ_URI&&">"==n?t.POST_OBJ:i==t.WRITING_OBJ_BNODE&&" "==n?t.POST_OBJ:i==t.WRITING_OBJ_LITERAL&&'"'==n?t.POST_OBJ:i==t.WRITING_LIT_LANG&&" "==n?t.POST_OBJ:i==t.WRITING_LIT_TYPE&&">"==n?t.POST_OBJ:i==t.WRITING_OBJ_LITERAL&&"@"==n?t.WRITING_LIT_LANG:i==t.WRITING_OBJ_LITERAL&&"^"==n?t.WRITING_LIT_TYPE:" "!=n||i!=t.PRE_SUBJECT&&i!=t.PRE_PRED&&i!=t.PRE_OBJ&&i!=t.POST_OBJ?i==t.POST_OBJ&&"."==n?t.PRE_SUBJECT:t.ERROR:i,e.location=r}var t={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:t.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(t,n){var r=t.next();if("<"==r){e(n,r);var i="";return t.eatWhile(function(e){return"#"!=e&&">"!=e?(i+=e,!0):!1}),n.uris.push(i),t.match("#",!1)?"variable":(t.next(),e(n,">"),"variable")}if("#"==r){var o="";return t.eatWhile(function(e){return">"!=e&&" "!=e?(o+=e,!0):!1}),n.anchors.push(o),"variable-2"}if(">"==r)return e(n,">"),"variable";if("_"==r){e(n,r);
44var a="";return t.eatWhile(function(e){return" "!=e?(a+=e,!0):!1}),n.bnodes.push(a),t.next(),e(n," "),"builtin"}if('"'==r)return e(n,r),t.eatWhile(function(e){return'"'!=e}),t.next(),"@"!=t.peek()&&"^"!=t.peek()&&e(n,'"'),"string";if("@"==r){e(n,"@");var s="";return t.eatWhile(function(e){return" "!=e?(s+=e,!0):!1}),n.langs.push(s),t.next(),e(n," "),"string-2"}if("^"==r){t.next(),e(n,"^");var l="";return t.eatWhile(function(e){return">"!=e?(l+=e,!0):!1}),n.types.push(l),t.next(),e(n,">"),"variable"}" "==r&&e(n,r),"."==r&&e(n,r)}}}),e.defineMIME("text/n-triples","ntriples")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/octave/octave",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("octave",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function t(e,t){return e.sol()||"'"!==e.peek()?(t.tokenize=r,r(e,t)):(e.next(),t.tokenize=r,"operator")}function n(e,t){return e.match(/^.*%}/)?(t.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(f,h){if(f.eatSpace())return null;if(f.match("%{"))return h.tokenize=n,f.skipToEnd(),"comment";if(f.match(/^[%#]/))return f.skipToEnd(),"comment";if(f.match(/^[0-9\.+-]/,!1)){if(f.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return f.tokenize=r,"number";if(f.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(f.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return f.match(e(["nan","NaN","inf","Inf"]))?"number":f.match(/^"([^"]|(""))*"/)?"string":f.match(/^'([^']|(''))*'/)?"string":f.match(p)?"keyword":f.match(d)?"builtin":f.match(u)?"variable":f.match(i)||f.match(a)?"operator":f.match(o)||f.match(s)||f.match(l)?null:f.match(c)?(h.tokenize=t,null):(f.next(),"error")}var i=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),o=new RegExp("^[\\(\\[\\{\\},:=;]"),a=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),s=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),l=new RegExp("^((>>=)|(<<=))"),c=new RegExp("^[\\]\\)]"),u=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),d=e(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),p=e(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:r}},token:function(e,n){var r=n.tokenize(e,n);return("number"===r||"variable"===r)&&(n.tokenize=t),r}}}),e.defineMIME("text/x-octave","octave")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/pascal/pascal",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("pascal",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t){var s=e.next();if("#"==s&&t.startOfLine)return e.skipToEnd(),"meta";if('"'==s||"'"==s)return t.tokenize=n(s),t.tokenize(e,t);if("("==s&&e.eat("*"))return t.tokenize=r,r(e,t);if(/[\[\]{}\(\),;\:\.]/.test(s))return null;if(/\d/.test(s))return e.eatWhile(/[\w\.]/),"number";if("/"==s&&e.eat("/"))return e.skipToEnd(),"comment";if(a.test(s))return e.eatWhile(a),"operator";e.eatWhile(/[\w\$_]/);var l=e.current();return i.propertyIsEnumerable(l)?"keyword":o.propertyIsEnumerable(l)?"atom":"variable"}function n(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i)&&(n.tokenize=null),"string"}}function r(e,t){for(var n,r=!1;n=e.next();){if(")"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}var i=e("and array begin case const div do downto else end file for forward integer boolean char function goto if in label mod nil not of or packed procedure program record repeat set string then to type until var while with"),o={"null":!0},a=/[+\-*&%=<>!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var r=(n.tokenize||t)(e,n);return"comment"==r||"meta"==r?r:r},electricChars:"{}"}}),e.defineMIME("text/x-pascal","pascal")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/pegjs/pegjs",["../../lib/codemirror","../javascript/javascript"],e):e(CodeMirror)}(function(e){e.defineMode("pegjs",function(t){function n(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}var r=e.getMode(t,"javascript");return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inChracterClass:!1,braced:0,lhs:!0,localState:null}},token:function(e,t){if(e&&(t.inString||t.inComment||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0)),t.inString||t.inComment||!e.match(/^\/\*/)||(t.inComment=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}if(t.inComment){for(;t.inComment&&!e.eol();)e.match(/\*\//)?t.inComment=!1:e.match(/^.[^\*]*/);return"comment"}if(t.inChracterClass)for(;t.inChracterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||(t.inChracterClass=!1);else{if("["===e.peek())return e.next(),t.inChracterClass=!0,"bracket";if(e.match(/^\/\//))return e.skipToEnd(),"comment";if(t.braced||"{"===e.peek()){null===t.localState&&(t.localState=r.startState());var i=r.token(e,t.localState),o=e.current();if(!i)for(var a=0;a<o.length;a++)"{"===o[a]?t.braced++:"}"===o[a]&&t.braced--;return i}if(n(e))return":"===e.peek()?"variable":"variable-2";if(-1!=["[","]","(",")"].indexOf(e.peek()))return e.next(),"bracket";e.eatSpace()||e.next()}return null}}},"javascript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/perl/perl",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&n>t?t:r)}function i(e,t){var n,r=e.pos+t;e.pos=0>=r?0:r>=(n=e.string.length-1)?n:r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,s=!1,l=0;o=e.next();){if(o===n[l]&&!s)return void 0!==n[++l]?(t.chain=n[l],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;s=!s&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var d=a.next();if('"'==d||"'"==d){if(n(a,3)=="<<"+d){var p=a.pos;a.eatWhile(/\w/);var f=a.current().substr(1);if(f&&a.eat(d))return o(a,u,f);a.pos=p}return e(a,u,[d],"string")}if("q"==d){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==d){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],l,c);if("("==h)return e(a,u,[")"],l,c);if("["==h)return e(a,u,["]"],l,c);if("{"==h)return e(a,u,["}"],l,c);if("<"==h)return e(a,u,[">"],l,c)}}if("s"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("y"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("t"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("`"==d)return e(a,u,[d],"variable-2");if("/"==d)return/~\s*$/.test(n(a))?e(a,u,[d],l,c):"operator";if("$"==d){var p=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=p}if(/[$@%]/.test(d)){var p=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(s[h])return"variable-2"}a.pos=p}if(/[$@%&]/.test(d)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return s[h]?"variable-2":"variable"}if("#"==d&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(d)){var p=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),s[a.current()])return"operator";a.pos=p}if("_"==d&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\x00"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\x00"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\x00"],"string")}if(/\w/.test(d)){var p=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=p}if(/[A-Z]/.test(d)){var m=t(a,-2),p=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=p}if(/[a-zA-Z_]/.test(d)){var m=t(a,-2);a.eatWhile(/\w/);var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var s={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},l="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},electricChars:"{}"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/php/php",["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e){return function(t,n){return t.match(e)?n.tokenize=null:t.skipToEnd(),"string"}}function r(e){return 0==e.length?i:function(t,n){for(var o=e[0],a=0;a<o.length;a++)if(t.match(o[a][0]))return n.tokenize=r(e.slice(1)),o[a][1];return n.tokenize=i,"string"}}function i(e,t){var n,i=!1,o=!1;if('"'==e.current())return"string";if(e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(e.match(/\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=r([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]])),e.match(/\-\>\w/,!1)&&(t.tokenize=r([[["->",null]],[[/[\w]+/,"variable"]]])),"variable-2";for(;!(e.eol()||e.match("{$",!1)||e.match(/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1)&&!i);){if(n=e.next(),!i&&'"'==n){o=!0;break}i=!i&&"\\"==n}return o&&(t.tokenize=null,t.phpEncapsStack.pop()),"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){return e.match(/<</)?(e.eatWhile(/[\w\.]/),t.tokenize=n(e.current().slice(3)),t.tokenize(e,t)):!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return t.phpEncapsStack||(t.phpEncapsStack=[]),t.phpEncapsStack.push(0),t.tokenize=i,t.tokenize(e,t)},"{":function(e,t){return t.phpEncapsStack&&t.phpEncapsStack.length>0&&t.phpEncapsStack[t.phpEncapsStack.length-1]++,!1},"}":function(e,t){return t.phpEncapsStack&&t.phpEncapsStack.length>0&&0==--t.phpEncapsStack[t.phpEncapsStack.length-1]&&(t.tokenize=i),!1}}};e.defineMode("php",function(t,n){function r(e,t){var n=t.curMode==o;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),n)return n&&null==t.php.tokenize&&e.match("?>")?(t.curMode=i,t.curState=t.html,"meta"):o.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var r=t.pending.style}else var r=i.token(e,t.curState);t.pending&&(t.pending=null);var a,s=e.current(),l=s.search(/<\?/);return-1!=l&&(t.pending="string"==r&&(a=s.match(/[\'\"]$/))&&!/\?>/.test(s)?a[0]:{end:e.pos,style:r},e.backUp(s.length-l)),r}var i=e.getMode(t,"text/html"),o=e.getMode(t,l);return{startState:function(){var t=e.startState(i),r=e.startState(o);return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),s=t.php,l=e.copyState(o,s);return n=t.curMode==i?a:l,{html:a,php:l,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/pig/pig",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("pig",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function r(e,t){return s=e,t}function i(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=a;break}i="*"==n}return r("comment","comment")}function o(e){return function(t,n){for(var i,o=!1,s=!1;null!=(i=t.next());){if(i==e&&!o){s=!0;break}o=!o&&"\\"==i}return(s||!o&&!d)&&(n.tokenize=a),r("string","error")}}function a(e,t){var a=e.next();return'"'==a||"'"==a?n(e,t,o(a)):/[\[\]{}\(\),;\.]/.test(a)?r(a):/\d/.test(a)?(e.eatWhile(/[\w\.]/),r("number","number")):"/"==a?e.eat("*")?n(e,t,i):(e.eatWhile(p),r("operator","operator")):"-"==a?e.eat("-")?(e.skipToEnd(),r("comment","comment")):(e.eatWhile(p),r("operator","operator")):p.test(a)?(e.eatWhile(p),r("operator","operator")):(e.eatWhile(/[\w\$_]/),l&&l.propertyIsEnumerable(e.current().toUpperCase())&&!e.eat(")")&&!e.eat(".")?"keyword":c&&c.propertyIsEnumerable(e.current().toUpperCase())?"variable-2":u&&u.propertyIsEnumerable(e.current().toUpperCase())?"variable-3":r("variable","pig-word"))}var s,l=t.keywords,c=t.builtins,u=t.types,d=t.multiLineStrings,p=/[*+\-%<>=&?:\/!|]/;return{startState:function(){return{tokenize:a,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),function(){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var n="ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ",r="VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE NEQ MATCHES TRUE FALSE DUMP",i="BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ";
45e.defineMIME("text/x-pig",{name:"pig",builtins:t(n),keywords:t(r),types:t(i)}),e.registerHelper("hintWords","pig",(n+i+r).split(" "))}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/properties/properties",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("properties",function(){return{token:function(e,t){var n=e.sol()||t.afterSection,r=e.eol();if(t.afterSection=!1,n&&(t.nextMultiline?(t.inMultiline=!0,t.nextMultiline=!1):t.position="def"),r&&!t.nextMultiline&&(t.inMultiline=!1,t.position="def"),n)for(;e.eatSpace(););var i=e.next();return!n||"#"!==i&&"!"!==i&&";"!==i?n&&"["===i?(t.afterSection=!0,e.skipTo("]"),e.eat("]"),"header"):"="===i||":"===i?(t.position="quote",null):("\\"===i&&"quote"===t.position&&"u"!==e.next()&&(t.nextMultiline=!0),t.position):(t.position="comment",e.skipToEnd(),"comment")},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}}}),e.defineMIME("text/x-properties","properties"),e.defineMIME("text/x-ini","properties")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/puppet/puppet",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("puppet",function(){function e(e,t){for(var n=t.split(" "),i=0;i<n.length;i++)r[n[i]]=e}function t(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),t.continueString=n==t.pending?!1:!0,"string"}function n(e,n){var o=e.match(/[\w]+/,!1),a=e.match(/(\s+)?\w+\s+=>.*/,!1),s=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),l=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),c=e.next();if("$"===c)return e.match(i)?n.continueString?"variable-2":"variable":"error";if(n.continueString)return e.backUp(1),t(e,n);if(n.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/))return"def";e.match(/\s+{/),n.inDefinition=!1}return n.inInclude?(e.match(/(\s+)?\S+(\s+)?/),n.inInclude=!1,"def"):e.match(/(\s+)?\w+\(/)?(e.backUp(1),"def"):a?(e.match(/(\s+)?\w+/),"tag"):o&&r.hasOwnProperty(o)?(e.backUp(1),e.match(/[\w]+/),e.match(/\s+\S+\s+{/,!1)&&(n.inDefinition=!0),"include"==o&&(n.inInclude=!0),r[o]):/(\s+)?[A-Z]/.test(o)?(e.backUp(1),e.match(/(\s+)?[A-Z][\w:_]+/),"def"):s?(e.match(/(\s+)?[\w:_]+/),"def"):l?(e.match(/(\s+)?[@]{1,2}/),"special"):"#"==c?(e.skipToEnd(),"comment"):"'"==c||'"'==c?(n.pending=c,t(e,n)):"{"==c||"}"==c?"bracket":"/"==c?(e.match(/.*?\//),"variable-3"):c.match(/[0-9]/)?(e.eatWhile(/[0-9]+/),"number"):"="==c?(">"==e.peek()&&e.next(),"operator"):(e.eatWhile(/[\w-]/),null)}var r={},i=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return e("keyword","class define site node include import inherits"),e("keyword","case if else in and elsif default or"),e("atom","false true running present absent file directory undef"),e("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,t){return e.eatSpace()?null:n(e,t)}}}),e.defineMIME("text/x-puppet","puppet")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/python/python",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(l,c){function u(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?f(e,t,"py"):r>i&&h(e,t)&&(t.errorToken=!0),null}var o=d(e,t);return r>0&&h(e,t)&&(o+=" "+g),o}return d(e,t)}function d(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(k)?(t.tokenize=p(e.current()),t.tokenize(e,t)):e.match(E)||e.match(b)?null:e.match(_)||e.match(v)||e.match(r)?"operator":e.match(y)?null:e.match(x)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function p(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=u,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return g;i.tokenize=u}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function f(e,t,r){var i=0,o=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?l.indentUnit:S),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:r,align:o})}function h(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(w,!1)?null:g,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return e.match(w,!1)?"meta":g;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||f(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&f(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(n(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var g="error",v=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),y=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),_=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),b=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),E=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),w=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),S=c.hangingIndent||l.indentUnit,C=i,I=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(I=I.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(s.keywords),I=I.concat(s.builtins);var k=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),I=I.concat(a.builtins);var k=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var x=t(C),T=t(I),D={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+g:r},indent:function(t,r){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=n(t),o=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},lineComment:"#",fold:"indent"};return D}),e.defineMIME("text/x-python","python");var l=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:l("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/q/q",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("q",function(e){function t(e){return new RegExp("^("+e.join("|")+")$")}function n(e,t){var i=e.sol(),s=e.next();if(c=null,i){if("/"==s)return(t.tokenize=r)(e,t);if("\\"==s)return e.eol()||/\s/.test(e.peek())?(e.skipToEnd(),/^\\\s*$/.test(e.current())?(t.tokenize=o)(e,t):t.tokenize=n,"comment"):(t.tokenize=n,"builtin")}if(/\s/.test(s))return"/"==e.peek()?(e.skipToEnd(),"comment"):"whitespace";if('"'==s)return(t.tokenize=a)(e,t);if("`"==s)return e.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==s&&/\d/.test(e.peek())||/\d/.test(s)){var l=null;return e.backUp(1),e.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/)?l="temporal":(e.match(/^0[NwW]{1}/)||e.match(/^0x[\d|a-f|A-F]*/)||e.match(/^[0|1]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(l="number"),!l||(s=e.peek())&&!p.test(s)?(e.next(),"error"):l}return/[A-Z|a-z]|\./.test(s)?(e.eatWhile(/[A-Z|a-z|\.|_|\d]/),d.test(e.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(s)?null:/[{}\(\[\]\)]/.test(s)?null:"error"}function r(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=i)(e,t):t.tokenize=n,"comment"}function i(e,t){var r=e.sol()&&"\\"==e.peek();return e.skipToEnd(),r&&/^\\\s*$/.test(e.current())&&(t.tokenize=n),"comment"}function o(e){return e.skipToEnd(),"comment"}function a(e,t){for(var r,i=!1,o=!1;r=e.next();){if('"'==r&&!i){o=!0;break}i=!i&&"\\"==r}return o&&(t.tokenize=n),"string"}function s(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var c,u=e.indentUnit,d=t(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),p=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation());var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==c)s(t,")",e.column());else if("["==c)s(t,"]",e.column());else if("{"==c)s(t,"}",e.column());else if(/[\]\}\)]/.test(c)){for(;t.context&&"pattern"==t.context.type;)l(t);t.context&&c==t.context.type&&l(t)}else"."==c&&t.context&&"pattern"==t.context.type?l(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?s(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),r=e.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:u):0}}}),e.defineMIME("text/x-q","q")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/r/r",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r<t.length;++r)n[t[r]]=!0;return n}function n(e,t){a=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=r(n),"string";if("."==n&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(n)&&"_"!=n){e.eatWhile(/[\w\.]/);var i=e.current();return s.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(u.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1)&&(a="block"),"keyword"):l.propertyIsEnumerable(i)?"builtin":"variable"}return"%"==n?(e.skipTo("%")&&e.next(),"variable-2"):"<"==n&&e.eat("-")?"arrow":"="==n&&t.ctx.argList?"arg-is":d.test(n)?"$"==n?"dollar":(e.eatWhile(d),"operator"):/[\(\){}\[\];]/.test(n)?(a=n,";"==n?"semi":null):null}function r(e){return function(t,r){if(t.eat("\\")){var i=t.next();return"x"==i?t.match(/^[a-f0-9]{2}/i):("u"==i||"U"==i)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==i?t.match(/^[a-f0-9]{4}/i):"U"==i?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(i)&&t.match(/^[0-7]{1,2}/),"string-2"}for(var o;null!=(o=t.next());){if(o==e){r.tokenize=n;break}if("\\"==o){t.backUp(1);break}}return"string"}}function i(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function o(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var a,s=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),l=t("list quote bquote eval return call parse deparse"),c=t("if else repeat while function for in next break"),u=t("if else repeat while function for"),d=/[+\-*\/^<>=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/rpm/rpm",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("rpm-changes",function(){var e=/^-+$/,t=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,n=/^[\w+.-]+@[\w.-]+/;return{token:function(r){if(r.sol()){if(r.match(e))return"tag";if(r.match(t))return"tag"}return r.match(n)?"string":(r.next(),null)}}}),e.defineMIME("text/x-rpm-changes","rpm-changes"),e.defineMode("rpm-spec",function(){var e=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,t=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,n=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,r=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(a,s){var l=a.peek();if("#"==l)return a.skipToEnd(),"comment";if(a.sol()){if(a.match(t))return"preamble";if(a.match(n))return"section"}if(a.match(/^\$\w+/))return"def";if(a.match(/^\$\{\w+\}/))return"def";if(a.match(i))return"keyword";if(a.match(r))return s.controlFlow=!0,"keyword";if(s.controlFlow){if(a.match(o))return"operator";if(a.match(/^(\d+)/))return"number";a.eol()&&(s.controlFlow=!1)}if(a.match(e))return"number";if(a.match(/^%[\w]+/))return a.match(/^\(/)&&(s.macroParameters=!0),"macro";if(s.macroParameters){if(a.match(/^\d+/))return"number";if(a.match(/^\)/))return s.macroParameters=!1,"macro"}return a.match(/^%\{\??[\w \-]+\}/)?"macro":(a.next(),null)}}}),e.defineMIME("text/x-rpm-spec","rpm-spec")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/stex/stex",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("stex",function(){function e(e,t){e.cmdState.push(t)}function t(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function n(e){var t=e.cmdState.pop();t&&t.closeBracket()}function r(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var r=t[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}function i(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function o(e,t){e.f=t}function a(n,i){var a;if(n.match(/^\\[a-zA-Z@]+/)){var d=n.current().slice(1);return a=u[d]||u.DEFAULT,a=new a,e(i,a),o(i,c),a.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return o(i,function(e,t){return l(e,t,"\\]")}),"keyword";if(n.match("$$"))return o(i,function(e,t){return l(e,t,"$$")}),"keyword";if(n.match("$"))return o(i,function(e,t){return l(e,t,"$")}),"keyword";var p=n.next();return"%"==p?(n.eol()||o(i,s),"comment"):"}"==p||"]"==p?(a=t(i))?(a.closeBracket(p),o(i,c),"bracket"):"error":"{"==p||"["==p?(a=u.DEFAULT,a=new a,e(i,a),"bracket"):/\d/.test(p)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),a=r(i),"begin"==a.name&&(a.argument=n.current()),a.styleIdentifier())}function s(e,t){return e.skipToEnd(),o(t,a),"comment"}function l(e,t,n){if(e.eatSpace())return null;if(e.match(n))return o(t,a),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=e.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(e.eol()||e.skipToEnd(),"comment"):"error"}function c(e,r){var i,s=e.peek();return"{"==s||"["==s?(i=t(r),i.openBracket(s),e.eat(s),o(r,a),"bracket"):/[ \t\r]/.test(s)?(e.eat(s),null):(o(r,a),n(r),a(e,r))}var u={};return u.importmodule=i("importmodule","tag",["string","builtin"]),u.documentclass=i("documentclass","tag",["","atom"]),u.usepackage=i("usepackage","tag",["atom"]),u.begin=i("begin","tag",["atom"]),u.end=i("end","tag",["atom"]),u.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:a}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)}}}),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/rst/rst",["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){e.defineMode("rst",function(t,n){var r=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,i=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,o=/^``[^`\s](?:[^`]*[^`\s])``/,a=/^(?:[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,l=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,c="[Hh][Tt][Tt][Pp][Ss]?://",u="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",d="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",p=new RegExp("^"+c+u+d),f={token:function(e){if(e.match(r)&&e.match(/\W+|$/,!1))return"strong";if(e.match(i)&&e.match(/\W+|$/,!1))return"em";if(e.match(o)&&e.match(/\W+|$/,!1))return"string-2";if(e.match(a))return"number";if(e.match(s))return"positive";if(e.match(l))return"negative";if(e.match(p))return"link";for(;!(null==e.next()||e.match(r,!1)||e.match(i,!1)||e.match(o,!1)||e.match(a,!1)||e.match(s,!1)||e.match(l,!1)||e.match(p,!1)););return null}},h=e.getMode(t,n.backdrop||"rst-base");return e.overlayMode(h,f,!0)},"python","stex"),e.defineMode("rst-base",function(t){function n(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,n){return"undefined"!=typeof t[n]?t[n]:e})}function r(t,n){var o=null;if(t.sol()&&t.match(Y,!1))u(n,l,{mode:f,local:e.startState(f)});else if(t.sol()&&t.match(k))u(n,i),o="meta";else if(t.sol()&&t.match(I))u(n,r),o="header";else if(p(n)==F||t.match(F,!1))switch(d(n)){case 0:u(n,r,c(F,1)),t.match(/^:/),o="meta";break;case 1:u(n,r,c(F,2)),t.match(_),o="keyword",t.current().match(/^(?:math|latex)/)&&(n.tmp_stex=!0);break;case 2:u(n,r,c(F,3)),t.match(/^:`/),o="meta";break;case 3:if(n.tmp_stex&&(n.tmp_stex=void 0,n.tmp={mode:h,local:e.startState(h)}),n.tmp){if("`"==t.peek()){u(n,r,c(F,4)),n.tmp=void 0;break}o=n.tmp.mode.token(t,n.tmp.local);break}u(n,r,c(F,4)),t.match(C),o="string";break;case 4:u(n,r,c(F,5)),t.match(/^`/),o="meta";break;case 5:u(n,r,c(F,6)),t.match(v);break;default:u(n,r)}else if(p(n)==$||t.match($,!1))switch(d(n)){case 0:u(n,r,c($,1)),t.match(/^`/),o="meta";break;case 1:u(n,r,c($,2)),t.match(C),o="string";break;case 2:u(n,r,c($,3)),t.match(/^`:/),o="meta";break;case 3:u(n,r,c($,4)),t.match(_),o="keyword";break;case 4:u(n,r,c($,5)),t.match(/^:/),o="meta";break;case 5:u(n,r,c($,6)),t.match(v);break;default:u(n,r)}else if(p(n)==U||t.match(U,!1))switch(d(n)){case 0:u(n,r,c(U,1)),t.match(/^:/),o="meta";break;case 1:u(n,r,c(U,2)),t.match(_),o="keyword";break;case 2:u(n,r,c(U,3)),t.match(/^:/),o="meta";break;case 3:u(n,r,c(U,4)),t.match(v);break;default:u(n,r)}else if(p(n)==L||t.match(L,!1))switch(d(n)){case 0:u(n,r,c(L,1)),t.match(B),o="variable-2";break;case 1:u(n,r,c(L,2)),t.match(/^_?_?/)&&(o="link");break;default:u(n,r)}else if(t.match(R))u(n,r),o="quote";else if(t.match(A))u(n,r),o="quote";else if(t.match(N))u(n,r),(!t.peek()||t.peek().match(/^\W$/))&&(o="link");else if(p(n)==P||t.match(P,!1))switch(d(n)){case 0:!t.peek()||t.peek().match(/^\W$/)?u(n,r,c(P,1)):t.match(P);break;case 1:u(n,r,c(P,2)),t.match(/^`/),o="link";break;case 2:u(n,r,c(P,3)),t.match(C);break;case 3:u(n,r,c(P,4)),t.match(/^`_/),o="link";break;default:u(n,r)}else t.match(X)?u(n,a):t.next()&&u(n,r);return o}function i(t,n){var a=null;if(p(n)==D||t.match(D,!1))switch(d(n)){case 0:u(n,i,c(D,1)),t.match(B),a="variable-2";break;case 1:u(n,i,c(D,2)),t.match(W);break;case 2:u(n,i,c(D,3)),t.match(H),a="keyword";break;case 3:u(n,i,c(D,4)),t.match(q),a="meta";break;default:u(n,r)}else if(p(n)==T||t.match(T,!1))switch(d(n)){case 0:u(n,i,c(T,1)),t.match(j),a="keyword",t.current().match(/^(?:math|latex)/)?n.tmp_stex=!0:t.current().match(/^python/)&&(n.tmp_py=!0);break;case 1:u(n,i,c(T,2)),t.match(V),a="meta",(t.match(/^latex\s*$/)||n.tmp_stex)&&(n.tmp_stex=void 0,u(n,l,{mode:h,local:e.startState(h)}));break;case 2:u(n,i,c(T,3)),(t.match(/^python\s*$/)||n.tmp_py)&&(n.tmp_py=void 0,u(n,l,{mode:f,local:e.startState(f)}));break;default:u(n,r)}else if(p(n)==x||t.match(x,!1))switch(d(n)){case 0:u(n,i,c(x,1)),t.match(z),t.match(G),a="link";break;case 1:u(n,i,c(x,2)),t.match(K),a="meta";break;default:u(n,r)}else t.match(M)?(u(n,r),a="quote"):t.match(O)?(u(n,r),a="quote"):(t.eatSpace(),t.eol()?u(n,r):(t.skipToEnd(),u(n,o),a="comment"));return a}function o(e,t){return s(e,t,"comment")}function a(e,t){return s(e,t,"meta")}function s(e,t,n){return e.eol()||e.eatSpace()?(e.skipToEnd(),n):(u(t,r),null)}function l(e,t){return t.ctx.mode&&t.ctx.local?e.sol()?(e.eatSpace()||u(t,r),null):t.ctx.mode.token(e,t.ctx.local):(u(t,r),null)}function c(e,t,n,r){return{phase:e,stage:t,mode:n,local:r}}function u(e,t,n){e.tok=t,e.ctx=n||{}}function d(e){return e.ctx.stage||0}function p(e){return e.ctx.phase}var f=e.getMode(t,"python"),h=e.getMode(t,"stex"),m="\\s+",g="(?:\\s*|\\W|$)",v=new RegExp(n("^{0}",g)),y="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",_=new RegExp(n("^{0}",y)),b="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",E=n("(?:{0}|`{1}`)",y,b),w="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",S="(?:[^\\`]+)",C=new RegExp(n("^{0}",S)),I=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),k=new RegExp(n("^\\.\\.{0}",m)),x=new RegExp(n("^_{0}:{1}|^__:{1}",E,g)),T=new RegExp(n("^{0}::{1}",E,g)),D=new RegExp(n("^\\|{0}\\|{1}{2}::{3}",w,m,E,g)),M=new RegExp(n("^\\[(?:\\d+|#{0}?|\\*)]{1}",E,g)),O=new RegExp(n("^\\[{0}\\]{1}",E,g)),L=new RegExp(n("^\\|{0}\\|",w)),R=new RegExp(n("^\\[(?:\\d+|#{0}?|\\*)]_",E)),A=new RegExp(n("^\\[{0}\\]_",E)),N=new RegExp(n("^{0}__?",E)),P=new RegExp(n("^`{0}`_",S)),F=new RegExp(n("^:{0}:`{1}`{2}",y,S,g)),$=new RegExp(n("^`{1}`:{0}:{2}",y,S,g)),U=new RegExp(n("^:{0}:{1}",y,g)),j=new RegExp(n("^{0}",E)),V=new RegExp(n("^::{0}",g)),B=new RegExp(n("^\\|{0}\\|",w)),W=new RegExp(n("^{0}",m)),H=new RegExp(n("^{0}",E)),q=new RegExp(n("^::{0}",g)),z=new RegExp("^_"),G=new RegExp(n("^{0}|_",E)),K=new RegExp(n("^:{0}",g)),X=new RegExp("^::\\s*$"),Y=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:r,ctx:c(void 0,0)}},copyState:function(t){var n=t.ctx,r=t.tmp;return n.local&&(n={mode:n.mode,local:e.copyState(n.mode,n.local)}),r&&(r={mode:r.mode,local:e.copyState(r.mode,r.local)}),{tok:t.tok,ctx:n,tmp:r}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/rust/rust",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("rust",function(){function e(e,t){return H=e,t}function t(t,i){var o=t.next();if('"'==o)return i.tokenize=n,i.tokenize(t,i);if("'"==o)return H="atom",t.eat("\\")?t.skipTo("'")?(t.next(),"string"):"error":(t.next(),t.eat("'")?"string":"error");if("/"==o){if(t.eat("/"))return t.skipToEnd(),"comment";if(t.eat("*"))return i.tokenize=r(1),i.tokenize(t,i)}if("#"==o)return t.eat("[")?(H="open-attr",null):(t.eatWhile(/\w/),e("macro","meta"));if(":"==o&&t.match(":<"))return e("op",null);if(o.match(/\d/)||"."==o&&t.eat(/\d/)){var a=!1;return t.match(/^x[\da-f]+/i)||t.match(/^b[01]+/)||(t.eatWhile(/\d/),t.eat(".")&&(a=!0,t.eatWhile(/\d/)),t.match(/^e[+\-]?\d+/i)&&(a=!0)),t.match(a?/^f(?:32|64)/:/^[ui](?:8|16|32|64)/),e("atom","number")}return o.match(/[()\[\]{}:;,]/)?e(o,null):"-"==o&&t.eat(">")?e("->",null):o.match(Y)?(t.eatWhile(Y),e("op",null)):(t.eatWhile(/\w/),q=t.current(),t.match(/^::\w/)?(t.backUp(1),e("prefix","variable-2")):i.keywords.propertyIsEnumerable(q)?e(i.keywords[q],q.match(/true|false/)?"atom":"keyword"):e("name","variable"))}function n(n,r){for(var i,o=!1;i=n.next();){if('"'==i&&!o)return r.tokenize=t,e("atom","string");o=!o&&"\\"==i}return e("op","string")}function r(e){return function(n,i){for(var o,a=null;o=n.next();){if("/"==o&&"*"==a){if(1==e){i.tokenize=t;break}return i.tokenize=r(e-1),i.tokenize(n,i)}if("*"==o&&"/"==a)return i.tokenize=r(e+1),i.tokenize(n,i);a=o}return"comment"}}function i(){for(var e=arguments.length-1;e>=0;e--)Q.cc.push(arguments[e])}function o(){return i.apply(null,arguments),!0}function a(e,t){var n=function(){var n=Q.state;n.lexical={indented:n.indented,column:Q.stream.column(),type:e,prev:n.lexical,info:t}};return n.lex=!0,n}function s(){var e=Q.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function l(){Q.state.keywords=X}function c(){Q.state.keywords=K}function u(e,t){function n(r){return","==r?o(e,n):r==t?o():o(n)}return function(r){return r==t?o():i(e,n)}}function d(e,t){return o(a("stat",t),e,s,p)}function p(e){return"}"==e?o():"let"==e?d(b,"let"):"fn"==e?d(C):"type"==e?o(a("stat"),I,f,s,p):"enum"==e?d(k):"mod"==e?d(T):"iface"==e?d(D):"impl"==e?d(M):"open-attr"==e?o(a("]"),u(h,"]"),s):"ignore"==e||e.match(/[\]\);,]/)?o(p):i(a("stat"),h,s,f,p)}function f(e){return";"==e?o():i()}function h(e){return"atom"==e||"name"==e?o(m):"{"==e?o(a("}"),v,s):e.match(/[\[\(]/)?B(e,h):e.match(/[\]\)\};,]/)?i():"if-style"==e?o(h,h):"else-style"==e||"op"==e?o(h):"for"==e?o(P,w,S,h,h):"alt"==e?o(h,$):"fn"==e?o(C):"macro"==e?o(V):o()}function m(e){return"."==q?o(g):"::<"==q?o(O,m):"op"==e||":"==q?o(h):"("==e||"["==e?B(e,h):i()}function g(){return q.match(/^\w+$/)?(Q.marked="variable",o(m)):i(h)}function v(e){if("op"==e){if("|"==q)return o(_,s,a("}","block"),p);if("||"==q)return o(s,a("}","block"),p)}return i("mutable"==q||q.match(/^\w+$/)&&":"==Q.stream.peek()&&!Q.stream.match("::",!1)?y(h):p)}function y(e){function t(n){return"mutable"==q||"with"==q?(Q.marked="keyword",o(t)):q.match(/^\w*$/)?(Q.marked="variable",o(t)):":"==n?o(e,t):"}"==n?o():o(t)}return t}function _(e){return"name"==e?(Q.marked="def",o(_)):"op"==e&&"|"==q?o():o(_)}function b(e){return e.match(/[\]\)\};]/)?o():"="==q?o(h,E):","==e?o(b):i(P,w,b)}function E(e){return e.match(/[\]\)\};,]/)?i(b):i(h,E)}function w(e){return":"==e?o(l,R,c):i()}function S(e){return"name"==e&&"in"==q?(Q.marked="keyword",o()):i()}function C(e){return"@"==q||"~"==q?(Q.marked="keyword",o(C)):"name"==e?(Q.marked="def",o(C)):"<"==q?o(O,C):"{"==e?i(h):"("==e?o(a(")"),u(L,")"),s,C):"->"==e?o(l,R,c,C):";"==e?o():o(C)
46}function I(e){return"name"==e?(Q.marked="def",o(I)):"<"==q?o(O,I):"="==q?o(l,R,c):o(I)}function k(e){return"name"==e?(Q.marked="def",o(k)):"<"==q?o(O,k):"="==q?o(l,R,c,f):"{"==e?o(a("}"),l,x,c,s):o(k)}function x(e){return"}"==e?o():"("==e?o(a(")"),u(R,")"),s,x):(q.match(/^\w+$/)&&(Q.marked="def"),o(x))}function T(e){return"name"==e?(Q.marked="def",o(T)):"{"==e?o(a("}"),p,s):i()}function D(e){return"name"==e?(Q.marked="def",o(D)):"<"==q?o(O,D):"{"==e?o(a("}"),p,s):i()}function M(e){return"<"==q?o(O,M):"of"==q||"for"==q?(Q.marked="keyword",o(R,M)):"name"==e?(Q.marked="def",o(M)):"{"==e?o(a("}"),p,s):i()}function O(){return">"==q?o():","==q?o(O):":"==q?o(R,O):i(R,O)}function L(e){return"name"==e?(Q.marked="def",o(L)):":"==e?o(l,R,c):i()}function R(e){return"name"==e?(Q.marked="variable-3",o(A)):"mutable"==q?(Q.marked="keyword",o(R)):"atom"==e?o(A):"op"==e||"obj"==e?o(R):"fn"==e?o(N):"{"==e?o(a("{"),y(R),s):B(e,R)}function A(){return"<"==q?o(O):i()}function N(e){return"("==e?o(a("("),u(R,")"),s,N):"->"==e?o(R):i()}function P(e){return"name"==e?(Q.marked="def",o(F)):"atom"==e?o(F):"op"==e?o(P):e.match(/[\]\)\};,]/)?i():B(e,P)}function F(e){return"op"==e&&"."==q?o():"to"==q?(Q.marked="keyword",o(P)):i()}function $(e){return"{"==e?o(a("}","alt"),U,s):i()}function U(e){return"}"==e?o():"|"==e?o(U):"when"==q?(Q.marked="keyword",o(h,j)):e.match(/[\]\);,]/)?o(U):i(P,j)}function j(e){return"{"==e?o(a("}","alt"),p,s,U):i(U)}function V(e){return e.match(/[\[\(\{]/)?B(e,h):i()}function B(e,t){return"["==e?o(a("]"),u(t,"]"),s):"("==e?o(a(")"),u(t,")"),s):"{"==e?o(a("}"),u(t,"}"),s):o()}function W(e,t,n){var r=e.cc;for(Q.state=e,Q.stream=t,Q.marked=null,Q.cc=r;;){var i=r.length?r.pop():p;if(i(H)){for(;r.length&&r[r.length-1].lex;)r.pop()();return Q.marked||n}}}var H,q,z=4,G=2,K={"if":"if-style","while":"if-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom"},X=function(){for(var e={fn:"fn",block:"fn",obj:"obj"},t="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),n=0,r=t.length;r>n;++n)e[t[n]]="atom";return e}(),Y=/[+\-*&%=<>!?|\.@]/,Q={state:null,stream:null,marked:null,cc:null};return s.lex=l.lex=c.lex=!0,{startState:function(){return{tokenize:t,cc:[],lexical:{indented:-z,column:0,type:"top",align:!1},keywords:K,indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;H=q=null;var n=t.tokenize(e,t);return"comment"==n?n:(t.lexical.hasOwnProperty("align")||(t.lexical.align=!0),"prefix"==H?n:(q||(q=e.current()),W(t,e,n)))},indent:function(e,n){if(e.tokenize!=t)return 0;var r=n&&n.charAt(0),i=e.lexical,o=i.type,a=r==o;return"stat"==o?i.indented+z:i.align?i.column+(a?0:1):i.indented+(a?0:"alt"==i.info?G:z)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),e.defineMIME("text/x-rustsrc","rust")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/sass/sass",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=l,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=l,l(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=l):n.next(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),s=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&s===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=l,"string"):"#"===a&&"{"===s?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):l(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function s(e){1!=e.scopes.length&&e.scopes.shift()}function l(e,t){var s=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(l),"operator";if("."===s)return e.next(),e.match(/^[\w-]+/)?(a(t),"atom"):"#"===e.peek()?(a(t),"atom"):"operator";if("#"===s){if(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))return"number";if(e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}return e.match(/^-?[0-9\.]+/)?"number":e.match(/^(px|em|in)\b/)?"unit":e.match(d)?"keyword":e.match(/^url/)&&"("===e.peek()?(t.tokenizer=n,"atom"):"$"===s?(e.next(),e.eatWhile(/[\w-]/),":"===e.peek()?(e.next(),"variable-2"):"variable-3"):"!"===s?(e.next(),e.match(/^[\w]+/)?"keyword":"operator"):"="===s?(e.next(),e.match(/^[\w-]+/)?(a(t),"meta"):"operator"):"+"===s?(e.next(),e.match(/^[\w-]+/)?"variable-3":"operator"):e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)?(a(t),"meta"):"@"===s?(e.next(),e.eatWhile(/[\w-]/),"meta"):'"'===s||"'"===s?(e.next(),t.tokenizer=i(s),"string"):":"==s&&e.match(h)?"keyword":e.eatWhile(/[\w-&]/)?":"!==e.peek()||e.match(h,!1)?"atom":"property":e.match(f)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if("@return"===i&&s(n),"atom"===r&&a(n),null!==r){for(var o=t.pos-i.length,l=o+e.indentUnit*n.indentCount,c=[],u=0;u<n.scopes.length;u++){var d=n.scopes[u];d.offset<=l&&c.push(d)}n.scopes=c}return r}var u=["true","false","null","auto"],d=new RegExp("^"+u.join("|")),p=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not"],f=t(p),h=/^::?[\w\-]+/;return{startState:function(){return{tokenizer:l,scopes:[{offset:0,type:"sass"}],indentCount:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/scheme/scheme",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("scheme",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t,n){this.indent=e,this.type=t,this.prev=n}function n(e,n,r){e.indentStack=new t(n,r,e.indentStack)}function r(e){e.indentStack=e.indentStack.prev}function i(e){return e.match(v)}function o(e){return e.match(y)}function a(e,t){return t===!0&&e.backUp(1),e.match(b)}function s(e){return e.match(_)}var l="builtin",c="comment",u="string",d="atom",p="number",f="bracket",h=2,m=e("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),g=e("define let letrec let* lambda"),v=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),y=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),_=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),b=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var v=null;switch(t.mode){case"string":for(var y,_=!1;null!=(y=e.next());){if('"'==y&&!_){t.mode=!1;break}_=!_&&"\\"==y}v=u;break;case"comment":for(var y,b=!1;null!=(y=e.next());){if("#"==y&&b){t.mode=!1;break}b="|"==y}v=c;break;case"s-expr-comment":if(t.mode=!1,"("!=e.peek()&&"["!=e.peek()){e.eatWhile(/[^/s]/),v=c;break}t.sExprComment=0;default:var E=e.next();if('"'==E)t.mode="string",v=u;else if("'"==E)v=d;else if("#"==E)if(e.eat("|"))t.mode="comment",v=c;else if(e.eat(/[tf]/i))v=d;else if(e.eat(";"))t.mode="s-expr-comment",v=c;else{var w=null,S=!1,C=!0;e.eat(/[ei]/i)?S=!0:e.backUp(1),e.match(/^#b/i)?w=i:e.match(/^#o/i)?w=o:e.match(/^#x/i)?w=s:e.match(/^#d/i)?w=a:e.match(/^[-+0-9.]/,!1)?(C=!1,w=a):S||e.eat("#"),null!=w&&(C&&!S&&e.match(/^#[ei]/i),w(e)&&(v=p))}else if(/^[-+0-9.]/.test(E)&&a(e,!0))v=p;else if(";"==E)e.skipToEnd(),v=c;else if("("==E||"["==E){for(var I,k="",x=e.column();null!=(I=e.eat(/[^\s\(\[\;\)\]]/));)k+=I;k.length>0&&g.propertyIsEnumerable(k)?n(t,x+h,E):(e.eatSpace(),e.eol()||";"==e.peek()?n(t,x+1,E):n(t,x+e.current().length,E)),e.backUp(e.current().length-1),"number"==typeof t.sExprComment&&t.sExprComment++,v=f}else")"==E||"]"==E?(v=f,null!=t.indentStack&&t.indentStack.type==(")"==E?"(":"[")&&(r(t),"number"==typeof t.sExprComment&&0==--t.sExprComment&&(v=c,t.sExprComment=!1))):(e.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),v=m&&m.propertyIsEnumerable(e.current())?l:"variable")}return"number"==typeof t.sExprComment?c:v},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-scheme","scheme")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/shell/shell",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),s=e.next();if("\\"===s)return e.next(),null;if("'"===s||'"'===s||"`"===s)return t.tokens.unshift(n(s)),r(e,t);if("#"===s)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===s)return t.tokens.unshift(o),r(e,t);if("+"===s||"="===s)return"operator";if("-"===s)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(s)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var l=e.current();return"="===e.peek()&&/\w+/.test(l)?"def":i.hasOwnProperty(l)?i[l]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return(i||!a)&&n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/sieve/sieve",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sieve",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){var n=e.next();if("/"==n&&e.eat("*"))return t.tokenize=i,i(e,t);if("#"===n)return e.skipToEnd(),"comment";if('"'==n)return t.tokenize=o(n),t.tokenize(e,t);if("("==n)return t._indent.push("("),t._indent.push("{"),null;if("{"===n)return t._indent.push("{"),null;if(")"==n&&(t._indent.pop(),t._indent.pop()),"}"===n)return t._indent.pop(),null;if(","==n)return null;if(";"==n)return null;if(/[{}\(\),;]/.test(n))return null;if(/\d/.test(n))return e.eatWhile(/[\d]/),e.eat(/[KkMmGg]/),"number";if(":"==n)return e.eatWhile(/[a-zA-Z_]/),e.eatWhile(/[a-zA-Z0-9_]/),"operator";e.eatWhile(/\w/);var l=e.current();return"text"==l&&e.eat(":")?(t.tokenize=r,"string"):a.propertyIsEnumerable(l)?"keyword":s.propertyIsEnumerable(l)?"atom":null}function r(e,t){return t._multiLineString=!0,e.sol()?("."==e.next()&&e.eol()&&(t._multiLineString=!1,t.tokenize=n),"string"):(e.eatSpace(),"#"==e.peek()?(e.skipToEnd(),"comment"):(e.skipToEnd(),"string"))}function i(e,t){for(var r,i=!1;null!=(r=e.next());){if(i&&"/"==r){t.tokenize=n;break}i="*"==r}return"comment"}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next())&&(i!=e||o);)o=!o&&"\\"==i;return o||(r.tokenize=n),"string"}}var a=t("if elsif else stop require"),s=t("true false not"),l=e.indentUnit;return{startState:function(e){return{tokenize:n,baseIndent:e||0,_indent:[]}},token:function(e,t){return e.eatSpace()?null:(t.tokenize||n)(e,t)},indent:function(e,t){var n=e._indent.length;return t&&"}"==t[0]&&n--,0>n&&(n=0),n*l},electricChars:"}"}}),e.defineMIME("application/sieve","sieve")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/slim/slim",["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],e):e(CodeMirror)}(function(e){e.defineMode("slim",function(t){function n(e,t,n){var r=function(r,i){return i.tokenize=t,r.pos<e?(r.pos=e,n):i.tokenize(r,i)};return function(e,n){return n.tokenize=r,t(e,n)}}function r(e,t,r,i,o){var a=e.current(),s=a.search(r);return s>-1&&(t.tokenize=n(e.pos,t.tokenize,o),e.backUp(a.length-s-i)),o}function i(e,t){e.stack={parent:e.stack,style:"continuation",indented:t,tokenize:e.line},e.line=e.tokenize}function o(e){e.line==e.tokenize&&(e.line=e.stack.tokenize,e.stack=e.stack.parent)}function a(e,t){return function(n,r){if(o(r),n.match(/^\\$/))return i(r,e),"lineContinuation";var a=t(n,r);return n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&n.backUp(1),a}}function s(e,t){return function(n,r){o(r);var a=t(n,r);return n.eol()&&n.current().match(/,$/)&&i(r,e),a}}function l(e,t){return function(n,r){var i=n.peek();return i==e&&1==r.rubyState.tokenize.length?(n.next(),r.tokenize=t,"closeAttributeTag"):u(n,r)}}function c(e){var t,n=function(n,r){if(1==r.rubyState.tokenize.length&&!r.rubyState.context.prev){if(n.backUp(1),n.eatSpace())return r.rubyState=t,r.tokenize=e,e(n,r);n.next()}return u(n,r)};return function(e,r){return t=r.rubyState,r.rubyState=U.startState(),r.tokenize=n,u(e,r)}}function u(e,t){return U.token(e,t.rubyState)}function d(e,t){return e.match(/^\\$/)?"lineContinuation":p(e,t)}function p(e,t){return e.match(/^#\{/)?(t.tokenize=l("}",t.tokenize),null):r(e,t,/[^\\]#\{/,1,$.token(e,t.htmlState))}function f(e){return function(t,n){var r=d(t,n);return t.eol()&&(n.tokenize=e),r}}function h(e,t,n){return t.stack={parent:t.stack,style:"html",indented:e.column()+n,tokenize:t.line},t.line=t.tokenize=p,null}function m(e,t){return e.skipToEnd(),t.stack.style}function g(e,t){return t.stack={parent:t.stack,style:"comment",indented:t.indented+1,tokenize:t.line},t.line=m,m(e,t)}function v(e,t){return e.eat(t.stack.endQuote)?(t.line=t.stack.line,t.tokenize=t.stack.tokenize,t.stack=t.stack.parent,null):e.match(X)?(t.tokenize=y,"slimAttribute"):(e.next(),null)}function y(e,t){return e.match(/^==?/)?(t.tokenize=_,null):v(e,t)}function _(e,t){var n=e.peek();return'"'==n||"'"==n?(t.tokenize=P(n,"string",!0,!1,v),e.next(),t.tokenize(e,t)):"["==n?c(v)(e,t):e.match(/^(true|false|nil)\b/)?(t.tokenize=v,"keyword"):c(v)(e,t)}function b(e,t,n){return e.stack={parent:e.stack,style:"wrapper",indented:e.indented+1,tokenize:n,line:e.line,endQuote:t},e.line=e.tokenize=v,null}function E(t,n){if(t.match(/^#\{/))return n.tokenize=l("}",n.tokenize),null;var r=new e.StringStream(t.string.slice(n.stack.indented),t.tabSize);r.pos=t.pos-n.stack.indented,r.start=t.start-n.stack.indented,r.lastColumnPos=t.lastColumnPos-n.stack.indented,r.lastColumnValue=t.lastColumnValue-n.stack.indented;var i=n.subMode.token(r,n.subState);return t.pos=r.pos+n.stack.indented,i}function w(e,t){return t.stack.indented=e.column(),t.line=t.tokenize=E,t.tokenize(e,t)}function S(n){var r=V[n],i=e.mimeModes[r];if(i)return e.getMode(t,i);var o=e.modes[r];return o?o(t,{name:r}):e.getMode(t,"null")}function C(e){return j.hasOwnProperty(e)?j[e]:j[e]=S(e)}function I(e,t){var n=C(e),r=n.startState&&n.startState();return t.subMode=n,t.subState=r,t.stack={parent:t.stack,style:"sub",indented:t.indented+1,tokenize:t.line},t.line=t.tokenize=w,"slimSubmode"}function k(e){return e.skipToEnd(),"slimDoctype"}function x(e,t){var n=e.peek();if("<"==n)return(t.tokenize=f(t.tokenize))(e,t);if(e.match(/^[|']/))return h(e,t,1);if(e.match(/^\/(!|\[\w+])?/))return g(e,t);if(e.match(/^(-|==?[<>]?)/))return t.tokenize=a(e.column(),s(e.column(),u)),"slimSwitch";if(e.match(/^doctype\b/))return t.tokenize=k,"keyword";var r=e.match(B);return r?I(r[1],t):D(e,t)}function T(e,t){return t.startOfLine?x(e,t):D(e,t)}function D(e,t){return e.eat("*")?(t.tokenize=c(M),null):e.match(G)?(t.tokenize=M,"slimTag"):O(e,t)}function M(e,t){return e.match(/^(<>?|><?)/)?(t.tokenize=O,null):O(e,t)}function O(e,t){return e.match(Q)?(t.tokenize=O,"slimId"):e.match(Y)?(t.tokenize=O,"slimClass"):L(e,t)}function L(e,t){return e.match(/^([\[\{\(])/)?b(t,H[RegExp.$1],L):e.match(K)?(t.tokenize=R,"slimAttribute"):"*"==e.peek()?(e.next(),t.tokenize=c(F),null):F(e,t)}function R(e,t){return e.match(/^==?/)?(t.tokenize=A,null):L(e,t)}function A(e,t){var n=e.peek();return'"'==n||"'"==n?(t.tokenize=P(n,"string",!0,!1,L),e.next(),t.tokenize(e,t)):"["==n?c(L)(e,t):":"==n?c(N)(e,t):e.match(/^(true|false|nil)\b/)?(t.tokenize=L,"keyword"):c(L)(e,t)}function N(e,t){return e.backUp(1),e.match(/^[^\s],(?=:)/)?(t.tokenize=c(N),null):(e.next(),L(e,t))}function P(e,t,n,r,a){return function(s,c){o(c);var u=0==s.current().length;if(s.match(/^\\$/,u))return u?(i(c,c.indented),"lineContinuation"):t;if(s.match(/^#\{/,u))return u?(c.tokenize=l("}",c.tokenize),null):t;for(var d,p=!1;null!=(d=s.next());){if(d==e&&(r||!p)){c.tokenize=a;break}if(n&&"#"==d&&!p&&s.eat("{")){s.backUp(2);break}p=!p&&"\\"==d}return s.eol()&&p&&s.backUp(1),t}}function F(e,t){return e.match(/^==?/)?(t.tokenize=u,"slimSwitch"):e.match(/^\/$/)?(t.tokenize=T,null):e.match(/^:/)?(t.tokenize=D,"slimSwitch"):(h(e,t,0),t.tokenize(e,t))}var $=e.getMode(t,{name:"htmlmixed"}),U=e.getMode(t,"ruby"),j={html:$,ruby:U},V={ruby:"ruby",javascript:"javascript",css:"text/css",sass:"text/x-sass",scss:"text/x-scss",less:"text/x-less",styl:"text/x-styl",coffee:"coffeescript",asciidoc:"text/x-asciidoc",markdown:"text/x-markdown",textile:"text/x-textile",creole:"text/x-creole",wiki:"text/x-wiki",mediawiki:"text/x-mediawiki",rdoc:"text/x-rdoc",builder:"text/x-builder",nokogiri:"text/x-nokogiri",erb:"application/x-erb"},B=function(e){var t=[];for(var n in e)t.push(n);return new RegExp("^("+t.join("|")+"):")}(V),W={commentLine:"comment",slimSwitch:"operator special",slimTag:"tag",slimId:"attribute def",slimClass:"attribute qualifier",slimAttribute:"attribute",slimSubmode:"keyword special",closeAttributeTag:null,slimDoctype:null,lineContinuation:null},H={"{":"}","[":"]","(":")"},q="_a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",z=q+"\\-0-9·̀-ͯ‿-⁀",G=new RegExp("^[:"+q+"](?::["+z+"]|["+z+"]*)"),K=new RegExp("^[:"+q+"][:\\."+z+"]*(?=\\s*=)"),X=new RegExp("^[:"+q+"][:\\."+z+"]*"),Y=/^\.-?[_a-zA-Z]+[\w\-]*/,Q=/^#[_a-zA-Z]+[\w\-]*/,J={startState:function(){var e=$.startState(),t=U.startState();return{htmlState:e,rubyState:t,stack:null,last:null,tokenize:T,line:T,indented:0}},copyState:function(t){return{htmlState:e.copyState($,t.htmlState),rubyState:e.copyState(U,t.rubyState),subMode:t.subMode,subState:t.subMode&&e.copyState(t.subMode,t.subState),stack:t.stack,last:t.last,tokenize:t.tokenize,line:t.line}},token:function(e,t){if(e.sol())for(t.indented=e.indentation(),t.startOfLine=!0,t.tokenize=t.line;t.stack&&t.stack.indented>t.indented&&"slimSubmode"!=t.last;)t.line=t.tokenize=t.stack.tokenize,t.stack=t.stack.parent,t.subMode=null,t.subState=null;if(e.eatSpace())return null;var n=t.tokenize(e,t);return t.startOfLine=!1,n&&(t.last=n),W.hasOwnProperty(n)?W[n]:n},blankLine:function(e){return e.subMode&&e.subMode.blankLine?e.subMode.blankLine(e.subState):void 0},innerMode:function(e){return e.subMode?{state:e.subState,mode:e.subMode}:{state:e,mode:J}}};return J},"htmlmixed","ruby"),e.defineMIME("text/x-slim","slim"),e.defineMIME("application/x-slim","slim")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/smalltalk/smalltalk",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("smalltalk",function(e){var t=/[+\-\/\\*~<>=@%|&?!.,:;^]/,n=/true|false|nil|self|super|thisContext/,r=function(e,t){this.next=e,this.parent=t},i=function(e,t,n){this.name=e,this.context=t,this.eos=n},o=function(){this.context=new r(a,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};o.prototype.userIndent=function(t){this.userIndentationDelta=t>0?t/e.indentUnit-this.indentation:0};var a=function(e,o,a){var d=new i(null,o,!1),p=e.next();return'"'===p?d=s(e,new r(s,o)):"'"===p?d=l(e,new r(l,o)):"#"===p?"'"===e.peek()?(e.next(),d=c(e,new r(c,o))):d.name=e.eatWhile(/[^\s.{}\[\]()]/)?"string-2":"meta":"$"===p?("<"===e.next()&&(e.eatWhile(/[^\s>]/),e.next()),d.name="string-2"):"|"===p&&a.expectVariable?d.context=new r(u,o):/[\[\]{}()]/.test(p)?(d.name="bracket",d.eos=/[\[{(]/.test(p),"["===p?a.indentation++:"]"===p&&(a.indentation=Math.max(0,a.indentation-1))):t.test(p)?(e.eatWhile(t),d.name="operator",d.eos=";"!==p):/\d/.test(p)?(e.eatWhile(/[\w\d]/),d.name="number"):/[\w_]/.test(p)?(e.eatWhile(/[\w\d_]/),d.name=a.expectVariable?n.test(e.current())?"keyword":"variable":null):d.eos=a.expectVariable,d},s=function(e,t){return e.eatWhile(/[^"]/),new i("comment",e.eat('"')?t.parent:t,!0)},l=function(e,t){return e.eatWhile(/[^']/),new i("string",e.eat("'")?t.parent:t,!1)},c=function(e,t){return e.eatWhile(/[^']/),new i("string-2",e.eat("'")?t.parent:t,!1)},u=function(e,t){var n=new i(null,t,!1),r=e.next();return"|"===r?(n.context=t.parent,n.eos=!0):(e.eatWhile(/[^|]/),n.name="variable"),n};return{startState:function(){return new o},token:function(e,t){if(t.userIndent(e.indentation()),e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var r=t.context.next===a&&n&&"]"===n.charAt(0)?-1:t.userIndentationDelta;return(t.indentation+r)*e.indentUnit},electricChars:"]"}}),e.defineMIME("text/x-stsrc",{name:"smalltalk"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/smarty/smarty",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("smarty",function(e){var t={rightDelimiter:"}",leftDelimiter:"{",smartyVersion:2};e.hasOwnProperty("leftDelimiter")&&(t.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(t.rightDelimiter=e.rightDelimiter),e.hasOwnProperty("smartyVersion")&&3===e.smartyVersion&&(t.smartyVersion=3);var n,r=["debug","extends","function","include","literal"],i={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},o={cont:function(e,t){return n=t,e},chain:function(e,t,n){return t.tokenize=n,n(e,t)}},a={tokenizer:function(e,r){if(e.match(t.leftDelimiter,!0)){if(e.eat("*"))return o.chain(e,r,a.inBlock("comment","*"+t.rightDelimiter));r.depth++;var i=e.eol(),s=/\s/.test(e.peek());return 3===t.smartyVersion&&"{"===t.leftDelimiter&&(i||s)?(r.depth--,null):(r.tokenize=a.smarty,n="startTag","tag")}return e.next(),null},smarty:function(e,s){if(e.match(t.rightDelimiter,!0))return 3===t.smartyVersion?(s.depth--,s.depth<=0&&(s.tokenize=a.tokenizer)):s.tokenize=a.tokenizer,o.cont("tag",null);if(e.match(t.leftDelimiter,!0))return s.depth++,o.cont("tag","startTag");var l=e.next();if("$"==l)return e.eatWhile(i.validIdentifier),o.cont("variable-2","variable");if("|"==l)return o.cont("operator","pipe");if("."==l)return o.cont("operator","property");if(i.stringChar.test(l))return s.tokenize=a.inAttribute(l),o.cont("string","string");if(i.operatorChars.test(l))return e.eatWhile(i.operatorChars),o.cont("operator","operator");if("["==l||"]"==l)return o.cont("bracket","bracket");if("("==l||")"==l)return o.cont("bracket","operator");if(/\d/.test(l))return e.eatWhile(/\d/),o.cont("number","number");if("variable"==s.last){if("@"==l)return e.eatWhile(i.validIdentifier),o.cont("property","property");if("|"==l)return e.eatWhile(i.validIdentifier),o.cont("qualifier","modifier")}else{if("pipe"==s.last)return e.eatWhile(i.validIdentifier),o.cont("qualifier","modifier");if("whitespace"==s.last)return e.eatWhile(i.validIdentifier),o.cont("attribute","modifier")}if("property"==s.last)return e.eatWhile(i.validIdentifier),o.cont("property",null);if(/\s/.test(l))return n="whitespace",null;var c="";"/"!=l&&(c+=l);for(var u=null;u=e.eat(i.validIdentifier);)c+=u;for(var d=0,p=r.length;p>d;d++)if(r[d]==c)return o.cont("keyword","keyword");return/\s/.test(l)?null:o.cont("tag","tag")},inAttribute:function(e){return function(t,n){for(var r=null,i=null;!t.eol();){if(i=t.peek(),t.next()==e&&"\\"!==r){n.tokenize=a.smarty;break}r=i}return"string"}},inBlock:function(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=a.tokenizer;break}n.next()}return e}}};return{startState:function(){return{tokenize:a.tokenizer,mode:"smarty",last:null,depth:0}},token:function(e,t){var r=t.tokenize(e,t);return t.last=n,r},electricChars:""}}),e.defineMIME("text/x-smarty","smarty")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/smartymixed/smartymixed",["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],e):e(CodeMirror)}(function(e){e.defineMode("smartymixed",function(t){function n(e){return e.replace(/[^\s\w]/g,"\\$&")}var r=e.getMode(t,"htmlmixed"),i=e.getMode(t,"smarty"),o={rightDelimiter:"}",leftDelimiter:"{"};t.hasOwnProperty("leftDelimiter")&&(o.leftDelimiter=t.leftDelimiter),t.hasOwnProperty("rightDelimiter")&&(o.rightDelimiter=t.rightDelimiter);var a=n(o.leftDelimiter),s=n(o.rightDelimiter),l={smartyComment:new RegExp("^"+s+"\\*"),literalOpen:new RegExp(a+"literal"+s),literalClose:new RegExp(a+"/literal"+s),hasLeftDelimeter:new RegExp(".*"+a),htmlHasLeftDelimeter:new RegExp("[^<>]*"+a)},c={chain:function(e,t,n){return t.tokenize=n,n(e,t)},cleanChain:function(e,t,n){return t.tokenize=null,t.localState=null,t.localMode=null,"string"==typeof n?n?n:null:n(e,t)},maybeBackup:function(e,t,n){var r,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(r=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i[0])),n}},u={html:function(e,t){return!t.inLiteral&&e.match(l.htmlHasLeftDelimeter,!1)&&null===t.htmlMixedState.htmlState.tagName?(t.tokenize=u.smarty,t.localMode=i,t.localState=i.startState(r.indent(t.htmlMixedState,"")),c.maybeBackup(e,o.leftDelimiter,i.token(e,t.localState))):!t.inLiteral&&e.match(o.leftDelimiter,!1)?(t.tokenize=u.smarty,t.localMode=i,t.localState=i.startState(r.indent(t.htmlMixedState,"")),c.maybeBackup(e,o.leftDelimiter,i.token(e,t.localState))):r.token(e,t.htmlMixedState)},smarty:function(e,t){if(e.match(o.leftDelimiter,!1)){if(e.match(l.smartyComment,!1))return c.chain(e,t,u.inBlock("comment","*"+o.rightDelimiter))}else if(e.match(o.rightDelimiter,!1))return e.eat(o.rightDelimiter),t.tokenize=u.html,t.localMode=r,t.localState=t.htmlMixedState,"tag";return c.maybeBackup(e,o.rightDelimiter,i.token(e,t.localState))},inBlock:function(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){c.cleanChain(n,r,"");break}n.next()}return e}}};return{startState:function(){var e=r.startState();return{token:u.html,localMode:null,localState:null,htmlMixedState:e,tokenize:null,inLiteral:!1}},copyState:function(t){var n=null,o=t.tokenize||t.token;return t.localState&&(n=e.copyState(o!=u.html?i:r,t.localState)),{token:t.token,tokenize:t.tokenize,localMode:t.localMode,localState:n,htmlMixedState:e.copyState(r,t.htmlMixedState),inLiteral:t.inLiteral}},token:function(e,t){if(e.match(o.leftDelimiter,!1)){if(!t.inLiteral&&e.match(l.literalOpen,!0))return t.inLiteral=!0,"keyword";
47if(t.inLiteral&&e.match(l.literalClose,!0))return t.inLiteral=!1,"keyword"}t.inLiteral&&t.localState!=t.htmlMixedState&&(t.tokenize=u.html,t.localMode=r,t.localState=t.htmlMixedState);var n=(t.tokenize||t.token)(e,t);return n},indent:function(t,n){return t.localMode==i||t.inLiteral&&!t.localMode||l.hasLeftDelimeter.test(n)?e.Pass:r.indent(t.htmlMixedState,n)},innerMode:function(e){return{state:e.localState||e.htmlMixedState,mode:e.localMode||r}}}},"htmlmixed","smarty"),e.defineMIME("text/x-smarty","smartymixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/solr/solr",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("solr",function(){function e(e){return parseFloat(e,10).toString()===e}function t(e){return function(t,n){for(var r,o=!1;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=i),"string"}}function n(e){return function(t,n){var r="operator";return"+"==e?r+=" positive":"-"==e?r+=" negative":"|"==e?t.eat(/\|/):"&"==e?t.eat(/\&/):"^"==e&&(r+=" boost"),n.tokenize=i,r}}function r(t){return function(n,r){for(var a=t;(t=n.peek())&&null!=t.match(o);)a+=n.next();return r.tokenize=i,s.test(a)?"operator":e(a)?"number":":"==n.peek()?"field":"string"}}function i(e,s){var l=e.next();return'"'==l?s.tokenize=t(l):a.test(l)?s.tokenize=n(l):o.test(l)&&(s.tokenize=r(l)),s.tokenize!=i?s.tokenize(e,s):null}var o=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,a=/[\|\!\+\-\*\?\~\^\&]/,s=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:i}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-solr","solr")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/sparql/sparql",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sparql",function(e){function t(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function n(e,t){var n=e.next();if(a=null,"$"==n||"?"==n)return e.match(/^[\w\d]*/),"variable-2";if("<"!=n||e.match(/^[\s\u00a0=]/,!1)){if('"'==n||"'"==n)return t.tokenize=r(n),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(n))return a=n,null;if("#"==n)return e.skipToEnd(),"comment";if(u.test(n))return e.eatWhile(u),null;if(":"==n)return e.eatWhile(/[\w\d\._\-]/),"atom";if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var i=e.current();return l.test(i)?null:c.test(i)?"keyword":"variable"}return e.match(/^[^\s\u00a0>]*>?/),"atom"}function r(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function o(e){e.indent=e.context.indent,e.context=e.context.prev}var a,s=e.indentUnit,l=t(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","a"]),c=t(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","data","copy","to","move","add","create","drop","clear","load"]),u=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==a)i(t,")",e.column());else if("["==a)i(t,"]",e.column());else if("{"==a)i(t,"}",e.column());else if(/[\]\}\)]/.test(a)){for(;t.context&&"pattern"==t.context.type;)o(t);t.context&&a==t.context.type&&o(t)}else"."==a&&t.context&&"pattern"==t.context.type?o(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?i(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),r=e.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:s):0}}}),e.defineMIME("application/x-sparql-query","sparql")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/sql/sql",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sql",function(e,t){function n(e,t){var n=e.next();if(f[n]){var o=f[n](e,t);if(o!==!1)return o}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=r(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=i,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return h.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":l.hasOwnProperty(a)?"atom":c.hasOwnProperty(a)?"builtin":u.hasOwnProperty(a)?"keyword":s.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function r(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=n;break}}return"comment"}function o(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function a(e){e.indent=e.context.indent,e.context=e.context.prev}var s=t.client||{},l=t.atoms||{"false":!0,"true":!0,"null":!0},c=t.builtin||{},u=t.keywords||{},d=t.operatorChars||/^[*+\-%<>!=&|~^]/,p=t.support||{},f=t.hooks||{},h=t.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:n,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?o(e,t,")"):"["==r?o(e,t,"]"):t.context&&t.context.type==r&&a(t),n},indent:function(t,n){var r=t.context;if(!r)return 0;var i=n.charAt(0)==r.type;return r.align?r.col+(i?0:1):r.indent+(i?0:e.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:i("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:i("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/tcl/tcl",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("tcl",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(e,n){var c=n.beforeParams;n.beforeParams=!1;var u=e.next();if('"'!=u&&"'"!=u||!n.inParams){if(/[\[\]{}\(\),;\.]/.test(u))return"("==u&&c?n.inParams=!0:")"==u&&(n.inParams=!1),null;if(/\d/.test(u))return e.eatWhile(/[\w\.]/),"number";if("#"==u&&e.eat("*"))return t(e,n,i);if("#"==u&&e.match(/ *\[ *\[/))return t(e,n,o);if("#"==u&&e.eat("#"))return e.skipToEnd(),"comment";if('"'==u)return e.skipTo(/"/),"comment";if("$"==u)return e.eatWhile(/[$_a-z0-9A-Z\.{:]/),e.eatWhile(/}/),n.beforeParams=!0,"builtin";if(l.test(u))return e.eatWhile(l),"comment";e.eatWhile(/[\w\$_{}]/);var d=e.current().toLowerCase();return a&&a.propertyIsEnumerable(d)?"keyword":s&&s.propertyIsEnumerable(d)?(n.beforeParams=!0,"keyword"):null}return t(e,n,r(u))}function r(e){return function(t,r){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return a&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("#"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function o(e,t){for(var r,i=0;r=e.next();){if("#"==r&&2==i){t.tokenize=n;break}"]"==r?i++:" "!=r&&(i=0)}return"meta"}var a=e("Tcl safe after append array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd close concat continue dde eof encoding error eval exec exit expr fblocked fconfigure fcopy file fileevent filename filename flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lset lsort memory msgcat namespace open package parray pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp registry regsub rename resource return scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest tclvars tell time trace unknown unset update uplevel upvar variable vwait"),s=e("if elseif else and not or eq ne in ni for foreach while switch"),l=/[+\-*&%=<>!?^\/\|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-tcl","tcl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/textile/textile",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){this.regExpFactory=e,this.state=t,this.stream=n,this.styles=r,this.state.specialChar=null}function n(){this.cache={},this.single={bc:"bc",bq:"bq",definitionList:/- [^(?::=)]+:=+/,definitionListEnd:/.*=:\s*$/,div:"div",drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},this.attributes={align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/}}var r={addition:"positive",attributes:"attribute",bold:"strong",cite:"keyword",code:"atom",definitionList:"number",deletion:"negative",div:"punctuation",em:"em",footnote:"variable",footCite:"qualifier",header:"header",html:"comment",image:"string",italic:"em",link:"link",linkDefinition:"link",list1:"variable-2",list2:"variable-3",list3:"keyword",notextile:"string-2",pre:"operator",p:"property",quote:"bracket",span:"quote",specialChar:"tag",strong:"strong",sub:"builtin",sup:"builtin",table:"variable-3",tableHeading:"operator"};t.prototype.eat=function(e){return this.stream.match(this.regExpFactory.pattern(e),!0)},t.prototype.check=function(e){return this.stream.match(this.regExpFactory.pattern(e),!1)},t.prototype.setModeForNextToken=function(e){return this.state.mode=e},t.prototype.execMode=function(e){return this.setModeForNextToken(e).call(this)},t.prototype.startNewLine=function(){this.setModeForNextToken(i.newLayout),this.state.tableHeading=!1,"definitionList"===this.state.layoutType&&this.state.spanningLayout&&this.check("definitionListEnd")&&(this.state.spanningLayout=!1)},t.prototype.nextToken=function(){return this.state.mode.call(this)},t.prototype.styleFor=function(e){if(this.styles.hasOwnProperty(e))return this.styles[e];throw"unknown token"},t.prototype.handlePhraseModifier=function(e){if("_"===e)return this.stream.eat("_")?this.togglePhraseModifier("italic",/^.*__/):this.togglePhraseModifier("em",/^.*_/);if("*"===e)return this.stream.eat("*")?this.togglePhraseModifier("bold",/^.*\*\*/):this.togglePhraseModifier("strong",/^.*\*/);if("["===e)return this.stream.match(/\d+\]/)&&(this.state.footCite=!0),this.tokenStyles();if("("===e)return this.stream.match("r)")?this.state.specialChar="r":this.stream.match("tm)")?this.state.specialChar="tm":this.stream.match("c)")&&(this.state.specialChar="c"),this.tokenStyles();if("<"===e&&this.stream.match(/(\w+)[^>]+>[^<]+<\/\1>/))return this.tokenStylesWith(this.styleFor("html"));if("?"===e&&this.stream.eat("?"))return this.togglePhraseModifier("cite",/^.*\?\?/);if("="===e&&this.stream.eat("="))return this.togglePhraseModifier("notextile",/^.*==/);if("-"===e)return this.togglePhraseModifier("deletion",/^.*-/);if("+"===e)return this.togglePhraseModifier("addition",/^.*\+/);if("~"===e)return this.togglePhraseModifier("sub",/^.*~/);if("^"===e)return this.togglePhraseModifier("sup",/^.*\^/);if("%"===e)return this.togglePhraseModifier("span",/^.*%/);if("@"===e)return this.togglePhraseModifier("code",/^.*@/);if("!"===e){var t=this.togglePhraseModifier("image",/^.*(?:\([^\)]+\))?!/);return this.stream.match(/^:\S+/),t}return this.tokenStyles()},t.prototype.togglePhraseModifier=function(e,t){if(this.state[e]){var n=this.tokenStyles();return this.state[e]=!1,n}return this.stream.match(t,!1)&&(this.state[e]=!0,this.setModeForNextToken(i.attributes)),this.tokenStyles()},t.prototype.tokenStyles=function(){var e=this.textileDisabled(),t=[];return e?e:(this.state.layoutType&&t.push(this.styleFor(this.state.layoutType)),t=t.concat(this.activeStyles("addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","specialChar","strong","sub","sup","table","tableHeading")),"header"===this.state.layoutType&&t.push(this.styleFor("header")+"-"+this.state.header),t.length?t.join(" "):null)},t.prototype.textileDisabled=function(){var e=this.state.layoutType;switch(e){case"notextile":case"code":case"pre":return this.styleFor(e);default:return this.state.notextile?this.styleFor("notextile")+(e?" "+this.styleFor(e):""):null}},t.prototype.tokenStylesWith=function(e){var t,n=this.textileDisabled();return n?n:(t=this.tokenStyles(),e?t?t+" "+e:e:t)},t.prototype.activeStyles=function(){var e,t=[];for(e=0;e<arguments.length;++e)this.state[arguments[e]]&&t.push(this.styleFor(arguments[e]));return t},t.prototype.blankLine=function(){var e,t=this.state.spanningLayout,n=this.state.layoutType;for(e in this.state)this.state.hasOwnProperty(e)&&delete this.state[e];this.setModeForNextToken(i.newLayout),t&&(this.state.layoutType=n,this.state.spanningLayout=!0)},n.prototype.pattern=function(e){return this.cache[e]||this.createRe(e)},n.prototype.createRe=function(e){switch(e){case"drawTable":return this.makeRe("^",this.single.drawTable,"$");case"html":return this.makeRe("^",this.single.html,"(?:",this.single.html,")*","$");case"linkDefinition":return this.makeRe("^",this.single.linkDefinition,"$");case"listLayout":return this.makeRe("^",this.single.list,this.pattern("allAttributes"),"*\\s+");case"tableCellAttributes":return this.makeRe("^",this.choiceRe(this.single.tableCellAttributes,this.pattern("allAttributes")),"+\\.");case"type":return this.makeRe("^",this.pattern("allTypes"));case"typeLayout":return this.makeRe("^",this.pattern("allTypes"),this.pattern("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return this.makeRe("^",this.pattern("allAttributes"),"+");case"allTypes":return this.choiceRe(this.single.div,this.single.foot,this.single.header,this.single.bc,this.single.bq,this.single.notextile,this.single.pre,this.single.table,this.single.para);case"allAttributes":return this.choiceRe(this.attributes.selector,this.attributes.css,this.attributes.lang,this.attributes.align,this.attributes.pad);default:return this.makeRe("^",this.single[e])
48}},n.prototype.makeRe=function(){var e,t,n="";for(e=0;e<arguments.length;++e)t=arguments[e],n+="string"==typeof t?t:t.source;return new RegExp(n)},n.prototype.choiceRe=function(){var e,t=[arguments[0]];for(e=1;e<arguments.length;++e)t[2*e-1]="|",t[2*e]=arguments[e];return t.unshift("(?:"),t.push(")"),this.makeRe.apply(this,t)};var i={newLayout:function(){if(this.check("typeLayout"))return this.state.spanningLayout=!1,this.execMode(i.blockType);if(!this.textileDisabled()){if(this.check("listLayout"))return this.execMode(i.list);if(this.check("drawTable"))return this.execMode(i.table);if(this.check("linkDefinition"))return this.execMode(i.linkDefinition);if(this.check("definitionList"))return this.execMode(i.definitionList);if(this.check("html"))return this.execMode(i.html)}return this.execMode(i.text)},blockType:function(){var e,t;return this.state.layoutType=null,(e=this.eat("type"))?(t=e[0],(e=t.match(this.regExpFactory.pattern("header")))?(this.state.layoutType="header",this.state.header=parseInt(e[0][1])):t.match(this.regExpFactory.pattern("bq"))?this.state.layoutType="quote":t.match(this.regExpFactory.pattern("bc"))?this.state.layoutType="code":t.match(this.regExpFactory.pattern("foot"))?this.state.layoutType="footnote":t.match(this.regExpFactory.pattern("notextile"))?this.state.layoutType="notextile":t.match(this.regExpFactory.pattern("pre"))?this.state.layoutType="pre":t.match(this.regExpFactory.pattern("div"))?this.state.layoutType="div":t.match(this.regExpFactory.pattern("table"))&&(this.state.layoutType="table"),this.setModeForNextToken(i.attributes),this.tokenStyles()):this.execMode(i.text)},text:function(){if(this.eat("text"))return this.tokenStyles();var e=this.stream.next();return'"'===e?this.execMode(i.link):this.handlePhraseModifier(e)},attributes:function(){return this.setModeForNextToken(i.layoutLength),this.eat("attributes")?this.tokenStylesWith(this.styleFor("attributes")):this.tokenStyles()},layoutLength:function(){return this.stream.eat(".")&&this.stream.eat(".")&&(this.state.spanningLayout=!0),this.setModeForNextToken(i.text),this.tokenStyles()},list:function(){var e,t=this.eat("list");return this.state.listDepth=t[0].length,e=(this.state.listDepth-1)%3,this.state.layoutType=e?1===e?"list2":"list3":"list1",this.setModeForNextToken(i.attributes),this.tokenStyles()},link:function(){return this.setModeForNextToken(i.text),this.eat("link")?(this.stream.match(/\S+/),this.tokenStylesWith(this.styleFor("link"))):this.tokenStyles()},linkDefinition:function(){return this.stream.skipToEnd(),this.tokenStylesWith(this.styleFor("linkDefinition"))},definitionList:function(){return this.eat("definitionList"),this.state.layoutType="definitionList",this.stream.match(/\s*$/)?this.state.spanningLayout=!0:this.setModeForNextToken(i.attributes),this.tokenStyles()},html:function(){return this.stream.skipToEnd(),this.tokenStylesWith(this.styleFor("html"))},table:function(){return this.state.layoutType="table",this.execMode(i.tableCell)},tableCell:function(){return this.eat("tableHeading")?this.state.tableHeading=!0:this.stream.eat("|"),this.setModeForNextToken(i.tableCellAttributes),this.tokenStyles()},tableCellAttributes:function(){return this.setModeForNextToken(i.tableText),this.eat("tableCellAttributes")?this.tokenStylesWith(this.styleFor("attributes")):this.tokenStyles()},tableText:function(){return this.eat("tableText")?this.tokenStyles():"|"===this.stream.peek()?(this.setModeForNextToken(i.tableCell),this.tokenStyles()):this.handlePhraseModifier(this.stream.next())}};e.defineMode("textile",function(){var e=new n;return{startState:function(){return{mode:i.newLayout}},token:function(n,r){var i=new t(e,r,n);return n.sol()&&i.startNewLine(),i.nextToken()},blankLine:function(n){new t(e,n).blankLine()}}}),e.defineMIME("text/x-textile","textile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/tiddlywiki/tiddlywiki",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("tiddlywiki",function(){function e(e,t,n){return t.tokenize=n,n(e,t)}function t(e,t,n){return u=e,d=n,t}function n(n,u){var d,f=n.sol();if(u.block=!1,d=n.peek(),f&&/[<\/\*{}\-]/.test(d)){if(n.match(S))return u.block=!0,e(n,u,o);if(n.match(y))return t("quote","quote");if(n.match(g)||n.match(v))return t("code","comment");if(n.match(_)||n.match(b)||n.match(E)||n.match(w))return t("code","comment");if(n.match(m))return t("hr","hr")}if(d=n.next(),f&&/[\/\*!#;:>|]/.test(d)){if("!"==d)return n.skipToEnd(),t("header","header");if("*"==d)return n.eatWhile("*"),t("list","comment");if("#"==d)return n.eatWhile("#"),t("list","comment");if(";"==d)return n.eatWhile(";"),t("list","comment");if(":"==d)return n.eatWhile(":"),t("list","comment");if(">"==d)return n.eatWhile(">"),t("quote","quote");if("|"==d)return t("table","header")}if("{"==d&&n.match(/\{\{/))return e(n,u,o);if(/[hf]/i.test(d)&&/[ti]/i.test(n.peek())&&n.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return t("link","link");if('"'==d)return t("string","string");if("~"==d)return t("text","brace");if(/[\[\]]/.test(d)&&n.peek()==d)return n.next(),t("brace","brace");if("@"==d)return n.eatWhile(h),t("link","link");if(/\d/.test(d))return n.eatWhile(/\d/),t("number","number");if("/"==d){if(n.eat("%"))return e(n,u,r);if(n.eat("/"))return e(n,u,a)}if("_"==d&&n.eat("_"))return e(n,u,s);if("-"==d&&n.eat("-")){if(" "!=n.peek())return e(n,u,l);if(" "==n.peek())return t("text","brace")}if("'"==d&&n.eat("'"))return e(n,u,i);if("<"!=d)return t(d);if(n.eat("<"))return e(n,u,c);n.eatWhile(/[\w\$_]/);var C=n.current(),I=p.propertyIsEnumerable(C)&&p[C];return I?t(I.type,I.style,C):t("text",null,C)}function r(e,r){for(var i,o=!1;i=e.next();){if("/"==i&&o){r.tokenize=n;break}o="%"==i}return t("comment","comment")}function i(e,r){for(var i,o=!1;i=e.next();){if("'"==i&&o){r.tokenize=n;break}o="'"==i}return t("text","strong")}function o(e,r){var i,o=r.block;return o&&e.current()?t("code","comment"):!o&&e.match(I)?(r.tokenize=n,t("code","comment")):o&&e.sol()&&e.match(C)?(r.tokenize=n,t("code","comment")):(i=e.next(),o?t("code","comment"):t("code","comment"))}function a(e,r){for(var i,o=!1;i=e.next();){if("/"==i&&o){r.tokenize=n;break}o="/"==i}return t("text","em")}function s(e,r){for(var i,o=!1;i=e.next();){if("_"==i&&o){r.tokenize=n;break}o="_"==i}return t("text","underlined")}function l(e,r){for(var i,o=!1;i=e.next();){if("-"==i&&o){r.tokenize=n;break}o="-"==i}return t("text","strikethrough")}function c(e,r){var i,o,a;return"<<"==e.current()?t("brace","macro"):(i=e.next())?">"==i&&">"==e.peek()?(e.next(),r.tokenize=n,t("brace","macro")):(e.eatWhile(/[\w\$_]/),o=e.current(),a=f.propertyIsEnumerable(o)&&f[o],a?t(a.type,a.style,o):t("macro",null,o)):(r.tokenize=n,t(i))}var u,d,p={},f=function(){function e(e){return{type:e,style:"macro"}}return{allTags:e("allTags"),closeAll:e("closeAll"),list:e("list"),newJournal:e("newJournal"),newTiddler:e("newTiddler"),permaview:e("permaview"),saveChanges:e("saveChanges"),search:e("search"),slider:e("slider"),tabs:e("tabs"),tag:e("tag"),tagging:e("tagging"),tags:e("tags"),tiddler:e("tiddler"),timeline:e("timeline"),today:e("today"),version:e("version"),option:e("option"),"with":e("with"),filter:e("filter")}}(),h=/[\w_\-]/i,m=/^\-\-\-\-+$/,g=/^\/\*\*\*$/,v=/^\*\*\*\/$/,y=/^<<<$/,_=/^\/\/\{\{\{$/,b=/^\/\/\}\}\}$/,E=/^<!--\{\{\{-->$/,w=/^<!--\}\}\}-->$/,S=/^\{\{\{$/,C=/^\}\}\}$/,I=/.*?\}\}\}/;return{startState:function(){return{tokenize:n,indented:0,level:0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},electricChars:""}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/tiki/tiki",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("tiki",function(e){function t(e,t,n){return function(i,o){for(;!i.eol();){if(i.match(t)){o.tokenize=r;break}i.next()}return n&&(o.tokenize=n),e}}function n(e){return function(t,n){for(;!t.eol();)t.next();return n.tokenize=r,e}}function r(e,o){function a(t){return o.tokenize=t,t(e,o)}var s=e.sol(),l=e.next();switch(l){case"{":e.eat("/"),e.eatSpace();for(var c,u="";c=e.eat(/[^\s\u00a0=\"\'\/?(}]/);)u+=c;return o.tokenize=i,"tag";case"_":if(e.eat("_"))return a(t("strong","__",r));break;case"'":if(e.eat("'"))return a(t("em","''",r));break;case"(":if(e.eat("("))return a(t("variable-2","))",r));break;case"[":return a(t("variable-3","]",r));case"|":if(e.eat("|"))return a(t("comment","||"));break;case"-":if(e.eat("="))return a(t("header string","=-",r));if(e.eat("-"))return a(t("error tw-deleted","--",r));break;case"=":if(e.match("=="))return a(t("tw-underline","===",r));break;case":":if(e.eat(":"))return a(t("comment","::"));break;case"^":return a(t("tw-box","^"));case"~":if(e.match("np~"))return a(t("meta","~/np~"))}if(s)switch(l){case"!":return a(e.match("!!!!!")?n("header string"):e.match("!!!!")?n("header string"):e.match("!!!")?n("header string"):e.match("!!")?n("header string"):n("header string"));case"*":case"#":case"+":return a(n("tw-listitem bracket"))}return null}function i(e,t){var n=e.next(),i=e.peek();return"}"==n?(t.tokenize=r,"tag"):"("==n||")"==n?"bracket":"="==n?(y="equals",">"==i&&(n=e.next(),i=e.peek()),/[\'\"]/.test(i)||(t.tokenize=a()),"operator"):/[\'\"]/.test(n)?(t.tokenize=o(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function o(e){return function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"}}function a(){return function(e,t){for(;!e.eol();){var n=e.next(),r=e.peek();if(" "==n||","==n||/[ )}]/.test(r)){t.tokenize=i;break}}return"string"}}function s(){for(var e=arguments.length-1;e>=0;e--)_.cc.push(arguments[e])}function l(){return s.apply(null,arguments),!0}function c(e,t){var n=_.context&&_.context.noIndent;_.context={prev:_.context,pluginName:e,indent:_.indented,startOfLine:t,noIndent:n}}function u(){_.context&&(_.context=_.context.prev)}function d(e){if("openPlugin"==e)return _.pluginName=v,l(h,p(_.startOfLine));if("closePlugin"==e){var t=!1;return _.context?(t=_.context.pluginName!=v,u()):t=!0,t&&(b="error"),l(f(t))}return"string"==e?(_.context&&"!cdata"==_.context.name||c("!cdata"),_.tokenize==r&&u(),l()):l()}function p(e){return function(t){return"selfclosePlugin"==t||"endPlugin"==t?l():"endPlugin"==t?(c(_.pluginName,e),l()):l()}}function f(e){return function(t){return e&&(b="error"),"endPlugin"==t?l():s()}}function h(e){return"keyword"==e?(b="attribute",l(h)):"equals"==e?l(m,h):s()}function m(e){return"keyword"==e?(b="string",l()):"string"==e?l(g):s()}function g(e){return"string"==e?l(g):s()}var v,y,_,b,E=e.indentUnit;return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;b=y=v=null;var n=t.tokenize(e,t);if((n||y)&&"comment"!=n)for(_=t;;){var r=t.cc.pop()||d;if(r(y||n))break}return t.startOfLine=!1,b||n},indent:function(e,t){var n=e.context;if(n&&n.noIndent)return 0;for(n&&/^{\//.test(t)&&(n=n.prev);n&&!n.startOfLine;)n=n.prev;return n?n.indent+E:0},electricChars:"/"}}),e.defineMIME("text/tiki","tiki")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/toml/toml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,t){if(t.inString||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0),e.sol()&&0===t.inArray&&(t.lhs=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}return t.inArray&&"]"===e.peek()?(e.next(),t.inArray--,"bracket"):t.lhs&&"["===e.peek()&&e.skipTo("]")?(e.next(),"]"===e.peek()&&e.next(),"atom"):"#"===e.peek()?(e.skipToEnd(),"comment"):e.eatSpace()?null:t.lhs&&e.eatWhile(function(e){return"="!=e&&" "!=e})?"property":t.lhs&&"="===e.peek()?(e.next(),t.lhs=!1,null):!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":t.lhs||!e.match("true")&&!e.match("false")?t.lhs||"["!==e.peek()?!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)?"number":(e.eatSpace()||e.next(),null):(t.inArray++,e.next(),"bracket"):"atom"}}}),e.defineMIME("text/x-toml","toml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/turtle/turtle",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("turtle",function(e){function t(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function n(e,t){var n=e.next();if(a=null,"<"==n&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==n||"'"==n)return t.tokenize=r(n),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(n))return a=n,null;if("#"==n)return e.skipToEnd(),"comment";if(c.test(n))return e.eatWhile(c),null;if(":"==n)return"operator";if(e.eatWhile(/[_\w\d]/),":"==e.peek())return"variable-3";var i=e.current();return l.test(i)?"meta":n>="A"&&"Z">=n?"comment":"keyword";var i}function r(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function o(e){e.indent=e.context.indent,e.context=e.context.prev}var a,s=e.indentUnit,l=(t([]),t(["@prefix","@base","a"])),c=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==a)i(t,")",e.column());else if("["==a)i(t,"]",e.column());else if("{"==a)i(t,"}",e.column());else if(/[\]\}\)]/.test(a)){for(;t.context&&"pattern"==t.context.type;)o(t);t.context&&a==t.context.type&&o(t)}else"."==a&&t.context&&"pattern"==t.context.type?o(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?i(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),r=e.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:s):0}}}),e.defineMIME("text/turtle","turtle")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/vb/vb",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("vb",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,t){t.currentIndent++}function i(e,t){t.currentIndent--}function o(e,t){if(e.eatSpace())return null;var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+F?/i)?o=!0:e.match(/^\d+\.\d*F?/)?o=!0:e.match(/^\.\d+F?/)&&(o=!0),o)return e.eat(/J/i),"number";var s=!1;if(e.match(/^&H[0-9a-f]+/i)?s=!0:e.match(/^&O[0-7]+/i)?s=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),s=!0):e.match(/^0(?![\dx])/i)&&(s=!0),s)return e.eat(/L/i),"number"}return e.match(S)?(t.tokenize=a(e.current()),t.tokenize(e,t)):e.match(f)||e.match(p)?null:e.match(d)||e.match(c)||e.match(y)?"operator":e.match(u)?null:e.match(T)?(r(e,t),t.doInCurrentLine=!0,"keyword"):e.match(C)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(I)?"keyword":e.match(x)?(i(e,t),i(e,t),"keyword"):e.match(k)?(i(e,t),"keyword"):e.match(w)?"keyword":e.match(E)?"keyword":e.match(h)?"variable":(e.next(),l)}function a(e){var n=1==e.length,r="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,r;i.eat(/['"]/)}if(n){if(t.singleLineStringErrors)return l;a.tokenize=o}return r}}function s(e,t){var n=t.tokenize(e,t),o=e.current();if("."===o)return n=t.tokenize(e,t),o=e.current(),"variable"===n?"variable":l;var a="[({".indexOf(o);return-1!==a&&r(e,t),"dedent"===D&&i(e,t)?l:(a="])}".indexOf(o),-1!==a&&i(e,t)?l:n)}var l="error",c=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),u=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),d=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),p=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),f=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),h=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),m=["class","module","sub","enum","select","while","if","function","get","set","property","try"],g=["else","elseif","case","catch"],v=["next","loop"],y=n(["and","or","not","xor","in"]),_=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],b=["integer","string","double","decimal","boolean","short","char","float","single"],E=n(_),w=n(b),S='"',C=n(m),I=n(g),k=n(v),x=n(["end"]),T=n(["do"]),D=null,M={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=s(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(k)||r.match(x)||r.match(I)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return M}),e.defineMIME("text/x-vb","vb")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/vbscript/vbscript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("vbscript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,t){t.currentIndent++}function i(e,t){t.currentIndent--}function o(e,t){if(e.eatSpace())return"space";var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(V))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+/i)?o=!0:e.match(/^\d+\.\d*/)?o=!0:e.match(/^\.\d+/)&&(o=!0),o)return e.eat(/J/i),"number";var s=!1;if(e.match(/^&H[0-9a-f]+/i)?s=!0:e.match(/^&O[0-7]+/i)?s=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),s=!0):e.match(/^0(?![\dx])/i)&&(s=!0),s)return e.eat(/L/i),"number"}return e.match(A)?(t.tokenize=a(e.current()),t.tokenize(e,t)):e.match(u)||e.match(c)||e.match(v)?"operator":e.match(d)?null:e.match(p)?"bracket":e.match(j)?(t.doInCurrentLine=!0,"keyword"):e.match(U)?(r(e,t),t.doInCurrentLine=!0,"keyword"):e.match(N)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(P)?"keyword":e.match($)?(i(e,t),i(e,t),"keyword"):e.match(F)?(t.doInCurrentLine?t.doInCurrentLine=!1:i(e,t),"keyword"):e.match(D)?"keyword":e.match(M)?"atom":e.match(R)?"variable-2":e.match(O)?"builtin":e.match(L)?"variable-2":e.match(f)?"variable":(e.next(),l)}function a(e){var n=1==e.length,r="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,r;i.eat(/['"]/)}if(n){if(t.singleLineStringErrors)return l;a.tokenize=o}return r}}function s(e,t){var n=t.tokenize(e,t),r=e.current();return"."===r?(n=t.tokenize(e,t),r=e.current(),!n||"variable"!==n.substr(0,8)&&"builtin"!==n&&"keyword"!==n?l:(("builtin"===n||"keyword"===n)&&(n="variable"),T.indexOf(r.substr(1))>-1&&(n="variable-2"),n)):n}var l="error",c=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),u=new RegExp("^((<>)|(<=)|(>=))"),d=new RegExp("^[\\.,]"),p=new RegExp("^[\\(\\)]"),f=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),h=["class","sub","select","while","if","function","property","with","for"],m=["else","elseif","case"],g=["next","loop","wend"],v=n(["and","or","not","xor","is","mod","eqv","imp"]),y=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],_=["true","false","nothing","empty","null"],b=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],E=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],S=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],I=["server","response","request","session","application"],k=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],x=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],T=C.concat(S);w=w.concat(E),e.isASP&&(w=w.concat(I),T=T.concat(x,k));var D=n(y),M=n(_),O=n(b),L=n(w),R=n(T),A='"',N=n(h),P=n(m),F=n(g),$=n(["end"]),U=n(["do"]),j=n(["on error resume next","exit"]),V=n(["rem"]),B={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=s(e,t);return t.lastToken={style:n,content:e.current()},"space"===n&&(n=null),n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(F)||r.match($)||r.match(P)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return B}),e.defineMIME("text/vbscript","vbscript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/velocity/velocity",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("velocity",function(){function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(e,n){var u=n.beforeParams;n.beforeParams=!1;var d=e.next();if("'"==d&&n.inParams)return n.lastTokenWasBuiltin=!1,t(e,n,r(d));if('"'!=d){if(/[\[\]{}\(\),;\.]/.test(d))return"("==d&&u?n.inParams=!0:")"==d&&(n.inParams=!1,n.lastTokenWasBuiltin=!0),null;if(/\d/.test(d))return n.lastTokenWasBuiltin=!1,e.eatWhile(/[\w\.]/),"number";if("#"==d&&e.eat("*"))return n.lastTokenWasBuiltin=!1,t(e,n,i);if("#"==d&&e.match(/ *\[ *\[/))return n.lastTokenWasBuiltin=!1,t(e,n,o);if("#"==d&&e.eat("#"))return n.lastTokenWasBuiltin=!1,e.skipToEnd(),"comment";if("$"==d)return e.eatWhile(/[\w\d\$_\.{}]/),l&&l.propertyIsEnumerable(e.current())?"keyword":(n.lastTokenWasBuiltin=!0,n.beforeParams=!0,"builtin");if(c.test(d))return n.lastTokenWasBuiltin=!1,e.eatWhile(c),"operator";e.eatWhile(/[\w\$_{}@]/);var p=e.current();return a&&a.propertyIsEnumerable(p)?"keyword":s&&s.propertyIsEnumerable(p)||e.current().match(/^#@?[a-z0-9_]+ *$/i)&&"("==e.peek()&&(!s||!s.propertyIsEnumerable(p.toLowerCase()))?(n.beforeParams=!0,n.lastTokenWasBuiltin=!1,"keyword"):n.inString?(n.lastTokenWasBuiltin=!1,"string"):e.pos>p.length&&"."==e.string.charAt(e.pos-p.length-1)&&n.lastTokenWasBuiltin?"builtin":(n.lastTokenWasBuiltin=!1,null)}return n.lastTokenWasBuiltin=!1,n.inString?(n.inString=!1,"string"):n.inParams?t(e,n,r(d)):void 0}function r(e){return function(t,r){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}if('"'==e&&"$"==t.peek()&&!o){r.inString=!0,a=!0;break}o=!o&&"\\"==i}return a&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("#"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function o(e,t){for(var r,i=0;r=e.next();){if("#"==r&&2==i){t.tokenize=n;break}"]"==r?i++:" "!=r&&(i=0)}return"meta"}var a=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),c=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.defineMIME("text/velocity","velocity")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/verilog/verilog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("verilog",function(t,n){function r(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function i(e,t){var n=e.peek();if(/[,;:\.]/.test(n))return p=e.next(),null;if(E.test(n))return p=e.next(),"bracket";if("`"==n)return e.next(),e.eatWhile(/[\w\$_]/)?"def":null;if("$"==n)return e.next(),e.eatWhile(/[\w\$_]/)?"meta":null;if("#"==n)return e.next(),e.eatWhile(/[\d_.]/),"def";if('"'==n)return e.next(),t.tokenize=o(n),t.tokenize(e,t);if("/"==n){if(e.next(),e.eat("*"))return t.tokenize=a,a(e,t);if(e.eat("/"))return e.skipToEnd(),"comment";e.backUp(1)}if(e.match(x)||e.match(S)||e.match(C)||e.match(I)||e.match(k)||e.match(w)||e.match(x))return"number";if(e.eatWhile(b))return"meta";if(e.eatWhile(/[\w\$_]/)){var r=e.current();return _[r]?(O[r]&&(p="newblock"),A[r]&&(p="newstatement"),f=r,"keyword"):"variable"}return e.next(),null}function o(e){return function(t,n){for(var r,o=!1,a=!1;null!=(r=t.next());){if(r==e&&!o){a=!0;break}o=!o&&"\\"==r}return(a||!o&&!y)&&(n.tokenize=i),"string"}}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=i;break}r="*"==n}return"comment"}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e,t,n){var r=e.indented,i=new s(r,t,n,null,e.context);return e.context=i}function c(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}function u(e,t){if(e==t)return!0;var n=t.split(";");for(var r in n)if(e==n[r])return!0;return!1}function d(){var e=[];for(var t in O)if(O[t]){var n=O[t].split(";");for(var r in n)e.push(n[r])}var i=new RegExp("[{}()\\[\\]]|("+e.join("|")+")$");return i}var p,f,h=t.indentUnit,m=n.statementIndentUnit||h,g=n.dontAlignCalls,v=n.noIndentKeywords||[],y=n.multiLineStrings,_=r("accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"),b=/[\+\-\*\/!~&|^%=?:]/,E=/[\[\]{}()]/,w=/\d[0-9_]*/,S=/\d*\s*'s?d\s*\d[0-9_]*/i,C=/\d*\s*'s?b\s*[xz01][xz01_]*/i,I=/\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i,k=/\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i,x=/(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i,T=/^((\w+)|[)}\]])/,D=/[)}\]]/,M=r("case checker class clocking config function generate group interface module packageprimitive program property specify sequence table task"),O={};for(var L in M)O[L]="end"+L;O.begin="end",O.casex="endcase",O.casez="endcase",O["do"]="while",O.fork="join;join_any;join_none",O["import"]="function;task",O["export"]="function;task";for(var R in v){var L=v[R];O[L]&&(O[L]=void 0)}var A=r("always always_comb always_ff always_latch assert assign assume else for foreach forever if initial repeat while");return{electricInput:d(),startState:function(e){return{tokenize:null,context:new s((e||0)-h,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;
49p=null,f=null;var r=(t.tokenize||i)(e,t);if("comment"==r||"meta"==r||"variable"==r)return r;if(null==n.align&&(n.align=!0),p==n.type)c(t);else if(";"==p&&"statement"==n.type||n.type&&u(f,n.type))for(n=c(t);n&&"statement"==n.type;)n=c(t);else if("{"==p)l(t,e.column(),"}");else if("["==p)l(t,e.column(),"]");else if("("==p)l(t,e.column(),")");else if(n&&"endcase"==n.type&&":"==p)l(t,e.column(),"statement");else if("newstatement"==p)l(t,e.column(),"statement");else if("newblock"==p){var o=O[f];l(t,e.column(),o)}return t.startOfLine=!1,r},indent:function(t,n){if(t.tokenize!=i&&null!=t.tokenize)return e.Pass;var r=t.context,o=n&&n.charAt(0);"statement"==r.type&&"}"==o&&(r=r.prev);var a=!1,s=n.match(T);return s&&(a=u(s[0],r.type)),"statement"==r.type?r.indented+("{"==o?0:m):D.test(r.type)&&r.align&&!g?r.column+(a?0:1):")"!=r.type||a?r.indented+(a?0:h):r.indented+m},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-verilog",{name:"verilog"}),e.defineMIME("text/x-systemverilog",{name:"systemverilog"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/xquery/xquery",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("xquery",function(){function e(e,t,n){return _=e,b=n,t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(n,s){var p=n.next(),h=!1,g=m(n);if("<"==p){if(n.match("!--",!0))return t(n,s,l);if(n.match("![CDATA",!1))return s.tokenize=c,e("tag","tag");if(n.match("?",!1))return t(n,s,u);var _=n.eat("/");n.eatSpace();for(var b,w="";b=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)w+=b;return t(n,s,a(w,_))}if("{"==p)return v(s,{type:"codeblock"}),e("",null);if("}"==p)return y(s),e("",null);if(d(s))return">"==p?e("tag","tag"):"/"==p&&n.eat(">")?(y(s),e("tag","tag")):e("word","variable");if(/\d/.test(p))return n.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===p&&n.eat(":"))return v(s,{type:"comment"}),t(n,s,r);if(g||'"'!==p&&"'"!==p){if("$"===p)return t(n,s,o);if(":"===p&&n.eat("="))return e("operator","keyword");if("("===p)return v(s,{type:"paren"}),e("",null);if(")"===p)return y(s),e("",null);if("["===p)return v(s,{type:"bracket"}),e("",null);if("]"===p)return y(s),e("",null);var S=E.propertyIsEnumerable(p)&&E[p];if(g&&'"'===p)for(;'"'!==n.next(););if(g&&"'"===p)for(;"'"!==n.next(););S||n.eatWhile(/[\w\$_-]/);var C=n.eat(":");!n.eat(":")&&C&&n.eatWhile(/[\w\$_-]/),n.match(/^[ \t]*\(/,!1)&&(h=!0);var I=n.current();return S=E.propertyIsEnumerable(I)&&E[I],h&&!S&&(S={type:"function_call",style:"variable def"}),f(s)?(y(s),e("word","variable",I)):(("element"==I||"attribute"==I||"axis_specifier"==S.type)&&v(s,{type:"xmlconstructor"}),S?e(S.type,S.style,I):e("word","variable",I))}return t(n,s,i(p))}function r(t,n){for(var r,i=!1,o=!1,a=0;r=t.next();){if(")"==r&&i){if(!(a>0)){y(n);break}a--}else":"==r&&o&&a++;i=":"==r,o="("==r}return e("comment","comment")}function i(t,r){return function(o,a){var s;if(h(a)&&o.current()==t)return y(a),r&&(a.tokenize=r),e("string","string");if(v(a,{type:"string",name:t,tokenize:i(t,r)}),o.match("{",!1)&&p(a))return a.tokenize=n,e("string","string");for(;s=o.next();){if(s==t){y(a),r&&(a.tokenize=r);break}if(o.match("{",!1)&&p(a))return a.tokenize=n,e("string","string")}return e("string","string")}}function o(t,r){var i=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(i),t.match(":=",!1)||t.eat(":");return t.eatWhile(i),r.tokenize=n,e("variable","variable")}function a(t,r){return function(i,o){return i.eatSpace(),r&&i.eat(">")?(y(o),o.tokenize=n,e("tag","tag")):(i.eat("/")||v(o,{type:"tag",name:t,tokenize:n}),i.eat(">")?(o.tokenize=n,e("tag","tag")):(o.tokenize=s,e("tag","tag")))}}function s(r,o){var a=r.next();return"/"==a&&r.eat(">")?(p(o)&&y(o),d(o)&&y(o),e("tag","tag")):">"==a?(p(o)&&y(o),e("tag","tag")):"="==a?e("",null):'"'==a||"'"==a?t(r,o,i(a,s)):(p(o)||v(o,{type:"attribute",tokenize:s}),r.eat(/[a-zA-Z_:]/),r.eatWhile(/[-a-zA-Z0-9_:.]/),r.eatSpace(),(r.match(">",!1)||r.match("/",!1))&&(y(o),o.tokenize=n),e("attribute","attribute"))}function l(t,r){for(var i;i=t.next();)if("-"==i&&t.match("->",!0))return r.tokenize=n,e("comment","comment")}function c(t,r){for(var i;i=t.next();)if("]"==i&&t.match("]",!0))return r.tokenize=n,e("comment","comment")}function u(t,r){for(var i;i=t.next();)if("?"==i&&t.match(">",!0))return r.tokenize=n,e("comment","comment meta")}function d(e){return g(e,"tag")}function p(e){return g(e,"attribute")}function f(e){return g(e,"xmlconstructor")}function h(e){return g(e,"string")}function m(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()?e.match(/^[^\"]+\'\:/,!1):!1}function g(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function v(e,t){e.stack.push(t)}function y(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||n}var _,b,E=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={type:"punctuation",style:null},s={type:"axis_specifier",style:"qualifier"},l={"if":t,"switch":t,"while":t,"for":t,"else":n,then:n,"try":n,"finally":n,"catch":n,element:r,attribute:r,let:r,"implements":r,"import":r,module:r,namespace:r,"return":r,"super":r,"this":r,"throws":r,where:r,"private":r,",":a,"null":o,"fn:false()":o,"fn:true()":o},c=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],u=0,d=c.length;d>u;u++)l[c[u]]=e(c[u]);for(var p=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],u=0,d=p.length;d>u;u++)l[p[u]]=o;for(var f=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],u=0,d=f.length;d>u;u++)l[f[u]]=i;for(var h=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],u=0,d=h.length;d>u;u++)l[h[u]]=s;return l}();return{startState:function(){return{tokenize:n,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/yaml/yaml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("thirdparty/CodeMirror2/mode/z80/z80",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("z80",function(){var e=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,t=/^(call|j[pr]|ret[in]?)\b/i,n=/^b_?(call|jump)\b/i,r=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,i=/^(n?[zc]|p[oe]?|m)\b/i,o=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,a=/^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;return{startState:function(){return{context:0}},token:function(s,l){if(s.column()||(l.context=0),s.eatSpace())return null;var c;if(s.eatWhile(/\w/)){if(c=s.current(),!s.indentation())return a.test(c)?"number":null;if(1==l.context&&r.test(c))return"variable-2";if(2==l.context&&i.test(c))return"variable-3";if(e.test(c))return l.context=1,"keyword";if(t.test(c))return l.context=2,"keyword";if(n.test(c))return l.context=3,"keyword";if(o.test(c))return"error"}else{if(s.eat(";"))return s.skipToEnd(),"comment";if(s.eat('"')){for(;(c=s.next())&&'"'!=c;)"\\"==c&&s.next();return"string"}if(s.eat("'")){if(s.match(/\\?.'/))return"number"}else if(s.eat(".")||s.sol()&&s.eat("#")){if(l.context=4,s.eatWhile(/\w/))return"def"}else if(s.eat("$")){if(s.eatWhile(/[\da-f]/i))return"number"}else if(s.eat("%")){if(s.eatWhile(/[01]/))return"number"}else s.next()}return null}}}),e.defineMIME("text/x-z80","z80")});
\No newline at end of file