sequenceserver 0.7.9 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,6 +92,19 @@ if (!SS) {
92
92
  //SS module
93
93
  (function () {
94
94
 
95
+ SS.decorate = function (name) {
96
+ return name.match(/(.?)(blast)(.?)/).slice(1).map(function (token, _) {
97
+ if (token) {
98
+ if (token !== 'blast'){
99
+ return '<strong>' + token + '</strong>';
100
+ }
101
+ else {
102
+ return token;
103
+ }
104
+ }
105
+ }).join('');
106
+ }
107
+
95
108
  /*
96
109
  ask each module to initialize itself
97
110
  */
@@ -106,68 +119,97 @@ $(document).ready(function(){
106
119
 
107
120
  // start SequenceServer's event loop
108
121
  SS.main();
109
- $('input:submit').disable();
110
122
 
111
- $('form').on('blast_valid', function () {
112
- $('input:submit').enable();
123
+ var notification_timeout;
124
+
125
+ $('#sequence').on('sequence_type_changed', function (event, type) {
126
+ clearTimeout(notification_timeout);
127
+ $(this).parent('.control-group').removeClass('error');
128
+ $('.notifications .active').hide().removeClass('active');
129
+
130
+ if (type) {
131
+ $('#' + type + '-sequence-notification').show('drop', {direction: 'up'}).addClass('active');
132
+
133
+ notification_timeout = setTimeout(function () {
134
+ $('.notifications .active').hide('drop', {direction: 'up'}).removeClass('active');
135
+ }, 5000);
136
+
137
+ if (type === 'mixed') {
138
+ $(this).parent('.control-group').addClass('error');
139
+ }
140
+ }
113
141
  });
114
142
 
115
- $('form').on('blast_invalid', function () {
116
- $('input:submit').disable();
143
+ $('body').click(function () {
144
+ $('.notifications .active').hide('drop', {direction: 'up'}).removeClass('active');
117
145
  });
118
146
 
119
- $('#sequence').bind('sequence_type_changed', function(event, type){
120
- if (type == "nucleotide"){
121
- $("#blastn, #tblastx, #blastx").enable();
122
- $("#blastp, #tblastn").uncheck().disable().first().change();
123
- }
124
- else if (type == "protein"){
125
- $("#blastp, #tblastn").enable();
126
- $("#blastn, #tblastx, #blastx").uncheck().disable().first().change();
127
- }
128
- else if (type == undefined){
129
- //reset blast methods
130
- $('.blastmethods input[type=radio]').enable().first().change();
147
+ $('.databases').on('database_type_changed', function (event, type) {
148
+ switch (type) {
149
+ case 'protein':
150
+ $('.databases.nucleotide input:checkbox').uncheck().disable();
151
+ break;
152
+ case 'nucleotide':
153
+ $('.databases.protein input:checkbox').uncheck().disable();
154
+ break;
155
+ default:
156
+ $('.databases input:checkbox').enable();
157
+ break;
131
158
  }
132
159
  });
133
160
 
134
- $(".advanced label").click(function(event){
135
- //toggle display of advanced options when "Advanced parameters" text is
136
- //clicked
137
- $(".advanced .help").toggle("fast");
161
+ $('form').on('blast_method_changed', function (event, methods){
162
+ // reset
163
+ $('#methods .dropdown-menu').html('');
164
+ $('#method').disable().val('').html('blast');
165
+ $('#methods').removeClass('btn-group').children('.dropdown-toggle').hide();
138
166
 
139
- //stop event propagation here; jQuery will call `click()` on input box
140
- //otherwise
141
- return false;
167
+ if (methods) {
168
+ var method = methods.shift();
169
+
170
+ $('#method').enable().val(method).html(SS.decorate(method));
171
+
172
+ if (methods.length >=1) {
173
+ $('#methods').addClass('btn-group').
174
+ children('.dropdown-toggle').show();
175
+
176
+ var methods_list = $.map(methods, function (method, _) {
177
+ return "<li>" + SS.decorate(method) + "</li>";
178
+ }).join('');
179
+
180
+ $('#methods .dropdown-menu').html(methods_list);
181
+ }
182
+
183
+ // jiggle
184
+ $("#methods").effect("bounce", { times:5, direction: 'left', distance: 12 }, 120);
185
+ }
142
186
  });
143
187
 
144
- $(".advanced input").click(function(event){
145
- //but for input box toggling might get annoying
146
- $(".advanced .help").show("fast");
188
+ $('#methods .dropdown-menu').click(function (event) {
189
+ // The list of possible blast methods is dynamically generated. So we
190
+ // leverage event bubbling to trap 'click' event on the list items.
191
+ var clicked = $(event.target);
192
+ var mbutton = $('#method');
193
+
194
+ var old_method = mbutton.text();
195
+ var new_method = clicked.text();
196
+
197
+ //swap
198
+ clicked.html(SS.decorate(old_method));
199
+ mbutton.val(new_method).html(SS.decorate(new_method));
200
+
201
+ // jiggle
202
+ $("#methods").effect("bounce", { times:5, direction: 'left', distance: 12 }, 120);
147
203
  });
148
204
 
149
205
  $("input#advanced").enablePlaceholder({"withPlaceholderClass": "greytext"});
150
206
  $("textarea#sequence").enablePlaceholder({"withPlaceholderClass": "greytext"});
151
207
 
152
- //when a blast method is selected
153
- $('#blastp, #blastx, #blastn, #tblastx, #tblastn').change(function(event){
154
- //then find the selected blast method
155
- var method = $('.blastmethods input[type=radio]').filter(':checked').val();
156
-
157
- //and accordingly disable incompatible databases
158
- if (method == 'blastx' || method == 'blastp'){
159
- $('.databases.nucleotide input[type=checkbox]').uncheck().disable();
160
- $('.databases.protein input[type=checkbox]').enable();
161
- }
162
- else if (method == 'blastn' || method == 'tblastx' || method == 'tblastn'){
163
- $('.databases.protein input[type=checkbox]').uncheck().disable();
164
- $('.databases.nucleotide input[type=checkbox]').enable();
165
- }
166
- else{
167
- $('.databases input[type=checkbox]').enable();
168
- }
169
-
170
- $.onedb();
208
+ $('.advanced pre').hover(function () {
209
+ $(this).addClass('hover-focus');
210
+ },
211
+ function () {
212
+ $(this).removeClass('hover-focus');
171
213
  });
172
214
 
173
215
  $('#blast').submit(function(){
@@ -177,24 +219,9 @@ $(document).ready(function(){
177
219
  var url = action.slice(0, index);
178
220
  var hash = action.slice(index, action.length);
179
221
 
180
- var button = $(this).find('input:submit');
181
-
182
- //prevent submitting another query while this one is being processed
183
- button.disable();
184
-
185
- //overlay div will contain the spinner
186
- $('body').append('<div id="overlay"></div>')
187
-
188
- //activate spinner to indicate query in progress
189
- $('#overlay').css({
190
- top: '0px',
191
- left: '0px',
192
- width: '100%',
193
- height: '100%',
194
- position: 'fixed',
195
- 'z-index': 1000,
196
- 'pointer-events': 'none',
197
- }).activity({
222
+ // display a modal window and attach an activity spinner to it
223
+ $('#spinner').modal();
224
+ $('#spinner > div').activity({
198
225
  segments: 8,
199
226
  length: 40,
200
227
  width: 16,
@@ -202,47 +229,92 @@ $(document).ready(function(){
202
229
  });
203
230
 
204
231
  // BLAST now
205
- $.post(url, $('form').serialize()).
232
+ var data = ($(this).serialize() + '&method=' + $('#method').val());
233
+ $.post(url, data).
206
234
  done(function (data) {
207
235
  // BLASTed successfully
208
236
 
209
237
  // display the result
238
+ $('.results').show();
210
239
  $('#result').html(data);
240
+
241
+ $('#blast').addClass('detached-bottom');
242
+ $('#underbar').addClass('detached-top');
243
+
244
+ //generate index
245
+ $('.resultn').index({container: '.results'});
246
+
247
+ //jump to the results
211
248
  location.hash = hash;
249
+
250
+ $('#result').
251
+ scrollspy().
252
+ on('enter.scrollspy', function () {
253
+ $('.index').removeAttr('style');
254
+ }).
255
+ on('leave.scrollspy', function () {
256
+ $('.index').css({position: 'absolute', top: $(this).offset().top});
257
+ });
258
+
259
+ $('.resultn').
260
+ scrollspy({
261
+ approach: screen.height / 4
262
+ }).
263
+ on('enter.scrollspy', function () {
264
+ var id = $(this).attr('id');
265
+ $(this).highlight();
266
+ $('.index').find('a[href="#' + id + '"]').parent().highlight();
267
+
268
+ return false;
269
+ }).
270
+ on('leave.scrollspy', function () {
271
+ var id = $(this).attr('id');
272
+ $(this).unhighlight();
273
+ $('.index').find('a[href="#' + id + '"]').parent().unhighlight();
274
+
275
+ return false;
276
+ });
212
277
  }).
213
278
  fail(function (jqXHR, status, error) {
214
- // BLAST failed
215
-
216
279
  //alert user
217
- alert('BLAST failed: ' + error);
280
+ $("#error-type").text(error);
281
+ $("#error-message").text(jqXHR.responseText);
282
+ $("#error").modal();
218
283
  }).
219
284
  always(function () {
220
285
  // BLAST complete (succefully or otherwise)
221
286
 
222
287
  // remove progress notification
223
- $('#overlay').activity(false).remove();
224
-
225
- // allow submitting a new query
226
- button.enable();
288
+ $('#spinner > div').activity(false);
289
+ $('#spinner').modal('hide');
227
290
  });
228
291
 
229
292
  return false;
230
293
  });
231
294
 
232
- $(window).scroll(function() {
233
- var areaHeight = $(this).height();
295
+ $('.results').
296
+ on('add.index', function (event, index) {
297
+ // make way for index
298
+ $('#result').css({width: '660px'});
234
299
 
235
- $('.resultn').each(function() {
236
- var scrolled = $(window).scrollTop();
237
- var start = $(this).offset().top - screen.height/2;
238
- var end = start + $(this).height();
300
+ $(index).addClass('box');
301
+ }).
302
+ on('remove.index', function () {
303
+ $('#result').removeAttr('style');
304
+ });
239
305
 
240
- if (scrolled > start && scrolled < end){
241
- $(this).highlight();
242
- }
243
- else {
244
- $(this).unhighlight();
306
+ (function (store) {
307
+ try {
308
+ var visits = store.get('visits') || 0;
309
+ visits = visits + 1;
310
+ if (visits <= 10) {
311
+ store.set('visits', visits);
312
+
313
+ if (visits === 10) {
314
+ $('#social').modal();
315
+ }
316
+ }
245
317
  }
246
- });
247
- });
318
+ catch (e) {};
319
+ }(store));
248
320
  });
@@ -0,0 +1,2 @@
1
+ /* Copyright (c) 2010-2012 Marcus Westin */
2
+ (function(){function h(){try{return d in b&&b[d]}catch(a){return!1}}function i(){try{return e in b&&b[e]&&b[e][b.location.hostname]}catch(a){return!1}}var a={},b=window,c=b.document,d="localStorage",e="globalStorage",f="__storejs__",g;a.disabled=!1,a.set=function(a,b){},a.get=function(a){},a.remove=function(a){},a.clear=function(){},a.transact=function(b,c,d){var e=a.get(b);d==null&&(d=c,c=null),typeof e=="undefined"&&(e=c||{}),d(e),a.set(b,e)},a.getAll=function(){},a.serialize=function(a){return JSON.stringify(a)},a.deserialize=function(a){return typeof a!="string"?undefined:JSON.parse(a)};if(h())g=b[d],a.set=function(b,c){if(c===undefined)return a.remove(b);g.setItem(b,a.serialize(c))},a.get=function(b){return a.deserialize(g.getItem(b))},a.remove=function(a){g.removeItem(a)},a.clear=function(){g.clear()},a.getAll=function(){var b={};for(var c=0;c<g.length;++c){var d=g.key(c);b[d]=a.get(d)}return b};else if(i())g=b[e][b.location.hostname],a.set=function(b,c){if(c===undefined)return a.remove(b);g[b]=a.serialize(c)},a.get=function(b){return a.deserialize(g[b]&&g[b].value)},a.remove=function(a){delete g[a]},a.clear=function(){for(var a in g)delete g[a]},a.getAll=function(){var b={};for(var c=0;c<g.length;++c){var d=g.key(c);b[d]=a.get(d)}return b};else if(c.documentElement.addBehavior){var j,k;try{k=new ActiveXObject("htmlfile"),k.open(),k.write('<script>document.w=window</script><iframe src="/favicon.ico"></frame>'),k.close(),j=k.w.frames[0].document,g=j.createElement("div")}catch(l){g=c.createElement("div"),j=c.body}function m(b){return function(){var c=Array.prototype.slice.call(arguments,0);c.unshift(g),j.appendChild(g),g.addBehavior("#default#userData"),g.load(d);var e=b.apply(a,c);return j.removeChild(g),e}}function n(a){return"_"+a}a.set=m(function(b,c,e){c=n(c);if(e===undefined)return a.remove(c);b.setAttribute(c,a.serialize(e)),b.save(d)}),a.get=m(function(b,c){return c=n(c),a.deserialize(b.getAttribute(c))}),a.remove=m(function(a,b){b=n(b),a.removeAttribute(b),a.save(d)}),a.clear=m(function(a){var b=a.XMLDocument.documentElement.attributes;a.load(d);for(var c=0,e;e=b[c];c++)a.removeAttribute(e.name);a.save(d)}),a.getAll=m(function(b){var c=b.XMLDocument.documentElement.attributes;b.load(d);var e={};for(var f=0,g;g=c[f];++f)e[g]=a.get(g);return e})}try{a.set(f,f),a.get(f)!=f&&(a.disabled=!0),a.remove(f)}catch(l){a.disabled=!0}typeof module!="undefined"?module.exports=a:typeof define=="function"&&define.amd?define(a):this.store=a})()
data/public/js/yaml.js ADDED
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright (C) 2011 by Vitaly Puzrin
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ * THE SOFTWARE.
21
+ */// Extend prototypes and native objects for oldIEs, Safaies and Operas
22
+ Array.isArray||(Array.isArray=function(b){return Object.prototype.toString.call(b)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b;for(b=0;b<this.length;b++)if(this[b]==a)return b;return-1}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;b=b||this;for(c=0,d=this.length;c<d;c+=1)a.call(b,this[c],c)}),Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;return function(){c.apply(b,arguments)}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){var c=[],d;for(d in b)b.hasOwnProperty(d)&&c.push(d);return c});var jsyaml=function(){var a=function(){var a=function(b,c){var d=a.resolve(b,c||"/"),e=a.modules[d];if(!e)throw new Error("Failed to resolve module "+b+", tried "+d);var f=e._cached?e._cached:e();return f};return a.paths=[],a.modules={},a.extensions=[".js",".coffee"],a._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},a.resolve=function(){return function(b,c){function h(b){if(a.modules[b])return b;for(var c=0;c<a.extensions.length;c++){var d=a.extensions[c];if(a.modules[b+d])return b+d}}function i(b){b=b.replace(/\/+$/,"");var c=b+"/package.json";if(a.modules[c]){var e=a.modules[c](),f=e.browserify;if(typeof f=="object"&&f.main){var g=h(d.resolve(b,f.main));if(g)return g}else if(typeof f=="string"){var g=h(d.resolve(b,f));if(g)return g}else if(e.main){var g=h(d.resolve(b,e.main));if(g)return g}}return h(b+"/index")}function j(a,b){var c=k(b);for(var d=0;d<c.length;d++){var e=c[d],f=h(e+"/"+a);if(f)return f;var g=i(e+"/"+a);if(g)return g}var f=h(a);if(f)return f}function k(a){var b;a==="/"?b=[""]:b=d.normalize(a).split("/");var c=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";c.push(f)}return c}c||(c="/");if(a._core[b])return b;var d=a.modules.path(),e=c||".";if(b.match(/^(?:\.\.?\/|\/)/)){var f=h(d.resolve(e,b))||i(d.resolve(e,b));if(f)return f}var g=j(b,e);if(g)return g;throw new Error("Cannot find module '"+b+"'")}}(),a.alias=function(b,c){var d=a.modules.path(),e=null;try{e=a.resolve(b+"/package.json","/")}catch(f){e=a.resolve(b,"/")}var g=d.dirname(e),h=(Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b})(a.modules);for(var i=0;i<h.length;i++){var j=h[i];if(j.slice(0,g.length+1)===g+"/"){var k=j.slice(g.length);a.modules[c+k]=a.modules[g+k]}else j===g&&(a.modules[c]=a.modules[g])}},a.define=function(b,c){var d=a._core[b]?"":a.modules.path().dirname(b),e=function(b){return a(b,d)};e.resolve=function(b){return a.resolve(b,d)},e.modules=a.modules,e.define=a.define;var f={exports:{}};a.modules[b]=function(){return a.modules[b]._cached=f.exports,c.call(f.exports,e,f,f.exports,d,b),a.modules[b]._cached=f.exports,f.exports}},typeof process=="undefined"&&(process={}),process.nextTick||(process.nextTick=function(){var a=[],b=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return b&&window.addEventListener("message",function(b){if(b.source===window&&b.data==="browserify-tick"){b.stopPropagation();if(a.length>0){var c=a.shift();c()}}},!0),function(c){b?(a.push(c),window.postMessage("browserify-tick","*")):setTimeout(c,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(b){if(b==="evals")return a("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),a.define("path",function(a,b,c,d,e){function f(a,b){var c=[];for(var d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}function g(a,b){var c=0;for(var d=a.length;d>=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var h=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){var a="",b=!1;for(var c=arguments.length;c>=-1&&!b;c--){var d=c>=0?arguments[c]:process.cwd();if(typeof d!="string"||!d)continue;a=d+"/"+a,b=d.charAt(0)==="/"}return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=a.charAt(0)==="/",c=a.slice(-1)==="/";return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),!a&&!b&&(a="."),a&&c&&(a+="/"),(b?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(f(a,function(a,b){return a&&typeof a=="string"}).join("/"))},c.dirname=function(a){var b=h.exec(a)[1]||"",c=!1;return b?b.length===1||c&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=h.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return h.exec(a)[3]||""}}),a.define("/lib/js-yaml.js",function(a,b,c,d,e){"use strict";var f=a("fs"),g=a("./js-yaml/loader"),h=b.exports={};h.scan=function(b,c,d){d=d||g.SafeLoader;var e=new d(b);while(e.checkToken())c(e.getToken())},h.compose=function(b,c){c=c||g.SafeLoader;var d=new c(b);return d.getSingleNode()},h.load=function(b,c){c=c||g.Loader;var d=new c(b);return d.getSingleData()},h.loadAll=function(b,c,d){d=d||g.Loader;var e=new d(b);while(e.checkData())c(e.getData())},h.safeLoad=function(b){return h.load(b,g.SafeLoader)},h.safeLoadAll=function(b,c){h.loadAll(b,c,g.SafeLoader)},h.addConstructor=function(b,c,d){(d||g.Loader).addConstructor(b,c)},function(){var b=function(a,b){var c=f.openSync(b,"r");a.exports=[],h.loadAll(c,function(b){a.exports.push(b)}),f.closeSync(c)};undefined!==a.extensions&&(a.extensions[".yml"]=b,a.extensions[".yaml"]=b)}()}),a.define("fs",function(a,b,c,d,e){}),a.define("/lib/js-yaml/loader.js",function(a,b,c,d,e){function m(a){g.Reader.call(this,a),h.Scanner.call(this),i.Parser.call(this),j.Composer.call(this),l.BaseConstructor.call(this),k.BaseResolver.call(this)}function n(a){g.Reader.call(this,a),h.Scanner.call(this),i.Parser.call(this),j.Composer.call(this),l.SafeConstructor.call(this),k.Resolver.call(this)}function o(a){g.Reader.call(this,a),h.Scanner.call(this),i.Parser.call(this),j.Composer.call(this),l.Constructor.call(this),k.Resolver.call(this)}"use strict";var f=a("./common"),g=a("./reader"),h=a("./scanner"),i=a("./parser"),j=a("./composer"),k=a("./resolver"),l=a("./constructor");f.extend(m.prototype,g.Reader.prototype,h.Scanner.prototype,i.Parser.prototype,j.Composer.prototype,l.BaseConstructor.prototype,k.BaseResolver.prototype),f.extend(n.prototype,g.Reader.prototype,h.Scanner.prototype,i.Parser.prototype,j.Composer.prototype,l.SafeConstructor.prototype,k.Resolver.prototype),f.extend(o.prototype,g.Reader.prototype,h.Scanner.prototype,i.Parser.prototype,j.Composer.prototype,l.Constructor.prototype,k.Resolver.prototype),m.addConstructor=function(a,b){l.BaseConstructor.addConstructor(a,b)},n.addConstructor=function(a,b){l.SafeConstructor.addConstructor(a,b)},o.addConstructor=function(a,b){l.Constructor.addConstructor(a,b)},b.exports.BaseLoader=m,b.exports.SafeLoader=n,b.exports.Loader=o}),a.define("/lib/js-yaml/common.js",function(a,b,c,d,e){"use strict";var f=b.exports={};f.extend=function(b){var c,d,e,f=[];b=b||{},d=arguments.length,!!arguments[d-1]&&!!arguments[d-1].except&&(f=arguments[d-1].except,d-=1);for(c=1;c<d;c+=1)if(!!arguments[c]&&"object"==typeof arguments[c])for(e in arguments[c])arguments[c].hasOwnProperty(e)&&-1===f.indexOf(e)&&(b[e]=arguments[c][e]);return b},f.inherits=function(b,c){var d=function(){};d.prototype=c.prototype,b.prototype=new d,f.extend(b.prototype,c.prototype,{except:["arguments","length","name","prototype","caller"]}),f.extend(b.prototype,{constructor:b}),b.__parent__=c},f.isInstanceOf=function(b,c){var d;return b instanceof c?!0:!b||!b.constructor?!1:(d=b.constructor.__parent__,d===c||f.isInstanceOf(d,c))},f.each=function(b,c,d){var e,f,g;if(null===b||undefined===b)return;d=d||c;if(b.forEach===Array.prototype.forEach)b.forEach(c,d);else{e=Object.getOwnPropertyNames(b);for(f=0,g=e.length;f<g;f+=1)c.call(d,b[e[f]],e[f],b)}},f.reverse=function(b){var c=[],d,e;for(d=0,e=b.length;d<e;d+=1)c.unshift(b[d]);return c},f.decodeBase64=function(){var a="=",b=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];return function(d){var e,f,g=0,h=[],i,j;i=0,j=0;for(g=0;g<d.length;g+=1){f=d.charCodeAt(g),e=b[f&127];if(10!==f&&13!==f){if(-1===e)throw new Error("Illegal characters (code="+f+") in position "+g+": ordinal not in range(0..128)");j=j<<6|e,i+=6,i>=8&&(i-=8,a!==d.charAt(g)&&h.push(j>>i&255),j&=(1<<i)-1)}}if(i)throw new Error("Corrupted base64 string");return new Buffer(h)}}(),f.Populator=function(b,c,d){if(!(this instanceof f.Populator))return new f.Populator(b,c,d);this.data=b,this.execute=function(){c.call(d||c)}},f.Hash=function(b){var c,d,e;if(!(this instanceof f.Hash))return new f.Hash(b);e=0,c=[],d=[],this.store=function(b,f){var g=c.indexOf(b);if(0<=g){d[g]=f;return}g=e,e+=1,c[g]=b,d[g]=f},this.remove=function(b){var e=c.indexOf(b);0<=e&&(delete c[e],delete d[e])},this.hasKey=function(b){return 0<=c.indexOf(b)},this.get=function(e){var f=c.indexOf(e);return 0<=f?d[f]:b}}}),a.define("/lib/js-yaml/reader.js",function(a,b,c,d,e){function k(a,b,c,d,e){h.YAMLError.apply(this),this.name="ReaderError",this.name=a,this.position=b,this.character=c,this.encoding=d,this.reason=e,this.toString=function f(){return"unacceptable character "+this.character+": "+this.reason+'\n in "'+this.name+'", position '+this.position}}function l(a){this.name="<unicode string>",this.stream=null,this.streamPointer=0,this.eof=!0,this.buffer="",this.pointer=0,this.rawBuffer=null,this.encoding="utf-8",this.index=0,this.line=0,this.column=0,"string"==typeof a?(this.name="<unicode string>",this.checkPrintable(a),this.buffer=a+"\0"):Buffer.isBuffer(a)?(this.name="<buffer>",this.rawBuffer=a,this.update(1)):(this.name="<file>",this.stream=a,this.eof=!1,this.updateRaw(),this.update(1))}"use strict";var f=a("fs"),g=a("./common"),h=a("./errors"),i=new RegExp("[^\t\n\r -~… -퟿-�]"),j=undefined==="a"[0]?function(a,b){return a.charAt(b)}:function(a,b){return a[b]};g.inherits(k,h.YAMLError),l.prototype.peek=function(b){var c;return b=+b||0,c=j(this.buffer,this.pointer+b),undefined===c&&(this.update(b+1),c=j(this.buffer,this.pointer+b)),c},l.prototype.prefix=function(b){return b=+b||1,this.pointer+b>=this.buffer.length&&this.update(b),this.buffer.slice(this.pointer,this.pointer+b)},l.prototype.forward=function(b){var c;b=undefined!==b?+b:1,this.pointer+b+1>=this.buffer.length&&this.update(b+1);while(b)c=this.buffer[this.pointer],this.pointer+=1,this.index+=1,0<="\n…\u2028\u2029".indexOf(c)||"\r"===c&&"\n"!==this.buffer[this.pointer]?(this.line+=1,this.column=0):c!==""&&(this.column+=1),b-=1},l.prototype.getMark=function(){return null===this.stream?new h.Mark(this.name,this.index,this.line,this.column,this.buffer,this.pointer):new h.Mark(this.name,this.index,this.line,this.column,null,null)},l.prototype.checkPrintable=function(b){var c=b.toString().match(i),d;if(c)throw d=this.index+this.buffer.length-this.pointer+c.index,new k(this.name,d,c[0],"unicode","special characters are not allowed")},l.prototype.update=function(b){var c;if(null===this.rawBuffer)return;this.buffer=this.buffer.slice(this.pointer),this.pointer=0;while(this.buffer.length<b){this.eof||this.updateRaw(),c=this.rawBuffer,this.checkPrintable(c),this.buffer+=c,this.rawBuffer=this.rawBuffer.slice(c.length);if(this.eof){this.buffer+="\0",this.rawBuffer=null;break}}},l.prototype.updateRaw=function(b){var c=new Buffer(+b||4096),d,e;d=f.readSync(this.stream,c,0,c.length),null===this.rawBuffer?this.rawBuffer=c.slice(0,d):(e=new Buffer(this.rawBuffer.length+d),this.rawBuffer.copy(e),c.copy(e,this.rawBuffer.length),this.rawBuffer=e),this.streamPointer+=d;if(!d||d<c.length)this.eof=!0},b.exports.Reader=l}),a.define("/lib/js-yaml/errors.js",function(a,b,c,d,e){function h(a,b,c,d,e,f){this.name=a,this.index=b,this.line=c,this.column=d,this.buffer=e,this.pointer=f}function i(a){f.extend(this,Error.prototype.constructor.call(this,a)),this.name="YAMLError"}function j(a){var b="Error ";return null!==a.problemMark&&(b+="on line "+(a.problemMark.line+1)+", col "+(a.problemMark.column+1)+": "),null!==a.problem&&(b+=a.problem),null!==a.note&&(b+=a.note),b}function k(a){var b=[];return null!==a.context&&b.push(a.context),null!==a.contextMark&&(null===a.problem||null===a.problemMark||a.contextMark.name!==a.problemMark.name||a.contextMark.line!==a.problemMark.line||a.contextMark.column!==a.problemMark.column)&&b.push(a.contextMark.toString()),null!==a.problem&&b.push(a.problem),null!==a.problemMark&&b.push(a.problemMark.toString()),null!==a.note&&b.push(a.note),b.join("\n")}function l(a,b,c,d,e){i.call(this),this.name="MarkedYAMLError",this.context=a||null,this.contextMark=b||null,this.problem=c||null,this.problemMark=d||null,this.note=e||null,this.toString=function f(a){return a?j(this):k(this)}}"use strict";var f=a("./common"),g=function(b,c){var d="",e;for(e=0;e<c;e+=1)d+=b;return d};h.prototype.getSnippet=function(a,b){var c,d,e,f,h;if(!this.buffer)return null;a=a||4,b=b||75,c="",d=this.pointer;while(d>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer[d-1])){d-=1;if(this.pointer-d>b/2-1){c=" ... ",d+=5;break}}e="",f=this.pointer;while(f<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer[f])){f+=1;if(f-this.pointer>b/2-1){e=" ... ",f-=5;break}}return h=this.buffer.slice(d,f),g(" ",a)+c+h+e+"\n"+g(" ",a+this.pointer-d+c.length)+"^"},h.prototype.toString=function(){var a=this.getSnippet(),b;return b=' in "'+this.name+'", line '+(this.line+1)+", column "+(this.column+1),a&&(b+=":\n"+a),b},f.inherits(i,Error),f.inherits(l,i),b.exports.Mark=h,b.exports.YAMLError=i,b.exports.MarkedYAMLError=l}),a.define("/lib/js-yaml/scanner.js",function(a,b,c,d,e){function l(){g.MarkedYAMLError.apply(this,arguments),this.name="ScannerError"}function m(a,b,c,d,e,f){this.tokenNumber=a,this.required=b,this.index=c,this.line=d,this.column=e,this.mark=f}function n(){this.done=!1,this.flowLevel=0,this.tokens=[],this.fetchStreamStart(),this.tokensTaken=0,this.indent=-1,this.indents=[],this.allowSimpleKey=!0,this.possibleSimpleKeys={}}"use strict";var f=a("./common"),g=a("./errors"),h=a("./tokens"),i={0:"\0",a:"",b:"\b",t:"\t","\t":"\t",n:"\n",v:" ",f:"\f",r:"\r",e:""," ":" ",'"':'"',"\\":"\\",N:"…",_:" ",L:"\u2028",P:"\u2029"},j={x:2,u:4,U:8},k=function(a,b){var c=[];undefined===b&&(b=a,a=0);while(0<b)c.push(a),b-=1,a+=1;return c};f.inherits(l,g.MarkedYAMLError),n.prototype.checkToken=function(){var b;while(this.needMoreTokens())this.fetchMoreTokens();if(this.tokens.length){if(!arguments.length)return!0;for(b=0;b<arguments.length;b+=1)if(f.isInstanceOf(this.tokens[0],arguments[b]))return!0}return!1},n.prototype.peekToken=function(){while(this.needMoreTokens())this.fetchMoreTokens();return this.tokens.length?this.tokens[0]:null},n.prototype.getToken=function(){var b=null;while(this.needMoreTokens())this.fetchMoreTokens();return this.tokens.length&&(this.tokensTaken+=1,b=this.tokens.shift()),b},n.prototype.needMoreTokens=function(){return this.done?!1:this.tokens.length?(this.stalePossibleSimpleKeys(),this.nextPossibleSimpleKey()===this.tokensTaken?!0:!1):!0},n.prototype.fetchMoreTokens=function(){var b;this.scanToNextToken(),this.stalePossibleSimpleKeys(),this.unwindIndent(this.column),b=this.peek();if(b==="\0")return this.fetchStreamEnd();if(b==="%"&&this.checkDirective())return this.fetchDirective();if(b==="-"&&this.checkDocumentStart())return this.fetchDocumentStart();if(b==="."&&this.checkDocumentEnd())return this.fetchDocumentEnd();if(b==="[")return this.fetchFlowSequenceStart();if(b==="{")return this.fetchFlowMappingStart();if(b==="]")return this.fetchFlowSequenceEnd();if(b==="}")return this.fetchFlowMappingEnd();if(b===",")return this.fetchFlowEntry();if(b==="-"&&this.checkBlockEntry())return this.fetchBlockEntry();if(b==="?"&&this.checkKey())return this.fetchKey();if(b===":"&&this.checkValue())return this.fetchValue();if(b==="*")return this.fetchAlias();if(b==="&")return this.fetchAnchor();if(b==="!")return this.fetchTag();if(b==="|"&&!this.flowLevel)return this.fetchLiteral();if(b===">"&&!this.flowLevel)return this.fetchFolded();if(b==="'")return this.fetchSingle();if(b==='"')return this.fetchDouble();if(this.checkPlain())return this.fetchPlain();throw new l("while scanning for the next token",null,"found character "+b+" that cannot start any token",this.getMark())},n.prototype.nextPossibleSimpleKey=function(){var b=null;return f.each(this.possibleSimpleKeys,function(a){if(null===b||a.tokenNumber<b)b=a.tokenNumber}),b},n.prototype.stalePossibleSimpleKeys=function(){f.each(this.possibleSimpleKeys,function(a,b){if(a.line!==this.line||1024<this.index-a.index){if(a.required)throw new l("while scanning a simple key",a.mark,"could not found expected ':'",this.getMark());delete this.possibleSimpleKeys[b]}},this)},n.prototype.savePossibleSimpleKey=function(){var b,c,d;b=!this.flowLevel&&this.indent===this.column;if(!this.allowSimpleKey&&b)throw new g.YAMLError("Simple key is required");this.allowSimpleKey&&(this.removePossibleSimpleKey(),c=this.tokensTaken+this.tokens.length,d=new m(c,b,this.index,this.line,this.column,this.getMark()),this.possibleSimpleKeys[this.flowLevel]=d)},n.prototype.removePossibleSimpleKey=function(){var b;if(undefined!==this.possibleSimpleKeys[this.flowLevel]){b=this.possibleSimpleKeys[this.flowLevel];if(b.required)throw new l("while scanning a simple key",b.mark,"could not found expected ':'",this.getMark());delete this.possibleSimpleKeys[this.flowLevel]}},n.prototype.unwindIndent=function(b){var c;if(this.flowLevel)return;while(this.indent>b)c=this.getMark(),this.indent=this.indents.pop(),this.tokens.push(new h.BlockEndToken(c,c))},n.prototype.addIndent=function(b){return this.indent<b?(this.indents.push(this.indent),this.indent=b,!0):!1},n.prototype.fetchStreamStart=function(){var b;b=this.getMark(),this.tokens.push(new h.StreamStartToken(b,b,this.encoding))},n.prototype.fetchStreamEnd=function(){var b;this.unwindIndent(-1),this.removePossibleSimpleKey(),this.allowSimpleKey=!1,this.possibleSimpleKeys={},b=this.getMark(),this.tokens.push(new h.StreamEndToken(b,b)),this.done=!0},n.prototype.fetchDirective=function(){this.unwindIndent(-1),this.removePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanDirective())},n.prototype.fetchDocumentStart=function(){this.fetchDocumentIndicator(h.DocumentStartToken)},n.prototype.fetchDocumentEnd=function(){this.fetchDocumentIndicator(h.DocumentEndToken)},n.prototype.fetchDocumentIndicator=function(b){var c,d;this.unwindIndent(-1),this.removePossibleSimpleKey(),this.allowSimpleKey=!1,c=this.getMark(),this.forward(3),d=this.getMark(),this.tokens.push(new b(c,d))},n.prototype.fetchFlowSequenceStart=function(){this.fetchFlowCollectionStart(h.FlowSequenceStartToken)},n.prototype.fetchFlowMappingStart=function(){this.fetchFlowCollectionStart(h.FlowMappingStartToken)},n.prototype.fetchFlowCollectionStart=function(b){var c,d;this.savePossibleSimpleKey(),this.flowLevel+=1,this.allowSimpleKey=!0,c=this.getMark(),this.forward(),d=this.getMark(),this.tokens.push(new b(c,d))},n.prototype.fetchFlowSequenceEnd=function(){this.fetchFlowCollectionEnd(h.FlowSequenceEndToken)},n.prototype.fetchFlowMappingEnd=function(){this.fetchFlowCollectionEnd(h.FlowMappingEndToken)},n.prototype.fetchFlowCollectionEnd=function(b){var c,d;this.removePossibleSimpleKey(),this.flowLevel-=1,this.allowSimpleKey=!1,c=this.getMark(),this.forward(),d=this.getMark(),this.tokens.push(new b(c,d))},n.prototype.fetchFlowEntry=function(){var b,c;this.allowSimpleKey=!0,this.removePossibleSimpleKey(),b=this.getMark(),this.forward(),c=this.getMark(),this.tokens.push(new h.FlowEntryToken(b,c))},n.prototype.fetchBlockEntry=function(){var b,c,d;if(!this.flowLevel){if(!this.allowSimpleKey)throw new l(null,null,"sequence entries are not allowed here",this.getMark());this.addIndent(this.column)&&(b=this.getMark(),this.tokens.push(new h.BlockSequenceStartToken(b,b)))}this.allowSimpleKey=!0,this.removePossibleSimpleKey(),c=this.getMark(),this.forward(),d=this.getMark(),this.tokens.push(new h.BlockEntryToken(c,d))},n.prototype.fetchKey=function(){var b,c,d;if(!this.flowLevel){if(!this.allowSimpleKey)throw new l(null,null,"mapping keys are not allowed here",this.getMark());this.addIndent(this.column)&&(b=this.getMark(),this.tokens.push(new h.BlockMappingStartToken(b,b)))}this.allowSimpleKey=!this.flowLevel,this.removePossibleSimpleKey(),c=this.getMark(),this.forward(),d=this.getMark(),this.tokens.push(new h.KeyToken(c,d))},n.prototype.fetchValue=function(){var b,c,d,e;if(undefined!==this.possibleSimpleKeys[this.flowLevel])b=this.possibleSimpleKeys[this.flowLevel],delete this.possibleSimpleKeys[this.flowLevel],this.tokens.splice(b.tokenNumber-this.tokensTaken,0,new h.KeyToken(b.mark,b.mark)),this.flowLevel||this.addIndent(b.column)&&this.tokens.splice(b.tokenNumber-this.tokensTaken,0,new h.BlockMappingStartToken(b.mark,b.mark)),this.allowSimpleKey=!1;else{if(!this.flowLevel&&!this.allowSimpleKey)throw new l(null,null,"mapping values are not allowed here",this.getMark());this.flowLevel||this.addIndent(this.column)&&(c=this.getMark(),this.tokens.push(new h.BlockMappingStartToken(c,c))),this.allowSimpleKey=!this.flowLevel,this.removePossibleSimpleKey()}d=this.getMark(),this.forward(),e=this.getMark(),this.tokens.push(new h.ValueToken(d,e))},n.prototype.fetchAlias=function(){this.savePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanAnchor(h.AliasToken))},n.prototype.fetchAnchor=function(){this.savePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanAnchor(h.AnchorToken))},n.prototype.fetchTag=function(){this.savePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanTag())},n.prototype.fetchLiteral=function(){this.fetchBlockScalar("|")},n.prototype.fetchFolded=function(){this.fetchBlockScalar(">")},n.prototype.fetchBlockScalar=function(b){this.allowSimpleKey=!0,this.removePossibleSimpleKey(),this.tokens.push(this.scanBlockScalar(b))},n.prototype.fetchSingle=function(){this.fetchFlowScalar("'")},n.prototype.fetchDouble=function(){this.fetchFlowScalar('"')},n.prototype.fetchFlowScalar=function(b){this.savePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanFlowScalar(b))},n.prototype.fetchPlain=function(){this.savePossibleSimpleKey(),this.allowSimpleKey=!1,this.tokens.push(this.scanPlain())},n.prototype.checkDirective=function(){return this.column===0},n.prototype.checkDocumentStart=function(){return+this.column===0&&this.prefix(3)==="---"?0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(3)):!1},n.prototype.checkDocumentEnd=function(){return+this.column===0&&this.prefix(3)==="..."?0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(3)):!1},n.prototype.checkBlockEntry=function(){return 0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(1))},n.prototype.checkKey=function(){return this.flowLevel?!0:0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(1))},n.prototype.checkValue=function(){return this.flowLevel?!0:0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(1))},n.prototype.checkPlain=function(){var b=this.peek();return-1==="\0 \t\r\n…\u2028\u2029-?:,[]{}#&*!|>'\"%@`".indexOf(b)||-1==="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(1))&&(b==="-"||!this.flowLevel&&0<="?:".indexOf(b))},n.prototype.scanToNextToken=function(){var b=!1;this.index===0&&this.peek()===""&&this.forward();while(!b){while(this.peek()===" ")this.forward();if(this.peek()==="#")while(-1==="\0\r\n…\u2028\u2029".indexOf(this.peek()))this.forward();this.scanLineBreak()?this.flowLevel||(this.allowSimpleKey=!0):b=!0}},n.prototype.scanDirective=function(){var b,c,d,e;b=this.getMark(),this.forward(),d=this.scanDirectiveName(b),e=null;if(d==="YAML")e=this.scanYamlDirectiveValue(b),c=this.getMark();else if(d==="TAG")e=this.scanTagDirectiveValue(b),c=this.getMark();else{c=this.getMark();while(-1==="\0\r\n…\u2028\u2029".indexOf(this.peek()))this.forward()}return this.scanDirectiveIgnoredLine(b),new h.DirectiveToken(d,e,b,c)},n.prototype.scanDirectiveName=function(b){var c,d,e;c=0,d=this.peek(c);while(/^[0-9A-Za-z]/.test(d)||0<="-_".indexOf(d))c+=1,d=this.peek(c);if(!c)throw new l("while scanning a directive",b,"expected alphabetic or numeric character, but found "+d,this.getMark());e=this.prefix(c),this.forward(c),d=this.peek();if(-1==="\0 \r\n…\u2028\u2029".indexOf(d))throw new l("while scanning a directive",b,"expected alphabetic or numeric character, but found "+d,this.getMark());return e},n.prototype.scanYamlDirectiveValue=function(b){var c,d;while(this.peek()===" ")this.forward();c=this.scanYamlDirectiveNumber(b);if(this.peek()!==".")throw new l("while scanning a directive",b,"expected a digit or '.', but found "+this.peek(),this.getMark());this.forward(),d=this.scanYamlDirectiveNumber(b);if(-1==="\0 \r\n…\u2028\u2029".indexOf(this.peek()))throw new l("while scanning a directive",b,"expected a digit or ' ', but found "+this.peek(),this.getMark());return[c,d]},n.prototype.scanYamlDirectiveNumber=function(b){var c,d,e;c=this.peek();if(!/^[0-9]/.test(c))throw new l("while scanning a directive",b,"expected a digit, but found "+c,this.getMark());d=0;while(/^[0-9]/.test(this.peek(d)))d+=1;return e=+this.prefix(d),this.forward(d),e},n.prototype.scanTagDirectiveValue=function(b){var c,d;while(this.peek()===" ")this.forward();c=this.scanTagDirectiveHandle(b);while(this.peek()===" ")this.forward();return d=this.scanTagDirectivePrefix(b),[c,d]},n.prototype.scanTagDirectiveHandle=function(b){var c,d;c=this.scanTagHandle("directive",b),d=this.peek();if(d!==" ")throw new l("while scanning a directive",b,"expected ' ', but found "+d,this.getMark());return c},n.prototype.scanTagDirectivePrefix=function(b){var c,d;c=this.scanTagUri("directive",b),d=this.peek();if(-1==="\0 \r\n…\u2028\u2029".indexOf(d))throw new l("while scanning a directive",b,"expected ' ', but found "+d,this.getMark());return c},n.prototype.scanDirectiveIgnoredLine=function(b){var c;while(this.peek()===" ")this.forward();if(this.peek()==="#")while(-1==="\0\r\n…\u2028\u2029".indexOf(this.peek()))this.forward();c=this.peek();if(-1==="\0\r\n…\u2028\u2029".indexOf(c))throw new l("while scanning a directive",b,"expected a comment or a line break, but found "+c,this.getMark());this.scanLineBreak()},n.prototype.scanAnchor=function(b){var c,d,e,f,g,h;c=this.getMark(),d=this.peek(),e=d==="*"?"alias":"anchor",this.forward(),f=0,g=this.peek(f);while(/^[0-9A-Za-z]/.test(g)||0<="-_".indexOf(g))f+=1,g=this.peek(f);if(!f)throw new l("while scanning an "+e,c,"expected alphabetic or numeric character, but found "+g,this.getMark());h=this.prefix(f),this.forward(f),g=this.peek();if(-1==="\0 \t\r\n…\u2028\u2029?:,]}%@`".indexOf(g))throw new l("while scanning an "+e,c,"expected alphabetic or numeric character, but found "+g,this.getMark());return new b(h,c,this.getMark())},n.prototype.scanTag=function(){var b,c,d,e,f,g;b=this.getMark(),c=this.peek(1);if(c==="<"){d=null,this.forward(2),e=this.scanTagUri("tag",b);if(this.peek()!==">")throw new l("while parsing a tag",b,"expected '>', but found "+this.peek(),this.getMark());this.forward()}else if(0<="\0 \t\r\n…\u2028\u2029".indexOf(c))d=null,e="!",this.forward();else{f=1,g=!1;while(-1==="\0 \r\n…\u2028\u2029".indexOf(c)){if(c==="!"){g=!0;break}f+=1,c=this.peek(f)}g?d=this.scanTagHandle("tag",b):(d="!",this.forward()),e=this.scanTagUri("tag",b)}c=this.peek();if(-1==="\0 \r\n…\u2028\u2029".indexOf(c))throw new l("while scanning a tag",b,"expected ' ', but found "+c,this.getMark());return new h.TagToken([d,e],b,this.getMark())},n.prototype.scanBlockScalar=function(b){var c,d,e,f,g,i=null,j,k,l,m,n,o,p,q;c=b===">",d=[],e=this.getMark(),this.forward(),p=this.scanBlockScalarIndicators(e),g=p[0],i=p[1]||null,this.scanBlockScalarIgnoredLine(e),j=this.indent+1,j<1&&(j=1),null===i?(p=this.scanBlockScalarIndentation(),m=p[0],k=p[1],f=p[2],l=Math.max(j,k)):(l=j+i-1,p=this.scanBlockScalarBreaks(l),m=p[0],f=p[1]),n="";while(+this.column===l&&this.peek()!=="\0"){d=d.concat(m),o=-1===" \t".indexOf(this.peek()),q=0;while(-1==="\0\r\n…\u2028\u2029".indexOf(this.peek(q)))q+=1;d.push(this.prefix(q)),this.forward(q),n=this.scanLineBreak(),p=this.scanBlockScalarBreaks(l),m=p[0],f=p[1];if(+this.column!==l||this.peek()==="\0")break;c&&n==="\n"&&o&&-1===" \t".indexOf(this.peek())?(!m||!m.length)&&d.push(" "):d.push(n)}return!1!==g&&d.push(n),!0===g&&(d=d.concat(m)),new h.ScalarToken(d.join(""),!1,e,f,b)},n.prototype.scanBlockScalarIndicators=function(b){var c=null,d=null,e=this.peek();if(0<="+-".indexOf(e)){c=e==="+",this.forward(),e=this.peek();if(0<="0123456789".indexOf(e)){d=+e;if(d===0)throw new l("while scanning a block scalar",b,"expected indentation indicator in the range 1-9, but found 0",this.getMark());this.forward()}}else if(0<="0123456789".indexOf(e)){d=+e;if(d===0)throw new l("while scanning a block scalar",b,"expected indentation indicator in the range 1-9, but found 0",this.getMark());this.forward(),e=this.peek(),0<="+-".indexOf(e)&&(c=e==="+",this.forward())}e=this.peek();if(-1==="\0 \r\n…\u2028\u2029".indexOf(e))throw new l("while scanning a block scalar",b,"expected chomping or indentation indicators, but found "+e,this.getMark());return[c,d]},n.prototype.scanBlockScalarIgnoredLine=function(b){var c;while(this.peek()===" ")this.forward();if(this.peek()==="#")while(-1==="\0\r\n…\u2028\u2029".indexOf(this.peek()))this.forward();c=this.peek();if(-1==="\0\r\n…\u2028\u2029".indexOf(c))throw new l("while scanning a block scalar",b,"expected a comment or a line break, but found "+c,this.getMark());this.scanLineBreak()},n.prototype.scanBlockScalarIndentation=function(){var b,c,d;b=[],c=0,d=this.getMark();while(0<=" \r\n…\u2028\u2029".indexOf(this.peek()))this.peek()!==" "?(b.push(this.scanLineBreak()),d=this.getMark()):(this.forward(),this.column>c&&(c=this.column));return[b,c,d]},n.prototype.scanBlockScalarBreaks=function(b){var c,d;c=[],d=this.getMark();while(this.column<b&&this.peek()===" ")this.forward();while(0<="\r\n…\u2028\u2029".indexOf(this.peek())){c.push(this.scanLineBreak()),d=this.getMark();while(this.column<b&&this.peek()===" ")this.forward()}return[c,d]},n.prototype.scanFlowScalar=function(b){var c,d,e,f,g,i,j;c=b==='"',d=[],g=this.getMark(),i=this.peek(),this.forward(),d=d.concat(this.scanFlowScalarNonSpaces(c,g));while(this.peek()!==i)d=d.concat(this.scanFlowScalarSpaces(c,g)),d=d.concat(this.scanFlowScalarNonSpaces(c,g));return this.forward(),j=this.getMark(),new h.ScalarToken(d.join(""),!1,g,j,b)},n.prototype.scanFlowScalarNonSpaces=function(b,c){var d=this,e,f,g,h,m;m=function(a){if(-1==="0123456789ABCDEFabcdef".indexOf(d.peek(a)))throw new l("while scanning a double-quoted scalar",c,"expected escape sequence of "+f+" hexdecimal numbers, but found "+d.peek(a),d.getMark())},e=[];for(;;){f=0;while(-1==="'\"\\\0 \t\r\n…\u2028\u2029".indexOf(this.peek(f)))f+=1;f&&(e.push(this.prefix(f)),this.forward(f)),g=this.peek();if(!b&&g==="'"&&this.peek(1)==="'")e.push("'"),this.forward(2);else if(b&&g==="'"||!b&&0<='"\\'.indexOf(g))e.push(g),this.forward();else{if(!b||g!=="\\")return e;this.forward(),g=this.peek();if(i.hasOwnProperty(g))e.push(i[g]),this.forward();else if(j.hasOwnProperty(g))f=j[g],this.forward(),k(f).forEach(m),h=parseInt(this.prefix(f),16),e.push(String.fromCharCode(h)),this.forward(f);else{if(!(0<="\r\n…\u2028\u2029".indexOf(g)))throw new l("while scanning a double-quoted scalar"
23
+ ,c,"found unknown escape character "+g,this.getMark());this.scanLineBreak(),e=e.concat(this.scanFlowScalarBreaks(b,c))}}}},n.prototype.scanFlowScalarSpaces=function(b,c){var d,e,f,g,h,i;d=[],e=0;while(0<=" \t".indexOf(this.peek(e)))e+=1;f=this.prefix(e),this.forward(e),g=this.peek();if(g==="\0")throw new l("while scanning a quoted scalar",c,"found unexpected end of stream",this.getMark());return 0<="\r\n…\u2028\u2029".indexOf(g)?(h=this.scanLineBreak(),i=this.scanFlowScalarBreaks(b,c),h!=="\n"?d.push(h):i||d.push(" "),d=d.concat(i)):d.push(f),d},n.prototype.scanFlowScalarBreaks=function(b,c){var d=[],e;for(;;){e=this.prefix(3);if((e==="---"||e==="...")&&0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(3)))throw new l("while scanning a quoted scalar",c,"found unexpected document separator",this.getMark());while(0<=" \t".indexOf(this.peek()))this.forward();if(!(0<="\r\n…\u2028\u2029".indexOf(this.peek())))return d;d.push(this.scanLineBreak())}},n.prototype.scanPlain=function(){var b,c,d,e,f,g,i;c=[],d=this.getMark(),e=d,f=this.indent+1,g=[];for(;;){i=0;if(this.peek()==="#")break;for(;;){b=this.peek(i);if(0<="\0 \t\r\n…\u2028\u2029".indexOf(b)||!this.flowLevel&&b===":"&&0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(i+1))||this.flowLevel&&0<=",:?[]{}".indexOf(b))break;i+=1}if(this.flowLevel&&b===":"&&-1==="\0 \t\r\n…\u2028\u2029,[]{}".indexOf(this.peek(i+1)))throw this.forward(i),new l("while scanning a plain scalar",d,"found unexpected ':'",this.getMark(),"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.");if(i===0)break;this.allowSimpleKey=!1,c=c.concat(g),c.push(this.prefix(i)),this.forward(i),e=this.getMark(),g=this.scanPlainSpaces(f,d);if(!Array.isArray(g)||!g.length||this.peek()==="#"||!this.flowLevel&&this.column<f)break}return new h.ScalarToken(c.join(""),!0,d,e)},n.prototype.scanPlainSpaces=function(b,c){var d,e,f,g,h,i,j;d=[],e=0;while(this.peek(e)===" ")e+=1;f=this.prefix(e),this.forward(e),g=this.peek();if(0<="\r\n…\u2028\u2029".indexOf(g)){j=this.scanLineBreak(),this.allowSimpleKey=!0,h=this.prefix(3);if((h==="---"||h==="...")&&0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(3)))return;i=[];while(0<=" \r\n…\u2028\u2029".indexOf(this.peek()))if(this.peek()===" ")this.forward();else{i.push(this.scanLineBreak()),h=this.prefix(3);if((h==="---"||h==="...")&&0<="\0 \t\r\n…\u2028\u2029".indexOf(this.peek(3)))return}j!=="\n"?d.push(j):(!i||!i.length)&&d.push(" "),d=d.concat(i)}else f&&d.push(f);return d},n.prototype.scanTagHandle=function(b,c){var d,e,f;d=this.peek();if(d!=="!")throw new l("while scanning a "+b,c,"expected '!', but found "+d,this.getMark());e=1,d=this.peek(e);if(d!==" "){while(/^[0-9A-Za-z]/.test(d)||0<="-_".indexOf(d))e+=1,d=this.peek(e);if(d!=="!")throw this.forward(e),new l("while scanning a "+b,c,"expected '!', but found "+d,this.getMark());e+=1}return f=this.prefix(e),this.forward(e),f},n.prototype.scanTagUri=function(b,c){var d,e,f;d=[],e=0,f=this.peek(e);while(/^[0-9A-Za-z]/.test(f)||0<="-;/?:@&=+$,_.!~*'()[]%".indexOf(f))f==="%"?(d.push(this.prefix(e)),this.forward(e),e=0,d.push(this.scanUriEscapes(b,c))):e+=1,f=this.peek(e);e&&(d.push(this.prefix(e)),this.forward(e),e=0);if(!d.length)throw new l("while parsing a "+b,c,"expected URI, but found "+f,this.getMark());return d.join("")},n.prototype.scanUriEscapes=function(b,c){var d=this,e,f,g,h;e=[],f=this.getMark(),h=function(a){if(-1==="0123456789ABCDEFabcdef".indexOf(d.peek(a)))throw new l("while scanning a "+b,c,"expected URI escape sequence of 2 hexdecimal numbers, but found "+d.peek(a),d.getMark())};while(this.peek()==="%")this.forward(),k(2).forEach(h),e.push(parseInt(this.prefix(2),16)),this.forward(2);try{g=(new Buffer(e)).toString("utf8")}catch(i){throw new l("while scanning a "+b,c,i.toString(),f)}return g},n.prototype.scanLineBreak=function(){var b;return b=this.peek(),0<="\r\n…".indexOf(b)?(this.prefix(2)==="\r\n"?this.forward(2):this.forward(),"\n"):0<="\u2028\u2029".indexOf(b)?(this.forward(),b):""},b.exports.Scanner=n}),a.define("/lib/js-yaml/tokens.js",function(a,b,c,d,e){function g(a,b){this.startMark=a||null,this.endMark=b||null}function h(a,b,c,d){g.call(this,c,d),this.name=a,this.value=b}function i(){g.apply(this,arguments)}function j(){g.apply(this,arguments)}function k(a,b,c){g.call(this,a,b),this.encoding=c||null}function l(){g.apply(this,arguments)}function m(){g.apply(this,arguments)}function n(){g.apply(this,arguments)}function o(){g.apply(this,arguments)}function p(){g.apply(this,arguments)}function q(){g.apply(this,arguments)}function r(){g.apply(this,arguments)}function s(){g.apply(this,arguments)}function t(){g.apply(this,arguments)}function u(){g.apply(this,arguments)}function v(){g.apply(this,arguments)}function w(){g.apply(this,arguments)}function x(a,b,c){g.call(this,b,c),this.value=a}function y(a,b,c){g.call(this,b,c),this.value=a}function z(a,b,c){g.call(this,b,c),this.value=a}function A(a,b,c,d,e){g.call(this,c,d),this.value=a,this.plain=b,this.style=e||null}"use strict";var f=a("./common");g.prototype.hash=g.prototype.toString=function B(){var a=[],b=this;return Object.getOwnPropertyNames(this).forEach(function(c){/startMark|endMark|__meta__/.test(c)||a.push(c+":"+b[c])}),this.constructor.name+"("+a.join(", ")+")"},f.inherits(h,g),h.id="<directive>",f.inherits(i,g),i.id="<document start>",f.inherits(j,g),j.id="<document end>",f.inherits(k,g),k.id="<stream start>",f.inherits(l,g),l.id="<stream end>",f.inherits(m,g),m.id="<block sequence start>",f.inherits(n,g),n.id="<block mapping start>",f.inherits(o,g),o.id="<block end>",f.inherits(p,g),p.id="[",f.inherits(q,g),q.id="{",f.inherits(r,g),r.id="]",f.inherits(s,g),s.id="}",f.inherits(t,g),t.id="?",f.inherits(u,g),u.id=":",f.inherits(v,g),v.id="-",f.inherits(w,g),w.id=",",f.inherits(x,g),x.id="<alias>",f.inherits(y,g),y.id="<anchor>",f.inherits(z,g),z.id="<tag>",f.inherits(A,g),z.id="<scalar>",b.exports.DirectiveToken=h,b.exports.DocumentStartToken=i,b.exports.DocumentEndToken=j,b.exports.StreamStartToken=k,b.exports.StreamEndToken=l,b.exports.BlockSequenceStartToken=m,b.exports.BlockMappingStartToken=n,b.exports.BlockEndToken=o,b.exports.FlowSequenceStartToken=p,b.exports.FlowMappingStartToken=q,b.exports.FlowSequenceEndToken=r,b.exports.FlowMappingEndToken=s,b.exports.KeyToken=t,b.exports.ValueToken=u,b.exports.BlockEntryToken=v,b.exports.FlowEntryToken=w,b.exports.AliasToken=x,b.exports.AnchorToken=y,b.exports.TagToken=z,b.exports.ScalarToken=A}),a.define("/lib/js-yaml/parser.js",function(a,b,c,d,e){function j(){g.MarkedYAMLError.apply(this,arguments),this.name="ParserError"}function l(a){this.currentEvent=null,this.yamlVersion=null,this.tagHandles={},this.states=[],this.marks=[],this.state=this.parseStreamStart.bind(this)}"use strict";var f=a("./common"),g=a("./errors"),h=a("./tokens"),i=a("./events");f.inherits(j,g.MarkedYAMLError);var k={"!":"!","!!":"tag:yaml.org,2002:"};l.prototype.dispose=function(){this.states=[],this.state=null},l.prototype.checkEvent=function(){var b;null===this.currentEvent&&!!this.state&&(this.currentEvent=this.state());if(null!==this.currentEvent){if(0===arguments.length)return!0;for(b=0;b<arguments.length;b+=1)if(f.isInstanceOf(this.currentEvent,arguments[b]))return!0}return!1},l.prototype.peekEvent=function(){return null===this.currentEvent&&!!this.state&&(this.currentEvent=this.state()),this.currentEvent},l.prototype.getEvent=function(){var b;return null===this.currentEvent&&!!this.state&&(this.currentEvent=this.state()),b=this.currentEvent,this.currentEvent=null,b},l.prototype.parseStreamStart=function(){var b,c;return b=this.getToken(),c=new i.StreamStartEvent(b.startMark,b.endMark,b.encoding),this.state=this.parseImplicitDocumentStart.bind(this),c},l.prototype.parseImplicitDocumentStart=function(){var b,c;return this.checkToken(h.DirectiveToken,h.DocumentStartToken,h.StreamEndToken)?this.parseDocumentStart():(this.tagHandles=k,b=this.peekToken(),c=new i.DocumentStartEvent(b.startMark,b.startMark,!1),this.states.push(this.parseDocumentEnd.bind(this)),this.state=this.parseBlockNode.bind(this),c)},l.prototype.parseDocumentStart=function(){var b,c,d,e,f,k;while(this.checkToken(h.DocumentEndToken))this.getToken();if(this.checkToken(h.StreamEndToken)){b=this.getToken(),c=new i.StreamEndEvent(b.startMark,b.endMark);if(this.states&&this.states.length)throw new g.YAMLError("States supposed to be empty");if(this.marks&&this.marks.length)throw new g.YAMLError("Marks supposed to be empty");return this.state=null,c}b=this.peekToken(),f=b.startMark,k=this.processDirectives(),d=k.shift(),e=k.shift();if(!this.checkToken(h.DocumentStartToken))throw new j(null,null,"expected '<document start>', but found "+this.peekToken().constructor.id,this.peekToken().startMark);return b=this.getToken(),c=new i.DocumentStartEvent(f,b.endMark,!0,d,e),this.states.push(this.parseDocumentEnd.bind(this)),this.state=this.parseDocumentContent.bind(this),c},l.prototype.parseDocumentEnd=function(){var b,c,d,e,f;return b=this.peekToken(),e=f=b.startMark,d=!1,this.checkToken(h.DocumentEndToken)&&(b=this.getToken(),f=b.endMark,d=!0),c=new i.DocumentEndEvent(e,f,d),this.state=this.parseDocumentStart.bind(this),c},l.prototype.parseDocumentContent=function(){var b;return this.checkToken(h.DirectiveToken,h.DocumentStartToken,h.DocumentEndToken,h.StreamEndToken)?(b=this.processEmptyScalar(this.peekToken().startMark),this.state=this.states.pop(),b):this.parseBlockNode()},l.prototype.processDirectives=function(){var b,c,d,e;this.yamlVersion=null,this.tagHandles={};while(this.checkToken(h.DirectiveToken)){b=this.getToken();if("YAML"===b.name){if(null!==this.yamlVersion)throw new j(null,null,"found duplicate YAML directive",b.startMark);if(1!==+b.value[0])throw new j(null,null,"found incompatible YAML document (version 1.* is required)",b.startMark);this.yamlVersion=b.value}else if("TAG"===b.name){c=b.value[0],d=b.value[1];if(undefined!==this.tagHandles[c])throw new j(null,null,"duplicate tag handle "+c,b.startMark);this.tagHandles[c]=d}}return Object.getOwnPropertyNames(this.tagHandles).length?(e=[this.yamlVersion,{}],Object.getOwnPropertyNames(this.tagHandles).forEach(function(a){e[1][a]=this.tagHandles[a]}.bind(this))):e=[this.yamlVersion,null],Object.getOwnPropertyNames(k).forEach(function(a){undefined===this.tagHandles[a]&&(this.tagHandles[a]=k[a])}.bind(this)),e},l.prototype.parseBlockNode=function(){return this.parseNode(!0)},l.prototype.parseFlowNode=function(){return this.parseNode()},l.prototype.parseBlockNodeOrIndentlessSequence=function(){return this.parseNode(!0,!0)},l.prototype.parseNode=function(b,c){var d,e,f=null,g=null,k=null,l,m,n=null,o=null,p,q;b=b||!1,c=c||!1;if(this.checkToken(h.AliasToken))d=this.getToken(),e=new i.AliasEvent(d.value,d.startMark,d.endMark),this.state=this.states.pop();else{f=null,g=null,k=l=m=null,this.checkToken(h.AnchorToken)?(d=this.getToken(),k=d.startMark,l=d.endMark,f=d.value,this.checkToken(h.TagToken)&&(d=this.getToken(),m=d.startMark,l=d.endMark,g=d.value)):this.checkToken(h.TagToken)&&(d=this.getToken(),k=m=d.startMark,l=d.endMark,g=d.value,this.checkToken(h.AnchorToken)&&(d=this.getToken(),l=d.endMark,f=d.value));if(null!==g){n=g[0],o=g[1];if(null===n)g=o;else{if(undefined===this.tagHandles[n])throw new j("while parsing a node",k,"found undefined tag handle "+n,m);g=this.tagHandles[n]+o}}null===k&&(k=l=this.peekToken().startMark),e=null,p=null===g||"!"===g;if(c&&this.checkToken(h.BlockEntryToken))l=this.peekToken().endMark,e=new i.SequenceStartEvent(f,g,p,k,l),this.state=this.parseIndentlessSequenceEntry.bind(this);else if(this.checkToken(h.ScalarToken))d=this.getToken(),l=d.endMark,d.plain&&null===g||"!"===g?p=[!0,!1]:null===g?p=[!1,!0]:p=[!1,!1],e=new i.ScalarEvent(f,g,p,d.value,k,l,d.style),this.state=this.states.pop();else if(this.checkToken(h.FlowSequenceStartToken))l=this.peekToken().endMark,e=new i.SequenceStartEvent(f,g,p,k,l,!0),this.state=this.parseFlowSequenceFirstEntry.bind(this);else if(this.checkToken(h.FlowMappingStartToken))l=this.peekToken().endMark,e=new i.MappingStartEvent(f,g,p,k,l,!0),this.state=this.parseFlowMappingFirstKey.bind(this);else if(b&&this.checkToken(h.BlockSequenceStartToken))l=this.peekToken().startMark,e=new i.SequenceStartEvent(f,g,p,k,l,!1),this.state=this.parseBlockSequenceFirstEntry.bind(this);else if(b&&this.checkToken(h.BlockMappingStartToken))l=this.peekToken().startMark,e=new i.MappingStartEvent(f,g,p,k,l,!1),this.state=this.parseBlockMappingFirstKey.bind(this);else{if(null===f&&null===g)throw q=b?"block":"flow",d=this.peekToken(),new j("while parsing a "+q+" node",k,"expected the node content, but found "+d.constructor.id,d.startMark);e=new i.ScalarEvent(f,g,[p,!1],"",k,l),this.state=this.states.pop()}}return e},l.prototype.parseBlockSequenceFirstEntry=function(){var b=this.getToken();return this.marks.push(b.startMark),this.parseBlockSequenceEntry()},l.prototype.parseBlockSequenceEntry=function(){var b,c;if(this.checkToken(h.BlockEntryToken))return b=this.getToken(),this.checkToken(h.BlockEntryToken,h.BlockEndToken)?(this.state=this.parseBlockSequenceEntry.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseBlockSequenceEntry.bind(this)),this.parseBlockNode());if(!this.checkToken(h.BlockEndToken))throw b=this.peekToken(),new j("while parsing a block collection",this.marks[this.marks.length-1],"expected <block end>, but found "+b.constructor.id,b.startMark);return b=this.getToken(),c=new i.SequenceEndEvent(b.startMark,b.endMark),this.state=this.states.pop(),this.marks.pop(),c},l.prototype.parseIndentlessSequenceEntry=function(){var b,c;return this.checkToken(h.BlockEntryToken)?(b=this.getToken(),this.checkToken(h.BlockEntryToken,h.KeyToken,h.ValueToken,h.BlockEndToken)?(this.state=this.parseIndentlessSequenceEntry.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseIndentlessSequenceEntry.bind(this)),this.parseBlockNode())):(b=this.peekToken(),c=new i.SequenceEndEvent(b.startMark,b.startMark),this.state=this.states.pop(),c)},l.prototype.parseBlockMappingFirstKey=function(){var b=this.getToken();return this.marks.push(b.startMark),this.parseBlockMappingKey()},l.prototype.parseBlockMappingKey=function(){var b,c;if(this.checkToken(h.KeyToken))return b=this.getToken(),this.checkToken(h.KeyToken,h.ValueToken,h.BlockEndToken)?(this.state=this.parseBlockMappingValue.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseBlockMappingValue.bind(this)),this.parseBlockNodeOrIndentlessSequence());if(!this.checkToken(h.BlockEndToken))throw b=this.peekToken(),new j("while parsing a block mapping",this.marks[this.marks.length-1],"expected <block end>, but found "+b.constructor.id,b.startMark);return b=this.getToken(),c=new i.MappingEndEvent(b.startMark,b.endMark),this.state=this.states.pop(),this.marks.pop(),c},l.prototype.parseBlockMappingValue=function(){var b,c;return this.checkToken(h.ValueToken)?(b=this.getToken(),this.checkToken(h.KeyToken,h.ValueToken,h.BlockEndToken)?(this.state=this.parseBlockMappingKey.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseBlockMappingKey.bind(this)),this.parseBlockNodeOrIndentlessSequence())):(this.state=this.parseBlockMappingKey.bind(this),b=this.peekToken(),this.processEmptyScalar(b.startMark))},l.prototype.parseFlowSequenceFirstEntry=function(){var b=this.getToken();return this.marks.push(b.startMark),this.parseFlowSequenceEntry(!0)},l.prototype.parseFlowSequenceEntry=function(b){var c,d;b=b||!1;if(!this.checkToken(h.FlowSequenceEndToken)){if(!b){if(!this.checkToken(h.FlowEntryToken))throw c=this.peekToken(),new j("while parsing a flow sequence",this.marks[this.marks.length-1],"expected ',' or ']', but got "+c.constructor.id,c.startMark);this.getToken()}if(this.checkToken(h.KeyToken))return c=this.peekToken(),d=new i.MappingStartEvent(null,null,!0,c.startMark,c.endMark,!0),this.state=this.parseFlowSequenceEntryMappingKey.bind(this),d;if(!this.checkToken(h.FlowSequenceEndToken))return this.states.push(this.parseFlowSequenceEntry.bind(this)),this.parseFlowNode()}return c=this.getToken(),d=new i.SequenceEndEvent(c.startMark,c.endMark),this.state=this.states.pop(),this.marks.pop(),d},l.prototype.parseFlowSequenceEntryMappingKey=function(){var b=this.getToken();return this.checkToken(h.ValueToken,h.FlowEntryToken,h.FlowSequenceEndToken)?(this.state=this.parseFlowSequenceEntryMappingValue.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseFlowSequenceEntryMappingValue.bind(this)),this.parseFlowNode())},l.prototype.parseFlowSequenceEntryMappingValue=function(){var b;return this.checkToken(h.ValueToken)?(b=this.getToken(),this.checkToken(h.FlowEntryToken,h.FlowSequenceEndToken)?(this.state=this.parseFlowSequenceEntryMappingEnd.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseFlowSequenceEntryMappingEnd.bind(this)),this.parseFlowNode())):(this.state=this.parseFlowSequenceEntryMappingEnd.bind(this),b=this.peekToken(),this.processEmptyScalar(b.startMark))},l.prototype.parseFlowSequenceEntryMappingEnd=function(){var b;return this.state=this.parseFlowSequenceEntry.bind(this),b=this.peekToken(),new i.MappingEndEvent(b.startMark,b.startMark)},l.prototype.parseFlowMappingFirstKey=function(){var b=this.getToken();return this.marks.push(b.startMark),this.parseFlowMappingKey(!0)},l.prototype.parseFlowMappingKey=function(b){var c,d;b=b||!1;if(!this.checkToken(h.FlowMappingEndToken)){if(!b){if(!this.checkToken(h.FlowEntryToken))throw c=this.peekToken(),new j("while parsing a flow mapping",this.marks[this.marks.length-1],"expected ',' or '}', but got "+c.constructor.id,c.startMark);this.getToken()}if(this.checkToken(h.KeyToken))return c=this.getToken(),this.checkToken(h.ValueToken,h.FlowEntryToken,h.FlowMappingEndToken)?(this.state=this.parseFlowMappingValue.bind(this),this.processEmptyScalar(c.endMark)):(this.states.push(this.parseFlowMappingValue.bind(this)),this.parseFlowNode());if(!this.checkToken(h.FlowMappingEndToken))return this.states.push(this.parseFlowMappingEmptyValue.bind(this)),this.parseFlowNode()}return c=this.getToken(),d=new i.MappingEndEvent(c.startMark,c.endMark),this.state=this.states.pop(),this.marks.pop(),d},l.prototype.parseFlowMappingValue=function(){var b;return this.checkToken(h.ValueToken)?(b=this.getToken(),this.checkToken(h.FlowEntryToken,h.FlowMappingEndToken)?(this.state=this.parseFlowMappingKey.bind(this),this.processEmptyScalar(b.endMark)):(this.states.push(this.parseFlowMappingKey.bind(this)),this.parseFlowNode())):(this.state=this.parseFlowMappingKey.bind(this),b=this.peekToken(),this.processEmptyScalar(b.startMark))},l.prototype.parseFlowMappingEmptyValue=function(){return this.state=this.parseFlowMappingKey.bind(this),this.processEmptyScalar(this.peekToken().startMark)},l.prototype.processEmptyScalar=function(b){return new i.ScalarEvent(null,null,[!0,!1],"",b,b)},b.exports.Parser=l}),a.define("/lib/js-yaml/events.js",function(a,b,c,d,e){function h(a,b){this.startMark=a||null,this.endMark=b||null}function i(a,b,c){h.call(this,b,c),this.anchor=a}function j(a,b,c,d,e,f){i.call(this,a,d,e),this.tag=b,this.implicit=c,this.flowStyle=f||null}function k(){h.apply(this,arguments)}function l(a,b,c){h.call(this,a,b),this.encoding=c||null}function m(){h.apply(this,arguments)}function n(a,b,c,d,e){h.call(this,a,b),this.explicit=c||null,this.version=d||null,this.tags=e||null}function o(a,b,c){h.call(this,a,b),this.explicit=c||null}function p(){i.apply(this,arguments)}function q(a,b,c,d,e,f,g){i.call(this,a,e,f),this.tag=b,this.implicit=c,this.value=d,this.style=g||null}function r(){j.apply(this,arguments)}function s(){k.apply(this,arguments)}function t(){j.apply(this,arguments)}function u(){k.apply(this,arguments)}"use strict";var f=a("./common"),g=["anchor","tag","implicit","value"];h.prototype.hash=h.prototype.toString=function v(){var a=this,b=[];return Object.getOwnPropertyNames(this).forEach(function(c){0<=g.indexOf(c)&&b.push(c+"="+a[c])}),this.constructor.name+"("+b.join(", ")+")"},f.inherits(i,h),f.inherits(j,i),f.inherits(k,h),f.inherits(l,h),f.inherits(m,h),f.inherits(n,h),f.inherits(o,h),f.inherits(p,i),f.inherits(q,i),f.inherits(r,j),f.inherits(s,k),f.inherits(t,j),f.inherits(u,k),b.exports.NodeEvent=i,b.exports.CollectionStartEvent=j,b.exports.CollectionEndEvent=k,b.exports.StreamStartEvent=l,b.exports.StreamEndEvent=m,b.exports.DocumentStartEvent=n,b.exports.DocumentEndEvent=o,b.exports.AliasEvent=p,b.exports.ScalarEvent=q,b.exports.SequenceStartEvent=r,b.exports.SequenceEndEvent=s,b.exports.MappingStartEvent=t,b.exports.MappingEndEvent=u}),a.define("/lib/js-yaml/composer.js",function(a,b,c,d,e){function j(){i.MarkedYAMLError.apply(this,arguments),this.name="ComposerError"}function k(){this.anchors={}}"use strict";var f=a("./common"),g=a("./nodes"),h=a("./events"),i=a("./errors");f.inherits(j,i.MarkedYAMLError),k.prototype.checkNode=function(){return this.checkEvent(h.StreamStartEvent)&&this.getEvent(),!this.checkEvent(h.StreamEndEvent)},k.prototype.getNode=function(){return this.checkEvent(h.StreamEndEvent)?null:this.composeDocument()},k.prototype.getSingleNode=function(){var b=null;this.getEvent(),this.checkEvent(h.StreamEndEvent)||(b=this.composeDocument());if(!this.checkEvent(h.StreamEndEvent))throw new j("expected a single document in the stream",b.startMark,"but found another document",this.getEvent().startMark);return this.getEvent(),b},k.prototype.composeDocument=function(){var b;return this.getEvent(),b=this.composeNode(null,null),this.getEvent(),this.anchors={},b},k.prototype.composeNode=function(b,c){var d=null,e,f;if(this.checkEvent(h.AliasEvent)){e=this.getEvent(),f=e.anchor;if(undefined===this.anchors[f])throw new j(null,null,"found undefined alias "+f,e.startMark);return this.anchors[f]}e=this.peekEvent(),f=e.anchor;if(null!==f&&undefined!==this.anchors[f])throw new j("found duplicate anchor "+f+"; first occurence",this.anchors[f].startMark,"second occurence",e.startMark);return this.checkEvent(h.ScalarEvent)?d=this.composeScalarNode(f):this.checkEvent(h.SequenceStartEvent)?d=this.composeSequenceNode(f):this.checkEvent(h.MappingStartEvent)&&(d=this.composeMappingNode(f)),d},k.prototype.composeScalarNode=function(b){var c,d,e;return c=this.getEvent(),d=c.tag,null===d?d=this.resolve(g.ScalarNode,c.value,c.implicit):"!"===d&&(d=this.resolve(g.ScalarNode,c.value,!1)),e=new g.ScalarNode(d,c.value,c.startMark,c.endMark,c.style),null!==b&&(this.anchors[b]=e),e},k.prototype.composeSequenceNode=function(b){var c,d,e,f,i,j;c=this.getEvent(),e=c.tag,null===e?e=this.resolve(g.SequenceNode,null,c.implicit):"!"===e&&(e=this.resolve(g.SequenceNode,null,!1)),f=new g.SequenceNode(e,[],c.startMark,null,c.flowStyle),null!==b&&(this.anchors[b]=f),i=0;while(!this.checkEvent(h.SequenceEndEvent))f.value.push(this.composeNode(f,i)),i+=1;return j=this.getEvent(),f.endMark=j.endMark,f},k.prototype.composeMappingNode=function(b){var c,d,e,f,i,j,k;c=this.getEvent(),e=c.tag,null===e?e=this.resolve(g.MappingNode,null,c.implicit):"!"===e&&(e=this.resolve(g.MappingNode,null,!1)),f=new g.MappingNode(e,[],c.startMark,null,c.flowStyle),null!==b&&(this.anchors[b]=f);while(!this.checkEvent(h.MappingEndEvent))i=this.composeNode(f,null),j=this.composeNode(f,i),f.value.push([i,j]);return k=this.getEvent(),f.endMark=k.endMark,f},b.exports.Composer=k}),a.define("/lib/js-yaml/nodes.js",function(a,b,c,d,e){function g(a,b,c,d){this.tag=a,this.value=b,this.startMark=c||null,this.endMark=d||null}function h(a,b,c,d,e){g.call(this,a,b,c,d),this.style=e||null}function i(a,b,c,d,e){g.call(this,a,b,c,d),this.flowStyle=e||null}function j(){i.apply(this,arguments)}function k(){i.apply(this,arguments)}"use strict";var f=a("./common");g.prototype.hash=g.prototype.toString=function l(){var a=this.value.toString();return this.constructor.name+"("+this.tag+", "+a+")"},f.inherits(h,g),h.id="scalar",f.inherits(i,g),f.inherits(j,i),j.id="sequence",f.inherits(k,i),k.id="mapping",b.exports.ScalarNode=h,b.exports.SequenceNode=j,b.exports.MappingNode=k}),a.define("/lib/js-yaml/resolver.js",function(a,b,c,d,e){function k(){this.resolverExactPaths=[],this.resolverPrefixPaths=[],this.yamlImplicitResolvers=k.yamlImplicitResolvers}function l(){k.apply(this,arguments),this.yamlImplicitResolvers=l.yamlImplicitResolvers}"use strict";var f=a("./common"),g=a("./nodes"),h="tag:yaml.org,2002:str",i="tag:yaml.org,2002:seq",j="tag:yaml.org,2002:map";k.yamlImplicitResolvers={},k.addImplicitResolver=function(b,c,d){var e=this;undefined===d&&(d=[null]),d.forEach(function(a){undefined===e.yamlImplicitResolvers[a]&&(e.yamlImplicitResolvers[a]=[]),e.yamlImplicitResolvers[a].push([b,c])})},k.prototype.resolve=function(b,c,d){var e,f,k,l;if(b===g.ScalarNode&&d&&d[0]){c===""?e=this.yamlImplicitResolvers[""]||[]:e=this.yamlImplicitResolvers[c[0]]||[],e=e.concat(this.yamlImplicitResolvers[null]||[]);for(f=0;f<e.length;f+=1){k=e[f][0],l=e[f][1];if(l.test(c))return k}}return b===g.ScalarNode?k=h:b===g.SequenceNode?k=i:b===g.MappingNode?k=j:k=null,k},f.inherits(l,k),l.yamlImplicitResolvers={},l.addImplicitResolver=k.addImplicitResolver,l.addImplicitResolver("tag:yaml.org,2002:bool",new RegExp("^(?:y|yes|Yes|YES|n|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$"),["y","Y","n","N","t","T","f","F","o","O"]),l.addImplicitResolver("tag:yaml.org,2002:float",new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),["-","+","0","1","2","3","4","5","6","7","8","9","."]),l.addImplicitResolver("tag:yaml.org,2002:int",new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$"),["-","+","0","1","2","3","4","5","6","7","8","9"]),l.addImplicitResolver("tag:yaml.org,2002:merge",new RegExp("^(?:<<)$"),["<"]),l.addImplicitResolver("tag:yaml.org,2002:null",new RegExp("^(?:~|null|Null|NULL|)$"),["~","n","N",""]),l.addImplicitResolver("tag:yaml.org,2002:timestamp",new RegExp("^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?(?:[Tt]|[ \\t]+)[0-9][0-9]?:[0-9][0-9]:[0-9][0-9](?:\\.[0-9]*)?(?:[ \\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$"),["0","1","2","3","4","5","6","7","8","9"]),l.addImplicitResolver("tag:yaml.org,2002:value",new RegExp("^(?:=)$"),["="]),l.addImplicitResolver("tag:yaml.org,2002:yaml",new RegExp("^(?:!|&|\\*)$"),["!","&","*"]),b.exports.BaseResolver=k,b.exports.Resolver=l}),a.define("/lib/js-yaml/constructor.js",function(a,b,c,d,e){function i(){g.MarkedYAMLError.apply(this,arguments),this.name="ConstructorError"}function l(){this.constructedObjects=new f.Hash,this.recursiveObjects=new f.Hash,this.statePopulators=[],this.deepConstruct=!1,this.yamlConstructors=l.yamlConstructors}function m(){l.apply(this),this.yamlConstructors=m.yamlConstructors}function n(){m.apply(this),this.yamlConstructors=n.yamlConstructors}"use strict";var f=a("./common"),g=a("./errors"),h=a("./nodes");f.inherits(i,g.MarkedYAMLError);var j={y:!0,yes:!0,n:!1,no:!1,"true":!0,"false":!1,on:!0,off:!1},k=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");l.yamlConstructors={},l.addConstructor=function(b,c){this.yamlConstructors[b]=c},l.prototype.checkData=function(){return this.checkNode()},l.prototype.getData=function(){if(this.checkNode())return this.constructDocument(this.getNode())},l.prototype.getSingleData=function(){var b=this.getSingleNode();return null!==b?this.constructDocument(b):null},l.prototype.constructDocument=function(b){var c=this.constructObject(b),d,e;d=function(a){a.execute()};while(!!this.statePopulators.length)e=this.statePopulators,this.statePopulators=[],e.forEach(d);return this.constructedObjects=new f.Hash,this.recursiveObjects=new f.Hash,this.deepConstruct=!1,c},l.prototype.constructObject=function(b,c){var d,e,g,h;if(this.constructedObjects.hasKey(b))return this.constructedObjects.get(b);!c||(e=this.deepConstruct,this.deepConstruct=!0);if(this.recursiveObjects.hasKey(b))throw new i(null,null,"found unconstructable recursive node",b.startMark);this.recursiveObjects.store(b,null);if(undefined!==this.yamlConstructors[b.tag])g=this.yamlConstructors[b.tag];else{if(undefined===this.yamlConstructors[null])throw new i(null,null,"can't find any constructor for tag="+b.tag,b.startMark);g=this.yamlConstructors[null]}return d=g.call(this,b),d instanceof f.Populator&&(h=d,d=h.data,this.deepConstruct?h.execute():this.statePopulators.push(h)),this.constructedObjects.store(b,d),this.recursiveObjects.remove(b),c&&(this.deepConstruct=e),d},l.prototype.constructScalar=function(b){if(!f.isInstanceOf(b,h.ScalarNode))throw new i(null,null,"expected a scalar node, but found "+b.id,b.startMark);return b.value},l.prototype.constructSequence=function(b,c){if(!f.isInstanceOf(b,h.SequenceNode))throw new i(null,null,"expected a sequence node, but found "+b.id,b.startMark);return b.value.map(function(a){return this.constructObject(a,c)},this)},l.prototype.constructMapping=function(b,c){var d;if(!f.isInstanceOf(b,h.MappingNode))throw new i(null,null,"expected a mapping node, but found "+b.id,b.startMark);return d={},f.each(b.value,function(a){var b=a[0],e=a[1],f,g;f=this.constructObject(b,c);if(undefined===b.hash)throw new i("while constructing a mapping",b.startMark,"found unhashable key",b.startMark);g=this.constructObject(e,c),d[f]=g},this),d},l.prototype.constructPairs=function(b,c){var d;if(!f.isInstanceOf(b,h.MappingNode))throw new i(null,null,"expected a mapping node, but found "+b.id,b.startMark);return d=[],f.each(b.value,function(a){var b,e;b=this.constructObject(a[0],c),e=this.constructObject(a[1],c),d.store(b,e)},this),d},f.inherits(m,l),m.yamlConstructors=f.extend({},l.yamlConstructors),m.addConstructor=l.addConstructor,m.prototype.constructScalar=function(b){var c;if(f.isInstanceOf(b,h.MappingNode)){f.each(b.value,function(a){var b=a[0],d=a[1],e;"tag:yaml.org,2002:value"===b.tag&&(c=this.constructScalar(d))},this);if(undefined!==c)return c}return l.prototype.constructScalar.call(this,b)},m.prototype.flattenMapping=function(b){var c=this,d=[],e=0,g,j,k,l,m,n;l=function(a){d.push(a)},m=function(a){a.forEach(l)},n=function(a){if(!f.isInstanceOf(a,h.MappingNode))throw new i("while constructing a mapping",b.startMark,"expected a mapping for merging, but found "+a.id,a.startMark);c.flattenMapping(a),k.push(a.value)};while(e<b.value.length){g=b.value[e][0],j=b.value[e][1];if("tag:yaml.org,2002:merge"===g.tag){b.value.splice(e,1);if(f.isInstanceOf(j,h.MappingNode))c.flattenMapping(j),f.each(j.value,l);else{if(!f.isInstanceOf(j,h.SequenceNode))throw new i("while constructing a mapping",b.startMark,"expected a mapping or list of mappings for merging, but found "+j.id,j.startMark);k=[],f.each(j.value,n),f.reverse(k).forEach(m)}}else"tag:yaml.org,2002:value"===g.tag?(g.tag="tag:yaml.org,2002:str",e+=1):e+=1}!d.length||(f.each(b.value,function(a){d.push(a)}),b.value=d)},m.prototype.constructMapping=function(b,c){return f.isInstanceOf(b,h.MappingNode)&&this.flattenMapping(b),l.prototype.constructMapping.call(this,b)},m.prototype.constructYamlNull=function(b){return this.constructScalar(b),null},m.prototype.constructYamlBool=function(b){var c=this.constructScalar(b);return j[c.toLowerCase()]},m.prototype.constructYamlInt=function(b){var c=this.constructScalar(b).replace(/_/g,""),d="-"===c[0]?-1:1,e,f=[];return 0<="+-".indexOf(c[0])&&(c=c.slice(1)),"0"===c?0:/^0b/.test(c)?d*parseInt(c.slice(2),2):/^0x/.test(c)?d*parseInt(c,16):"0"===c[0]?d*parseInt(c,8):0<=c.indexOf(":")?(c.split(":").forEach(function(a){f.unshift(parseInt(a,10))}),c=0,e=1,f.forEach(function(a){c+=a*e,e*=60}),d*c):d*parseInt(c,10)},m.prototype.constructYamlFloat=function(b){var c=this.constructScalar(b).replace(/_/g,""),d="-"===c[0]?-1:1,e,f=[];return 0<="+-".indexOf(c[0])&&(c=c.slice(1)),".inf"===c?1===d?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===c?NaN:0<=c.indexOf(":")?(c.split(":").forEach(function(a){f.unshift(parseFloat(a,10))}),c=0,e=1,f.forEach(function(a){c+=a*e,e*=60}),d*c):d*parseFloat(c,10)},m.prototype.constructYamlBinary=function(b){try{return f.decodeBase64(this.constructScalar(b))}catch(c){throw new i(null,null,"failed to decode base64 data: "+c.toString(),b.startMark)}},m.prototype.constructYamlTimestamp=function(b){var c,d,e,f,g,h,i,j=0,l=null,m,n,o;c=k.exec(this.constructScalar(b)),d=+c[1],e=+c[2]-1,f=+c[3];if(!c[4])return new Date(d,e,f);g=+c[4],h=+c[5],i=+c[6];if(!!c[7]){j=c[7].slice(0,3);while(j.length<3)j+="0";j=+j}return!c[9]||(m=+c[10],n=+(c[11]||0),l=(m*60+n)*6e4,"-"===c[9]&&(l=-l)),o=new Date(d,e,f,g,h,i,j),!l||
24
+ o.setTime(o.getTime()-l),o},m.prototype.constructYamlOmap=function(b){var c=this,d=[];return f.Populator(d,function(){if(!f.isInstanceOf(b,h.SequenceNode))throw new i("while constructing an ordered map",b.startMark,"expected a sequence, but found "+b.id,b.startMark);b.value.forEach(function(a){var e,g,j;if(!f.isInstanceOf(a,h.MappingNode))throw new i("while constructing an ordered map",b.startMark,"expected a mapping of length 1, but found "+a.id,a.startMark);if(1!==a.value.length)throw new i("while constructing an ordered map",b.startMark,"expected a single mapping item, but found "+a.value.length+" items",a.startMark);g=c.constructObject(a.value[0][0]),j=c.constructObject(a.value[0][1]),e=Object.create(null),e[g]=j,d.push(e)})})},m.prototype.constructYamlPairs=function(b){var c=this,d=[];return f.Populator(d,function(){if(!f.isInstanceOf(b,h.SequenceNode))throw new i("while constructing pairs",b.startMark,"expected a sequence, but found "+b.id,b.startMark);b.value.forEach(function(a){var e,g;if(!f.isInstanceOf(a,h.MappingNode))throw new i("while constructing pairs",b.startMark,"expected a mapping of length 1, but found "+a.id,a.startMark);if(1!==a.value.length)throw new i("while constructing pairs",b.startMark,"expected a single mapping item, but found "+a.value.length+" items",a.startMark);e=c.constructObject(a.value[0][0]),g=c.constructObject(a.value[0][1]),d.push([e,g])})})},m.prototype.constructYamlSet=function(b){var c={};return f.Populator(c,function(){f.extend(c,this.constructMapping(b))},this)},m.prototype.constructYamlStr=function(b){return this.constructScalar(b)},m.prototype.constructYamlSeq=function(b){var c=[];return f.Populator(c,function(){this.constructSequence(b).forEach(function(a){c.push(a)})},this)},m.prototype.constructYamlMap=function(b){var c={};return f.Populator(c,function(){f.extend(c,this.constructMapping(b,!0))},this)},m.prototype.constructUndefined=function(b){throw new i(null,null,"could not determine constructor for the tag "+b.tag,b.startMark)},m.addConstructor("tag:yaml.org,2002:null",m.prototype.constructYamlNull),m.addConstructor("tag:yaml.org,2002:bool",m.prototype.constructYamlBool),m.addConstructor("tag:yaml.org,2002:int",m.prototype.constructYamlInt),m.addConstructor("tag:yaml.org,2002:float",m.prototype.constructYamlFloat),m.addConstructor("tag:yaml.org,2002:binary",m.prototype.constructYamlBinary),m.addConstructor("tag:yaml.org,2002:timestamp",m.prototype.constructYamlTimestamp),m.addConstructor("tag:yaml.org,2002:omap",m.prototype.constructYamlOmap),m.addConstructor("tag:yaml.org,2002:pairs",m.prototype.constructYamlPairs),m.addConstructor("tag:yaml.org,2002:set",m.prototype.constructYamlSet),m.addConstructor("tag:yaml.org,2002:str",m.prototype.constructYamlStr),m.addConstructor("tag:yaml.org,2002:seq",m.prototype.constructYamlSeq),m.addConstructor("tag:yaml.org,2002:map",m.prototype.constructYamlMap),m.addConstructor(null,m.prototype.constructUndefined),f.inherits(n,m),n.yamlConstructors=f.extend({},m.yamlConstructors),n.addConstructor=m.addConstructor,n.prototype.constructJavascriptRegExp=function(b){var c=this.constructScalar(b),d=/\/([gim]*)$/.exec(c),e;return"/"===c[0]&&!!d&&4>=d[0].length&&(c=c.slice(1,c.length-d[0].length),e=d[1]),new RegExp(c,e)},n.prototype.constructJavascriptUndefined=function(b){var c;return c},n.prototype.constructJavascriptFunction=function(b){var c=new Function("return "+this.constructScalar(b));return c()},n.addConstructor("tag:yaml.org,2002:js/undefined",n.prototype.constructJavascriptUndefined),n.addConstructor("tag:yaml.org,2002:js/regexp",n.prototype.constructJavascriptRegExp),n.addConstructor("tag:yaml.org,2002:js/function",n.prototype.constructJavascriptFunction),b.exports.BaseConstructor=l,b.exports.SafeConstructor=m,b.exports.Constructor=n}),a.define("/index.js",function(a,b,c,d,e){b.exports=a("./lib/js-yaml.js")}),a("/index.js"),a("/lib/js-yaml")}();return a}();
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  # meta
3
3
  s.name = 'sequenceserver'
4
- s.version = '0.7.9'
4
+ s.version = '0.8.0'
5
5
  s.authors = ['Anurag Priyam', 'Ben J Woodcroft', 'Yannick Wurm']
6
6
  s.email = 'anurag08priyam@gmail.com'
7
7
  s.homepage = 'http://sequenceserver.com'
8
8
  s.license = 'SequenceServer (custom)'
9
9
 
10
- s.summary = 'iPod of BLAST searching'
10
+ s.summary = 'BLAST search made easy!'
11
11
  s.description = <<DESC
12
12
  SequenceServer lets you rapidly set up a BLAST+ server with an intuitive user interface for use locally or over the web.
13
13
  DESC
@@ -17,6 +17,9 @@ DESC
17
17
  s.add_dependency('sinatra', '>= 1.2.0')
18
18
  s.add_dependency('ptools')
19
19
 
20
+ s.add_development_dependency('minitest')
21
+ s.add_development_dependency('rack-test')
22
+
20
23
  # gem
21
24
  s.files = Dir['lib/**/*'] + Dir['views/**/*'] + Dir['public/**/*'] + Dir['tests/**/*']
22
25
  s.files = s.files + ['config.ru', 'example.config.yml']
data/tests/run ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+ # Usage:
3
+ #
4
+ # run all test suites
5
+ #
6
+ # $ tests/run
7
+ #
8
+ # run a particular test suite
9
+ #
10
+ # $ tests/run tests/test_sequencehelpers.rb
11
+ #
12
+
13
+ # script dir
14
+ dir = File.dirname(__FILE__)
15
+
16
+ # setup load path
17
+ require 'rubygems'
18
+ $LOAD_PATH.unshift(File.join(dir, '..', 'lib'))
19
+
20
+ # user specified or glob all?
21
+ files = ARGV.empty? ? Dir[File.join(dir, 'test_*.rb')] : ARGV
22
+
23
+ # run!
24
+ files.each do |file|
25
+ require File.expand_path(file)
26
+ end
@@ -1,15 +1,7 @@
1
- #!/usr/bin/env ruby
2
- # test_ssequencehelpers.rb
3
-
4
- # ensure 'lib/' is in the load path
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
-
7
1
  require 'sequenceserver'
8
2
  require 'sequenceserver/sequencehelpers'
9
3
  require 'test/unit'
10
4
 
11
-
12
-
13
5
  class Tester < Test::Unit::TestCase
14
6
  include SequenceServer::SequenceHelpers
15
7
  def test_guess_sequence_type_nucleotide
@@ -51,12 +43,6 @@ class Tester < Test::Unit::TestCase
51
43
  assert_raise(ArgumentError, 'mixed aa and nt should raise') { type_of_sequences(aa_nt_mix) }
52
44
  end
53
45
 
54
- def test_sequence_type_to_blast_methods
55
- assert_equal ['blastp', 'tblastn'], blast_methods_for(:protein), 'blasts_for_protein'
56
- assert_equal ['blastn','tblastx','blastx'], blast_methods_for(:nucleotide), 'blasts_for_nucleotide'
57
- assert_equal ['blastp', 'tblastn','blastn','tblastx','blastx'], blast_methods_for(nil), 'blasts_for_nil'
58
- end
59
-
60
46
  def test_composition
61
47
  expected_comp = {"a"=>2, "d"=>3, "f"=>7, "s"=>3, "A"=>1}
62
48
  assert_equal(expected_comp, composition('asdfasdfffffAsdf'))
@@ -71,10 +57,7 @@ end
71
57
 
72
58
  class AppTester < Test::Unit::TestCase
73
59
  def test_process_advanced_blast_options
74
- # dirty hack, required to work around Sinatra's overriden `new` method that
75
- # may return instance of any Rack class
76
- app = SequenceServer::App.allocate
77
- app.send(:initialize)
60
+ app = SequenceServer::App.new!
78
61
 
79
62
  assert_nothing_raised {app.validate_advanced_parameters('')}
80
63
  assert_nothing_raised {app.validate_advanced_parameters('-word_size 5')}
@@ -83,3 +66,12 @@ class AppTester < Test::Unit::TestCase
83
66
  end
84
67
  end
85
68
 
69
+ class SystemHelpersTester < Test::Unit::TestCase
70
+ include SequenceServer::Helpers::SystemHelpers
71
+
72
+ def test_multipart_database_name?
73
+ assert_equal true, multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/nr.00')
74
+ assert_equal false, multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/nr')
75
+ assert_equal true, multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/img3.5.finished.faa.01')
76
+ end
77
+ end
@@ -0,0 +1,60 @@
1
+ require 'sequenceserver'
2
+ require 'minitest/spec'
3
+ require 'minitest/autorun'
4
+ require 'rack/test'
5
+
6
+ ENV['RACK_ENV'] = 'test'
7
+
8
+ module SequenceServer
9
+ describe "App" do
10
+ include Rack::Test::Methods
11
+
12
+ def app
13
+ App
14
+ end
15
+
16
+ def setup
17
+ @params = {'method' => 'blastn', 'sequence' => 'AGCTAGCTAGCT', 'databases' => ['123']}
18
+ end
19
+
20
+ it 'returns Bad Request (400) if no blast method is provided' do
21
+ @params.delete('method')
22
+ post '/', @params
23
+ last_response.status.must_equal 400
24
+ end
25
+
26
+ it 'returns Bad Request (400) if no input sequence is provided' do
27
+ @params.delete('sequence')
28
+ post '/', @params
29
+ last_response.status.must_equal 400
30
+ end
31
+
32
+ it 'returns Bad Request (400) if no database id is provided' do
33
+ @params.delete('databases')
34
+ post '/', @params
35
+ last_response.status.must_equal 400
36
+ end
37
+
38
+ it 'returns Bad Request (400) if an empty database list is provided' do
39
+ @params['databases'].pop
40
+
41
+ # ensure the list of databases is empty
42
+ @params['databases'].length.must_equal 0
43
+
44
+ post '/', @params
45
+ last_response.status.must_equal 400
46
+ end
47
+
48
+ it 'returns Bad Request (400) if an incorrect blast method is supplied' do
49
+ @params['method'] = 'foo'
50
+ post '/', @params
51
+ last_response.status.must_equal 400
52
+ end
53
+
54
+ it 'returns Bad Request (400) if incorrect advanced params are supplied' do
55
+ @params['advanced'] = '-word_size 5; rm -rf /'
56
+ post '/', @params
57
+ last_response.status.must_equal 400
58
+ end
59
+ end
60
+ end