mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
1647 lines
328 KiB
JavaScript
1647 lines
328 KiB
JavaScript
|
// Generated by LiveScript 1.6.1
|
||
|
// LiveScript 1.6.1
|
||
|
// Copyright (c) Jeremy Ashkenas, Satoshi Murakami, George Zahariev
|
||
|
// Released under the MIT License
|
||
|
// https://raw.githubusercontent.com/gkz/LiveScript/master/LICENSE
|
||
|
require=function(){function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}return e}()({1:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g,m,y,v,b,w,k,L,A,E,C,S,R,N,_,T,I,x,O,M,P,B,$,U,D,j,F,W,Y,z,G,H,J,q,K,V,X,Z,Q,ee,te,ne,ie,re,se,oe,ae,ue,le,ce,he,fe,pe,de,ge=[].slice,me=Array.from||function(e){return ge.call(e)},ye={}.toString;i=e("prelude-ls").fold;r=e("./util"),s=r.nameFromPath,o=r.stripString;r=e("source-map"),a=r.SourceNode,u=r.SourceMapGenerator;l=function(e){var t,n,i,r,s,o;e==null&&(e={});n=[];for(i=1,r=arguments.length;i<r;++i){n.push(arguments[i])}t=n;try{s=new a(e.line,e.column,null,t);s.displayName=e.constructor.displayName;return s}catch(u){o=u;console.dir(t);throw o}};c=function(e){var t,n,i,r;if(e instanceof a){for(t=0,i=(n=e.children).length;t<i;++t){r=n[t];if(!c(r)){return false}}return true}else{return!e}};h=function(e){if(e instanceof a){return e}else{return e.toString()}};f=function(e,t){var n,i,r,s;for(n=0,i=e.children.length;n<i;++n){r=n;s=e.children[r];if(s instanceof a){t=f(s,t)}else{s=s.toString();e.children[r]=s.slice(t);t-=s.length}if(t<=0){return 0}}return t};a.prototype.replace=function(){var e,t,n,i;t=[];for(n=0,i=arguments.length;n<i;++n){t.push(arguments[n])}e=t;return new a(this.line,this.column,this.source,function(){var t,n,i,r,s=[];for(t=0,r=(i=this.children).length;t<r;++t){n=i[t];s.push(n.replace.apply(n,e))}return s}.call(this),this.name)};a.prototype.setFile=function(e){var t,n,i,r,s=[];this.source=e;for(t=0,i=(n=this.children).length;t<i;++t){r=n[t];if(r instanceof a){s.push(r.setFile(e))}}return s};a.prototype.toStringWithSourceMap=function(){var e,t,n,i,r,s,o,l,c,h,f,p,d;t=[];for(n=0,i=arguments.length;n<i;++n){t.push(arguments[n])}e=t;r=function(e,t,n){n.prototype=e.prototype;var i=new n,r=e.apply(i,t),s;return(s=typeof r)=="object"||s=="function"?r||i:i}(u,e,function(){});s=1;o=0;l=[];c="";h="";f="";p=" ";d=function(e){var t,n,i,u,g,m,y,v,b,w=[];if(e instanceof a){h+=f+e.displayName;t=e.line&&"column"in e;if(t){l.push(e);h+="!"}h+=" "+e.line+":"+e.column+" "+s+":"+o+"\n";f+=p;for(n=0,u=(i=e.children).length;n<u;++n){g=i[n];d(g)}f=f.slice(0,f.length-p.length);if(t){return l.pop()}}else{h+=f+""+JSON.stringify(e)+"\n";c+=e;m=l[l.length-1];if(m){r.addMapping({source:m.source,original:{line:m.line,column:m.column},generated:{line:s,column:o},name:m.name})}for(n=0,y=e.length;n<y;++n){v=n;b=e.charAt(v);if(b==="\n"){o=0;++s;if(m){w.push(r.addMapping({source:m.source,original:{line:m.line,column:m.column},generated:{line:s,column:o},name:m.name}))}}else{w.push(++o)}}return w}};d(this);return{code:c,map:r,debug:h}};/* # Use this to track down places where a SourceNode is being converted into a string and causing the location to be lost
|
||
|
tmp-to-string = SourceNode::to-string
|
||
|
SourceNode::to-string = (...args) ->
|
||
|
console.log("toString(): ", new Error().stack)
|
||
|
tmp-to-string.apply this, args
|
||
|
*/
|
||
|
(p=function(){throw Error("unimplemented")}).prototype={compile:function(e,t){var n,i,r,s,o,a;n=Ce({},e);if(t!=null){n.level=t}if(n.level&&this.isStatement()){return this.compileClosure(n)}i=(this.tab=n.indent,this).compileNode(n);if(r=this.temps){for(s=0,o=r.length;s<o;++s){a=r[s];n.scope.free(a)}}return i},compileClosure:function(e){var t,n,i,r,s,o;if(t=this.getJump()){t.carp("inconvertible statement")}n=P([],g(this));i=A();if(e.inAsync){n.async=true}if(e.inGenerator){n.generator=true}this.traverseChildren(function(e){switch(e.value){case"this":s=true;break;case"arguments":r=e.value="args$"}});if(s){i.args.push(y("this"));i.method=".call"}if(r){i.args.push(y("arguments"));n.params.push(v("args$"))}o=U(L((n.wrapper=true,n["void"]=this["void"],n),[i]),true);if(e.inGenerator){o=new N("yieldfrom",o)}else if(e.inAsync){o=new N("await",o)}return o.compile(e)},compileBlock:function(e,t){var n;if(!c(n=t!=null?t.compile(e,se):void 8)){return l(null,"{\n",n,"\n"+this.tab+"}")}else{return l(t,"{}")}},compileSpreadOver:function(e,t,n){var i,r,s,o,a,u,l,c,h;i=t instanceof C;r=t.items;for(s=0,o=r.length;s<o;++s){a=s;u=r[s];if(l=u instanceof D){u=u.it}if(i&&!l){u=u.val}u=n(u);if(l){u=c=D(u)}if(i&&!l){r[a].val=u}else{r[a]=u}}if(!c&&(this["void"]||!e.level)){t=(h=g(i?function(){var e,t,n,i,s=[];for(e=0,i=(n=r).length;e<i;++e){t=n[e];s.push(t.val)}return s}():r),h.front=this.front,h["void"]=true,h)}return t.compile(e,oe)},cache:function(e,t,n,i){var r,s,o,a;if(!this.isComplex()){return[r=n!=null?this.compile(e,n):this,r]}if(s=this.getRef()){o=this}else{o=I(s=v(e.scope.temporary(i)),this);if(t){s.temp=true}else{a=[s.value]}}if(n!=null){o=o.compile(e,n);if(t&&a){e.scope.free(s.value)}return[o,s.value]}return[o,s,a]},compileLoopReference:function(e,t,n,i){var r,s,o,a;if(this instanceof v&&e.scope.check(this.value)||this instanceof _&&((r=this.op)==="+"||r==="-")&&(-1/0<(r=+this.it.value)&&r<1/0)||this instanceof y&&!this.isComplex()){s=this.compile(e,oe);if(i&&!(this instanceof v)){s="("+s+")"}return[s,s]}o=I(v(a=e.scope.temporary(t)),this);n||(o["void"]=true);return[a,o.compile(e,n?ce:oe)]},eachChild:function(e){var t,n,i,r,s,o,a,u,l,c;for(t=0,i=(n=this.children).length;t<i;++t){r=n[t];if(s=this[r]){if("length"in s){for(o=0,a=s.length;o<a;++o){u=o;l=s[o];if(c=e(l,r,u)){return c}}}else{if((c=e(s,r))!=null){return c}}}}},traverseChildren:function(e,t){var n=this;return this.eachChild(function(i,r,s){var o;return(o=e(i,n,r,s))!=null?o:i.traverseChildren(e,t)})},rewriteShorthand:function(e,t){var n,i,r,s,o,a,u,l,c,h;for(n=0,r=(i=this.children).length;n<r;++n){s=i[n];if(o=this[s]){if("length"in o){for(a=0,u=o.length;a<u;++a){l=a;c=o[a];if(h=c.rewriteShorthand(e,t)){o[l]=h}}}else if(h=o.rewriteShorthand(e,t)){this[s]=h}}}},anaphorize:function(){var e,t,n;this.children=this.aTargets;if(this.eachChild(i)){if((e=this)[t=this.aSource]instanceof M){e[t].doAnaphorize=true}else if(e[t].value!=="that"){e[t]=I(v("that"),e[t])}}function i(e){var t;return e.value==="that"||((t=e.aSource)?(t=e[t])?i(t):void 8:e.eachChild(i))}delete this.children;return n=this[this.aSource],n.cond=true,n},carp:function(e,t){t==null&&(t=SyntaxError);throw t(e+" "+this.lineMsg())},warn:function(e){if(typeof console!="undefined"&&console!==null){console.warn("WARNING: "+e+" "+this.lineMsg())}},lineMsg:function(){return"on line "+(this.line||this.traverseChildren(function(e){return e.line}))},delegate:function(e,t){var n,i;for(n=0,i=e.length;n<i;++n){r.call(this,e[n])}function r(e){this[e]=function(n){return t.call(this,e,n)}}},children:[],terminator:";",isComplex:be,isStatement:we,isAssignable:we,isCallable:we,isEmpty:we,isArray:we,isString:we,isRegex:we,isMatcher:function(){return this.isString()||this.isRegex()},assigns:we,ripName:Le,getRef:Le,unfoldSoak:Le,unfoldAssign:Le,unparen:ke,unwrap:ke,maybeKey:Le,varName:String,getAccessors:Le,getCall:Le,getDefault:Le,getJump:Le,isNextUnreachable:we,extractKeyRef:function(e,t){return this.maybeKey()||this.carp(t?"invalid assign":"invalid property shorthand")},invert:function(){return _("!",this,true)},invertCheck:function(e){if(e.i
|
||
|
// fallthrough
|
||
|
case"null":if(t===ce){this.carp("invalid use of "+this.value)}break;case"on":case"yes":n="true";break;case"off":case"no":n="false";break;case"*":this.carp("stray star");break;case"..":if(!(n=e.ref)){this.carp("stray reference")}this.cascadee||(n.erred=true);break;case"debugger":if(t){return l(this,"(function(){ debugger; }())")}}return l(this,h(n))};return i}(m);n.Var=v=function(e){var t=Re((Ce(i,e).displayName="Var",i),e).prototype,n=i;function i(e){var t=this instanceof r?this:new r;t.value=e;return t}function r(){}r.prototype=t;t.isAssignable=t.isCallable=be;i.prototype.assigns=function(){return[this.value]};i.prototype.maybeKey=function(){var e;return e=b(this.value),e.line=this.line,e};i.prototype.varName=t.show;i.prototype.compile=function(e){return l(this,this.temp?e.scope.free(this.value):this.value)};return i}(m);n.Key=b=function(e){var t=Re((Ce(i,e).displayName="Key",i),e).prototype,n=i;function i(e,t){var n=this instanceof r?this:new r;n.reserved=t||e.reserved;n.name=""+e;return n}function r(){}r.prototype=t;i.prototype.isComplex=we;i.prototype.assigns=function(){return[this.name]};i.prototype.maybeKey=ke;i.prototype.varName=function(){var e;e=this.name;if(this.reserved||(e==="arguments"||e==="eval")){return"$"+e}else{return e}};i.prototype.show=function(){if(this.reserved){return"'"+this.name+"'"}else{return this.name}};i.prototype.compile=function(){return l(this,this.show())};return i}(p);n.Index=w=function(e){var t=Re((Ce(i,e).displayName="Index",i),e).prototype,n=i;function i(e,t,n){var i,s=this instanceof r?this:new r;t||(t=".");if(n&&e instanceof R){switch(e.items.length){case 1:if(!((i=e.items[0])instanceof D)){e=U(i)}}}switch(t){case"[]":s.vivify=R;break;case"{}":s.vivify=C;break;default:if("="===t.slice(-1)){s.assign=t.slice(1)}}s.key=e;s.symbol=t;return s}function r(){}r.prototype=t;i.prototype.children=["key"];i.prototype.show=function(){return[this.soak?"?":void 8]+this.symbol};i.prototype.isComplex=function(){return this.key.isComplex()||this.vivify!=null};i.prototype.varName=function(){var e;return((e=this.key)instanceof b||e instanceof y)&&this.key.varName()};i.prototype.compile=function(e){var t;t=this.key.compile(e,oe);if(this.key instanceof b&&"'"!==t.toString().charAt(0)){return l(this,".",t)}else{return l(this,"[",t,"]")}};return i}(p);n.Slice=k=function(e){var t=Re((Ce(i,e).displayName="Slice",i),e).prototype,n=i;function i(e){var t=this instanceof r?this:new r;t.type=e.type,t.target=e.target,t.from=e.from,t.to=e.to;t.from==null&&(t.from=y(0));if(t.to&&t.type==="to"){t.to=T("+",t.to,y("1"))}return t}function r(){}r.prototype=t;i.prototype.children=["target","from","to"];i.prototype.show=function(){return this.type};i.prototype.compileNode=function(e){var t;if(this.to&&this.type==="to"){this.to=T("||",this.to,y("9e9"))}t=[this.target,this.from];if(this.to){t.push(this.to)}return L(v(Ae("slice"))).add(w(b("call"),".",true)).add(A(t)).compile(e)};return i}(p);n.Chain=L=function(e){var t=Re((Ce(i,e).displayName="Chain",i),e).prototype,n=i;function i(e,t){var n=this instanceof r?this:new r;if(!t&&e instanceof i){return e}n.head=e;n.tails=t||[];return n}function r(){}r.prototype=t;i.prototype.children=["head","tails"];i.prototype.add=function(e){var t,n,r,s,o,a,u,l;if(this.tails.length){t=(n=this.tails)[n.length-1];if(t instanceof A&&((n=t.partialized)!=null?n.length:void 8)===1&&e.args.length===1){r=t.partialized[0].head.value;delete t.partialized;t.args[r]=e.args[0];return this}}if(this.head instanceof M){s=i(this.head.it),this.head=s.head,this.tails=s.tails;e.soak=true}this.tails.push(e);o=this.head instanceof U&&this.head.it instanceof T&&!this.head.it.partial?this.head.it:this.head instanceof T&&!this.head.partial?this.head:void 8;if(this.head instanceof $){if(!this.head.called&&e instanceof A&&!e.method){e.method=".call";e.args.unshift(y("this"));this.head.called=true}else if(!this.tails[1]&&((s=e.key)!=null?s.name:void 8)==="prototype"){this.head.sproto=true}}else if(e instanceof A&&this.tails.length===1&&o&&Ne(o.op,a=["&&","||","xor"])){u=e;l=function(e,t){var n;n=e[t];if(n instanceof
|
||
|
// fallthrough
|
||
|
case"<==":case">==":case"<<=":case">>=":return this.compileDeepEq(e);default:if(t.test(this.op)){if(s=((o=this.op)==="==="||o==="!==")&&this.xorChildren(function(e){return e.isRegex()})){return this.compileRegexEquals(e,s)}if(this.op==="==="&&(this.first instanceof y&&this.second instanceof y)&&this.first.isWhat()!==this.second.isWhat()){if(e.warn){this.warn("strict comparison of two different types will always be false: "+this.first.value+" == "+this.second.value)}}}if(t.test(this.op)&&t.test(this.second.op)){return this.compileChain(e)}}this.first.front=this.front;a=[this.first.compile(e,u=le+he[this.op])," ",this.mapOp(this.op)," ",this.second.compile(e,u)];if(e.level<=u){return l.apply(null,[this].concat(me(a)))}else{return l.apply(null,[this,"("].concat(me(a),[")"]))}};s.prototype.mapOp=function(e){var t;switch(false){case!(t=e.match(/\.([&\|\^]|<<|>>>?)\./)):return t[1];case e!=="of":return"in";default:return e}};s.prototype.compileChain=function(e){var t,n,i,r;t=[this.first.compile(e,n=le+he[this.op])];i=this.second.first.cache(e,true),r=i[0],this.second.first=i[1];t.push(" ",this.op," ",r.compile(e,n)," && ",this.second.compile(e,le));if(e.level<=le){return l.apply(null,[this].concat(me(t)))}else{return l.apply(null,[this,"("].concat(me(t),[")"]))}};s.prototype.compileExistence=function(e){var t;if(this["void"]||!e.level){t=s("&&",M(this.first,true),U(this.second.unwrap()));return(t["void"]=true,t).compileNode(e)}t=this.first.cache(e,true);return l(this,K(M(t[0]),t[1]).addElse(this.second).compileExpression(e))};s.prototype.compileAnyInstanceOf=function(e,t){var n,i,r,o,a,u,c;n=this.first.cache(e),i=n[0],r=n[1],this.temps=n[2];o=s("instanceof",i,t.shift());for(a=0,u=t.length;a<u;++a){c=t[a];o=s("||",o,s("instanceof",r,c))}return l(this,U(o).compile(e))};s.prototype.compileMinMax=function(e){var t,n,i;t=this.first.cache(e,true);n=this.second.cache(e,true);i=s(this.op.charAt(),t[0],n[0]);return l(this,K(i,t[1]).addElse(n[1]).compileExpression(e))};s.prototype.compileMethod=function(e,t,n,i){var r;r=[this.second].concat(i||[]);if(this.first["is"+t]()){return l(this,L(this.first,[w(b(n)),A(r)]).compile(e))}else{r.unshift(this.first);return l(this,A.make(Z(Ae(n)+".call"),r).compile(e))}};s.prototype.compileJoin=function(e){return this.compileMethod(e,"Array","join")};s.prototype.compileRemove=function(e){return this.compileMethod(e,"String","replace",Z("''"))};s.prototype.compileSplit=function(e){return this.compileMethod(e,"String","split")};s.prototype.compileRepeat=function(e){var t,n,i,r,s,o,a,u,h,f,p,d;t=this.first,n=t.items,i=this.second;r=t.isArray()&&"Array";if(n&&!c(s=D.compileArray(e,n))){t=Z(s);n=null}if(r&&!n||!(i instanceof y&&i.value<32)){return l(this,A.make(ee("repeat"+(r||"String")),[t,i]).compile(e))}i=+i.value;if(1<=i&&i<2){return l(this,t.compile(e))}if(n){if(i<1){return l(this,g(n).add(Z("[]")).compile(e))}o=[];for(a=0,u=n.length;a<u;++a){h=a;f=n[a];p=f.cache(e,1),n[h]=p[0],o[o.length]=p[1]}n.push((p=Z(),p.compile=function(){return l.apply(null,[this].concat(me(_e([", ",E.compile(e,o)],i-1).slice(1))))},p));return l(this,t.compile(e))}else if(t instanceof y){return l(this,(d=(t=t.compile(e).toString()).charAt())+Te(t.slice(1,-1)+"",i)+d)}else{if(i<1){return l(this,g(t.it).add(Z("''")).compile(e))}t=(o=t.cache(e,1,le))[0]+Te(" + "+o[1],i-1);if(e.level<le+he["+"]){return l(this,t)}else{return l(this,"(",t,")")}}};s.prototype.compilePow=function(e){return l(null,A.make(ne(this,Z("Math.pow")),[this.first,this.second]).compile(e))};s.prototype.compileConcat=function(e){var t;t=function(e){switch(false){case!(e instanceof s&&e.op==="++"):return t(e.first).concat(t(e.second));default:return[e]}};return l(null,L(this.first).add(ne(this,w(b("concat"),".",true))).add(A(t(this.second))).compile(e))};s.prototype.compileCompose=function(e){var t,n,i;t=this.op;n=[this.first];i=this.second;while(i instanceof s&&i.op===t&&!i.partial){n.push(i.first);i=i.second}n.push(i);if(t==="<<"){n.reverse()}return l(this,L(v(Ae("compose"))).add(A(n)).compile(e))};s.prototype.compileMod=function(e){var t,n;t=e.scope.temporary
|
||
|
this.body=g(K(this.guard,this.body))}t=this.body.lines[0];if((t!=null?t.verb:void 8)==="continue"&&!t.label){this.body.lines.length=0}return this};i.prototype.addGuard=function(e){this.guard=e;return this};i.prototype.addObjComp=function(e){this.objComp=e!=null?e:true;return this};i.prototype.makeReturn=function(e){var t,n,i,r;if(this.hasReturned){return this}if(e){if(this.objComp){this.body=g(this.body.makeReturn(e,true))}else{if(!(this.body||this.index)){this.addBody(g(v(this.index="ridx$")))}n=(t=this.body.lines)!=null?t[t.length-1]:void 8;if((this.isComprehension||this.inComprehension)&&!(n!=null&&n.isComprehension)){(i=this.body).makeReturn.apply(i,arguments);if((i=this["else"])!=null){i.makeReturn.apply(i,arguments)}this.hasReturned=true}else{this.resVar=e;if((r=this["else"])!=null){r.makeReturn.apply(r,arguments)}}}}else{this.getJump()||(this.returns=true)}return this};i.prototype.compileNode=function(e){var t,n,i,r;e.loop=true;this.test&&(this.un?this.test=this.test.invert():this.anaphorize());if(this.post){return l(null,l(this,"do {"),this.compileBody((e.indent+=fe,e)))}n=((t=this.test)!=null?t.compile(e,oe):void 8)||"";if(!(this.update||this["else"])){i=!c(n)?[l(this,"while ("),n]:[l(this,"for (;;")]}else{i=[l(this,"for (")];if(this["else"]){i.push(this.yet=e.scope.temporary("yet")," = true")}i.push(l(this,";"),n.toString()&&" ",n,l(this,";"));if(r=this.update){i.push(" ",r.compile(e,oe))}}return l.apply(null,[null].concat(me(i),[l(this,") {"),this.compileBody((e.indent+=fe,e))]))};i.prototype.compileBody=function(e){var t,n,r,s,o,a,u,h,f,p,d,m,y,k,E,S,N=this;e["break"]=e["continue"]=true;t=this.body.lines,n=this.yet,r=this.tab;s=[];o=[];a=[];u=this.objComp?"{}":"[]";f=function(){return h!=null?h:h=e.scope.temporary(N.objComp?"resultObj":"results")};p=t!=null?t[t.length-1]:void 8;if(!(this.isComprehension||this.inComprehension)||p!=null&&p.isComprehension){d=false;if(p!=null){p.traverseChildren(function(e){var t;if(e instanceof g&&(t=e.lines)[t.length-1]instanceof i){d=true}})}if(this.returns&&!this.resVar){this.resVar=m=e.scope.assign(f(),u)}if(this.resVar&&(p instanceof i||d)){y=e.scope.temporary("lresult");t.unshift(I(v(y),t[t.length-1].objComp?C():R(),"="));if(t[k=t.length-1]!=null){t[k]=t[k].makeReturn(y)}a.push(fe,L(v(this.resVar)).add(w(b("push"),".",true)).add(A([L(v(y))])).compile(e),";\n"+this.tab)}else{this.hasReturned=true;if(this.resVar){this.body.makeReturn(this.resVar)}}}if(this.returns){if(!p instanceof i&&!this.hasReturned||this.isComprehension||this.inComprehension){if(t[k=t.length-1]!=null){t[k]=t[k].makeReturn(m=e.scope.assign(f(),u),this.objComp)}}o.push("\n"+this.tab+"return ",m||u,";");if((E=this["else"])!=null){E.makeReturn()}}n&&t.unshift(Z(n+" = false;"));if(!c(S=this.body.compile(e,se))){s.push("\n",S,"\n"+r)}s.push.apply(s,a);s.push("}");if(this.post){s.push(l(this," while ("),this.test.compile((e.tab=r,e),oe),l(this,");"))}if(n){s.push(l(this," if ("),n,l(this,") "),this.compileBlock(e,g(this["else"])));e.scope.free(n)}return l.apply(null,[null].concat(me(s),me(o)))};return i}(p);n.For=z=function(e){var t=Re((Ce(i,e).displayName="For",i),e).prototype,n=i;function i(e){var t,n,i,r;Ie(this,e);if(this.item instanceof v&&!this.item.value){this.item=null}for(t=0,r=(i=this.kind||[]).length;t<r;++t){n=i[t];this[n]=true}if(this.own&&!this.object){this.carp("`for own` requires `of`")}}i.prototype.children=["item","source","from","to","step","body"];i.prototype.aSource=null;i.prototype.show=function(){return(this.kind||[]).concat(this.index).join(" ")};i.prototype.addBody=function(t){var n,i,r,s,o,a;if(this["let"]){if(n=this.ref,delete this.ref,n){this.item=y("..")}i=(r=[],(s=this.index)&&r.push(I(v(s),y("index$$"))),(s=this.item)&&r.push(I(s,y("item$$"))),r);t=g(this.guard?(o=function(){var e,t,n,r,o,u,l,c=[];for(e=0,r=(n=i).length;e<r;++e){t=n[e];if(s=t.assigns()){for(o=0,l=(u=s).length;o<l;++o){a=u[o];c.push(v(a))}}}return c}(),i.concat([K((n=this.guard,delete this.guard,n),A["let"](o,t))])):A["let"](i,t))}e.prototype.addBody.call(this,t);if(this["let"]){delete this.index;delete this.item
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
var i,r,s,o,a,u,l={}.toString;i=e("./lexer");r=e("./parser").parser;s=e("./ast");o=e("source-map").SourceNode;a=e("path");r.yy=s;r.lexer={lex:function(){var e,t,n,i,r,s;e=this.tokens[++this.pos]||[""],t=e[0],this.yytext=e[1],n=e[2],i=e[3];e=this.tokens[this.pos+1]||[""],r=e[2],s=e[3];this.yylineno=n;this.yylloc={first_line:n,first_column:i,last_line:r,last_column:s};return t},setInput:function(e){this.pos=-1;return this.tokens=e},upcomingInput:function(){return""}};u=t.alloc&&t.from||function(e){return new t(e)};n.VERSION="1.6.1";n.compile=function(e,t){var s,o,l,c,h,f,p,d,g;t==null&&(t={});t.warn==null&&(t.warn=true);t.header==null&&(t.header=true);if(t.header===true){t.header="// Generated by LiveScript "+n.VERSION+"\n"}try{if(t.json){s=Function(n.compile(e,{bare:true,run:true,print:true}))();return JSON.stringify(s,null,2)+"\n"}else{o=r.parse(i.lex(e));if(t.run&&t.print){o.makeReturn()}l=o.compileRoot(t);if(t.map&&t.map!=="none"){c=t.filename,h=t.outputFilename;if(!c){c="unnamed-"+Math.floor(Math.random()*4294967296).toString(16)+".ls"}l.setFile(a.basename(c));s=l.toStringWithSourceMap();if(t.map==="embedded"){s.map.setSourceContent(c,e)}if((f=t.map)==="linked"||f==="debug"){p=a.basename(h)+".map";s.code+="\n//# sourceMappingURL="+p+"\n"}else{s.code+="\n//# sourceMappingURL=data:application/json;base64,"+u(s.map.toString()).toString("base64")+"\n"}return s}else{return l.toString()}}}catch(m){d=m;if(g=t.filename){d.message+="\nat "+g}throw d}};n.ast=function(e){return r.parse(typeof e==="string"?i.lex(e):e)};n.tokens=i.lex;n.lex=function(e){return i.lex(e,{raw:true})};n.run=function(e,t){var i,r;i=n.compile(e,(r={},c(r,t),r.bare=true,r));return Function(l.call(i).slice(8,-1)==="String"?i:i.code)()};n.tokens.rewrite=i.rewrite;h(n.ast,r.yy);if(e.extensions){e("./node")(n)}else{n.require=e}function c(e,t){var n={}.hasOwnProperty;for(var i in t)if(n.call(t,i))e[i]=t[i];return e}function h(e,t){for(var n in t)e[n]=t[n];return e}}).call(this,e("buffer").Buffer)},{"./ast":1,"./lexer":3,"./node":4,"./parser":5,buffer:9,path:13,"source-map":31}],3:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g,m,y,v,b,w,k,L,A,E,C,S,R,N,_,T,I,x,O,M,P,B,$,U,D=[].slice,j=Array.from||function(e){return D.call(e)};n.lex=function(e,t){return ne(n).tokenize(e||"",t||{})};n.rewrite=function(e){var t;e||(e=this.tokens);q(e);V(e);K(e);X(e);Q(e);Z(e);if(((t=e[0])!=null?t[0]:void 8)==="NEWLINE"){e.shift()}return e};n.tokenize=function(e,t){var n,i,r,s,o;this.inter||(e=e.replace(/[\r\u2028\u2029\uFEFF]/g,""));e="\n"+e;this.tokens=[this.last=["NEWLINE","\n",0,0]];this.line=~-t.line;this.column=t.column||0;this.dents=[];this.closes=[];this.parens=[];this.flags=[];n=0;i=n;this.charsCounted=0;this.isAtPrefix=true;while(r=e.charAt(n)){s=n-i;i=n;if(this.charsCounted>s){throw new Error("Location information out-of-sync in lexer")}this.column+=s-this.charsCounted;this.charsCounted=0;switch(r){case" ":n+=this.doSpace(e,n);break;case"\n":n+=this.doLine(e,n);break;case"\\":n+=this.doBackslash(e,n);break;case"'":case'"':n+=this.doString(e,n,r);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n+=this.doNumber(e,n);break;case"/":switch(e.charAt(n+1)){case"*":n+=this.doComment(e,n);break;case"/":n+=this.doHeregex(e,n);break;default:n+=this.doRegex(e,n)||this.doLiteral(e,n)}break;case"`":if("`"===e.charAt(n+1)){n+=this.doJS(e,n)}else{n+=this.doLiteral(e,n)}break;default:n+=this.doID(e,n)||this.doLiteral(e,n)||this.doSpace(e,n)}}this.dedent(this.dent);if(o=this.closes.pop()){this.carp("missing `"+o+"`")}if(this.inter){this.rest==null&&this.carp("unterminated interpolation")}else{this.last.spaced=true;this.newline()}t.raw||this.rewrite();return this.tokens};n.dent=0;n.identifiers={};n.reset=function(){this.dent=0;this.identifiers={}};n.hasOwn=Object.prototype.hasOwnProperty;n.checkConsistency=function(e,t){if(this.hasOwn.call(this.identifiers,e)&&this.identifiers[e]!==t){throw new ReferenceError("Inconsistent use of "+e+" as "+t+" on line "+-~this.line)}else{return this.identifiers[e]=t}};n.doID=function(e,t){var n,i,r,s,o,a,u,c,h;i=(n=(m.lastIndex=t,m).exec(e))[0];if(!i){return 0}r=l(n[1]);if(/-/.test(n[1])){this.checkConsistency(r,n[1])}if(_.test(r)){try{Function("var "+r)}catch(g){s=g;this.carp("invalid identifier '"+r+"'")}}o=this.last;if(n[2]||o[0]==="DOT"||this.adi()){this.token("ID",ie(r,d)?(a=Object(r),a.reserved=true,a):r);if(n[2]){this.token(":",":")}return i.length}switch(r){case"true":case"false":case"on":case"off":case"yes":case"no":case"null":case"void":case"arguments":case"debugger":u="LITERAL";break;case"new":case"do":case"typeof":case"delete":u="UNARY";break;case"yield":case"await":u="YIELD";break;case"return":case"throw":u="HURL";break;case"break":case"continue":u="JUMP";break;case"this":case"eval":case"super":return this.token("LITERAL",r,true).length;case"for":r=[];this.fset("for",true);this.fset("to",false);this.fset("by",true);break;case"then":this.fset("for",false);this.fset("to",false);break;case"catch":case"function":r="";break;case"in":case"of":if(this.fget("for")){this.fset("for",false);if(r==="in"){this.fset("by",true);r="";if(o[0]==="ID"&&((a=(c=this.tokens)[c.length-2][0])===","||a==="]"||a==="}")){r=this.tokens.pop()[1];if((a=this.tokens)[a.length-1][0]===","){this.tokens.pop()}}}break}
|
||
|
// fallthrough
|
||
|
case"instanceof":if(o[1]==="!"){r=this.tokens.pop()[1]+r}u=(a=this.tokens)[a.length-1][0]==="("?"BIOPR":"RELATION";break;case"not":if(o.alias&&o[1]==="==="){return o[1]="!==",3}u="UNARY";r="!";break;case"and":case"or":case"xor":case"is":case"isnt":this.unline();u=r==="is"||r==="isnt"?"COMPARE":"LOGIC";if(o[0]==="("){u="BIOP"}this.token(u,function(){switch(r){case"is":return"===";case"isnt":return"!==";case"or":return"||";case"and":return"&&";case"xor":return"xor"}}());this.last.alias=true;return r.length;case"unless":u="IF";break;case"until":u="WHILE";break;case"import":if(o[0]==="("){r="<<<";u="BIOP"}else{if(W(this.tokens)){r="<<<"}else{u="DECL"}}break;case"export":case"const":case"var":u="DECL";break;case"with":u=function(){switch(false){case!W(this.tokens):return"CLONEPORT";case o[0]!=="(":return"BIOP";default:return"WITH"}}.call(this);break;case"when":u="CASE";
|
||
|
// fallthrough
|
||
|
case"case":if(this.doCase()){return i.length}break;case"match":u="SWITCH";break;case"loop":this.token("WHILE",r);this.token("LITERAL","true");return i.length;case"let":case"own":if(o[0]==="FOR"&&!ie(r,o[1])){o[1].push(r);return 3}
|
||
|
// fallthrough
|
||
|
default:if(ie(r,f)){break}if(ie(r,p)){this.carp("reserved word '"+r+"'")}if(!o[1]&&((a=o[0])==="FUNCTION"||a==="GENERATOR"||a==="LABEL")){o[1]=r;o.spaced=false;return i.length}u="ID";switch(r){case"otherwise":if((a=o[0])==="CASE"||a==="|"){o[0]="DEFAULT";return r.length}break;case"all":if(h=o[1]==="<<<"&&"<"||o[1]==="import"&&"All"){o[1]+=h;return 3}break;case"from":if(o[1]==="yield"){o[1]+="from";return 4}this.forange()&&(u="FROM");break;case"to":case"til":this.forange()&&this.tokens.push(["FROM","",this.line,this.column],["STRNUM","0",this.line,this.column]);if(this.fget("from")){this.fset("from",false);this.fset("by",true);u="TO"}else if(!o.callable&&o[0]==="STRNUM"&&(a=this.tokens)[a.length-2][0]==="["){o[0]="RANGE";o.op=r;return r.length}else if(ie("]",this.closes)){this.token("TO",r);return r.length}break;case"by":if(o[0]==="STRNUM"&&(a=this.tokens)[a.length-2][0]==="RANGE"&&(a=this.tokens)[a.length-3][0]==="["){u="RANGE_BY"}else if(ie("]",this.closes)){u="BY"}else if(this.fget("by")&&o[0]!=="FOR"){u="BY";this.fset("by",false)}break;case"ever":if(o[0]==="FOR"){this.fset("for",false);o[0]="WHILE";u="LITERAL";r="true"}}}u||(u=n[1].toUpperCase());if((u==="COMPARE"||u==="LOGIC"||u==="RELATION")&&o[0]==="("){u=u==="RELATION"?"BIOPR":"BIOP"}if(u==="THEN"||u==="IF"||u==="WHILE"){this.fset("for",false);this.fset("by",false)}if(u==="RELATION"||u==="THEN"||u==="ELSE"||u==="CASE"||u==="DEFAULT"||u==="CATCH"||u==="FINALLY"||u==="IN"||u==="OF"||u==="FROM"||u==="TO"||u==="BY"||u==="EXTENDS"||u==="IMPLEMENTS"||u==="WHERE"){this.unline()}this.token(u,r);return i.length};n.doNumber=function(e,t){var n,i,r,s,o,a,u,l;A.lastIndex=t;if(!(n=(i=A.exec(e))[0])){return 0}r=this.last;if(i[5]&&(r[0]==="DOT"||this.adi())){this.token("STRNUM",i[4].replace(E,""));return i[4].length}if(s=i[1]){o=parseInt(a=i[2].replace(E,""),s);u=false;if(s>36||s<2){if(/[0-9]/.exec(a)){this.carp("invalid number base "+s+" (with number "+a+"),base must be from 2 to 36")}else{u=true}}if(isNaN(o)||o===parseInt(a.slice(0,-1),s)){this.strnum(i[1]);this.token("DOT",".~");this.token("ID",i[2]);return n.length}o+=""}else{o=(i[3]||n).replace(E,"");if(i[3]&&o.charAt()==="0"&&((l=o.charAt(1))!==""&&l!==".")){this.carp("deprecated octal literal "+i[4])}}if(!r.spaced&&r[0]==="+-"){r[0]="STRNUM";r[1]+=o;return n.length}this.strnum(o);return n.length};n.doString=function(e,t,n){var i,r;if(n===e.charAt(t+1)){return n===e.charAt(t+2)?this.doHeredoc(e,t,n):(this.strnum(n+n),2)}if(n==='"'){i=this.interpolate(e,t,n);this.addInterpolated(i,s);return i.size}r=(w.lastIndex=t,w).exec(e)[0]||this.carp("unterminated string");this.strnum(s(this.string(n,r.slice(1,-1))));return this.countLines(r).length};n.doHeredoc=function(e,t,n){var i,r,s,a,u,l,c,h,f;if(n==="'"){~(i=e.indexOf(n+n+n,t+3))||this.carp("unterminated heredoc");r=e.slice(t+3,i);s=r.replace(R,"");this.strnum(o(this.string(n,G(z(s,Y(s))))));return this.countLines(r).length+6}a=this.interpolate(e,t,n+n+n);u=Y(e.slice(t+3,t+a.size-3).replace(R,""));for(l=0,c=a.length;l<c;++l){h=l;f=a[l];if(f[0]==="S"){if(h+1===a.length){f[1]=f[1].replace(R,"")}f[1]=z(f[1],u);if(h===0){f[1]=G(f[1])}}}this.addInterpolated(a,o);return a.size};n.doComment=function(e,t){var n,i,r;n=~(i=e.indexOf("*/",t+2))?e.slice(t,i+2):e.slice(t)+"*/";if((r=this.last[0])==="NEWLINE"||r==="INDENT"||r==="THEN"){this.token("COMMENT",z(n,this.dent));this.token("NEWLINE","\n")}return this.countLines(n).length};n.doJS=function(e,t){var n,i;k.lastIndex=t;n=k.exec(e)[0]||this.carp("unterminated JS literal");this.token("LITERAL",(i=Object(z(n.slice(2,-2),this.dent)),i.js=true,i),true);return this.countLines(n).length};n.doRegex=function(e,t){var n,i,r,s,o;if(n=W(this.tokens)||this.last[0]==="CREMENT"){if(!this.last.spaced||((i=e.charAt(t+1))===" "||i==="=")){return 0}}i=(C.lastIndex=t,C).exec(e),r=i[0],s=i[1],o=i[2];if(r){this.regex(s,o)}else if(!n&&this.last[0]!=="("){this.carp("unterminated regex")}return r.length};n.doHeregex=function(e,t){var n,i,r,s,o,l,h,f,p,d,g,m;n=this.tokens,i=this.last;r=this.interpolate(e,t,"//");s=e.slice(t+r.size);o=this.validate(/^(?:[gimy]{1,
|
||
|
// fallthrough
|
||
|
case"!~=":case"==":r=function(){switch(r){case"~=":return"==";case"!~=":return"!=";case"==":return"===";case"!=":return"!=="}}();i="COMPARE";break;case"===":case"!==":r+="=";
|
||
|
// fallthrough
|
||
|
case"<":case">":case"<=":case">=":case"<==":case">==":case">>=":case"<<=":i="COMPARE";break;case".<<.":case".>>.":case".>>>.":case"<?":case">?":i="SHIFT";break;case"(":if(!((s=this.last[0])==="FUNCTION"||s==="GENERATOR"||s==="LET"||this.able(true)||this.last[1]===".@")){this.token("(","(");this.closes.push(")");this.parens.push(this.last);return 1}i="CALL(";this.closes.push(")CALL");break;case"[":case"{":this.adi();this.closes.push("]}".charAt(r==="{"));break;case"}":if(this.inter&&r!==(s=this.closes)[s.length-1]){this.rest=e.slice(t+1);return 9e9}
|
||
|
// fallthrough
|
||
|
case"]":case")":if(i===")"&&((s=this.last[0])==="+-"||s==="COMPARE"||s==="LOGIC"||s==="MATH"||s==="POWER"||s==="SHIFT"||s==="BITWISE"||s==="CONCAT"||s==="COMPOSE"||s==="RELATION"||s==="PIPE"||s==="BACKPIPE"||s==="IMPORT"||s==="CLONEPORT"||s==="ASSIGN")){(s=this.tokens)[s.length-1][0]=function(){switch(this.last[0]){case"RELATION":return"BIOPR";case"PIPE":this.parameters(false,-1);return"BIOPP";default:return"BIOP"}}.call(this)}if(")"===(i=r=this.pair(r))){this.lpar=this.parens.pop()}break;case"=":case":":if(r===":"){switch(this.last[0]){case"ID":case"STRNUM":case")":break;case"...":this.last[0]="STRNUM";break;default:i="LABEL";r=""}this.token(i,r);return n.length}
|
||
|
// fallthrough
|
||
|
case":=":case"+=":case"-=":case"*=":case"/=":case"%=":case"%%=":case"<?=":case">?=":case"**=":case"^=":case".&.=":case".|.=":case".^.=":case".<<.=":case".>>.=":case".>>>.=":case"++=":case"|>=":if(this.last[1]==="."||this.last[0]==="?"&&this.adi()){this.last[1]+=r;return r.length}if(this.last[0]==="LOGIC"){(r=Object(r)).logic=this.tokens.pop()[1]}else if((r==="+="||r==="-=")&&!W(this.tokens)&&((s=this.last[0])!=="+-"&&s!=="UNARY"&&s!=="LABEL")){this.token("UNARY",r.charAt());r="="}i="ASSIGN";break;case"::=":this.token("DOT",".");this.token("ID","prototype");this.token("IMPORT","<<");return n.length;case"*":if(this.last[0]==="FUNCTION"){this.last[0]="GENERATOR";return n.length}if(o=((s=this.last[0])==="NEWLINE"||s==="INDENT"||s==="THEN"||s==="=>")&&(N.lastIndex=t+1,N).exec(e)[0].length){this.tokens.push(["LITERAL","void",this.line,this.column],["ASSIGN","=",this.line,this.column]);this.indent(t+o-1-this.dent-e.lastIndexOf("\n",t-1));return o}i=W(this.tokens)||this.last[0]==="CREMENT"&&W(this.tokens,this.tokens.length-1)||this.last[0]==="("?"MATH":"STRNUM";break;case"@":this.adi();if(this.last[0]==="DOT"&&this.last[1]==="."&&(s=this.tokens)[s.length-2][0]==="ID"&&(s=this.tokens)[s.length-2][1]==="constructor"){this.tokens.pop();this.tokens.pop();this.token("LITERAL","this",true);this.adi();this.token("ID","constructor",true)}else{this.token("LITERAL","this",true)}return 1;case"@@":this.adi();this.token("ID","constructor",true);return 2;case"&":this.token("LITERAL","arguments");return 1;case"!":switch(false){default:if(!this.last.spaced){if(this.last[1]==="require"){this.last[0]="REQUIRE";this.last[1]="require!"}else if(W(this.tokens,null,true)){this.token("CALL(","!");this.token(")CALL",")")}else if(this.last[1]==="typeof"){this.last[1]="classof"}else if(this.last[1]==="delete"){this.last[1]="jsdelete"}else{break}return 1}}i="UNARY";break;case"|":i="BITWISE";break;case"~":if(this.dotcat(r)){return 1}i="UNARY";break;case"::":this.adi();r="prototype";i="ID";break;case"=>":this.unline();this.fset("for",false);i="THEN";break;default:if(/^!?(?:--?|~~?)>>?\*?$/.test(r)){this.parameters(i="->")}else if(/^\*?<(?:--?|~~?)!?$/.test(r)){this.parameters(i="<-")}else{switch(r.charAt(0)){case"(":this.token("CALL(","(");i=")CALL";r=")";break;case"<":if(r.length<4){this.carp("unterminated words")}this.token("WORDS",r.slice(2,-2),this.adi());return this.countLines(r).length}}}if((i==="+-"||i==="COMPARE"||i==="LOGIC"||i==="MATH"||i==="POWER"||i==="SHIFT"||i==="BITWISE"||i==="CONCAT"||i==="RELATION"||i==="PIPE"||i==="BACKPIPE"||i==="COMPOSE"||i==="IMPORT")&&this.last[0]==="("){i=i==="BACKPIPE"?"BIOPBP":"BIOP"}if(i===","||i==="CASE"||i==="PIPE"||i==="BACKPIPE"||i==="COMPOSE"||i==="DOT"||i==="LOGIC"||i==="COMPARE"||i==="MATH"||i==="POWER"||i==="IMPORT"||i==="SHIFT"||i==="BITWISE"){this.unline()}this.token(i,r);return n.length};n.token=function(e,t,n){this.tokens.push(this.last=[e,t,this.line,this.column]);if(n){this.last.callable=true}return t};n.indent=function(e){this.dent+=e;this.dents.push(this.token("INDENT",e));this.closes.push("DEDENT")};n.dedent=function(e){var t;this.dent-=e;while(e>0&&(t=this.dents.pop())){if(e<t&&!this.inter){this.carp("unmatched dedent ("+e+" for "+t+")")}this.pair("DEDENT");e-=typeof t==="number"?this.token("DEDENT",t):t}};n.newline=function(){var e;if(!(this.last[0]==="NEWLINE"&&this.last[1]==="\n")){this.tokens.push(this.last=(e=["NEWLINE","\n",this.line,this.column],e.spaced=true,e))}};n.unline=function(){var e;if(!this.tokens[1]){return}switch(this.last[0]){case"INDENT":(e=this.dents)[e.length-1]+="";
|
||
|
// fallthrough
|
||
|
case"NEWLINE":this.tokens.length--}};n.parameters=function(e,t){var n,i,r,s,o;if(this.last[0]===")"&&")"===this.last[1]){this.lpar[0]="PARAM(";this.last[0]=")PARAM";return}if(e==="->"){this.token("PARAM(","")}else{for(n=(i=this.tokens).length-1;n>=0;--n){r=n;s=i[n];if((o=s[0])==="NEWLINE"||o==="INDENT"||o==="THEN"||o==="=>"||o==="("){break}}this.tokens.splice(r+1,0,["PARAM(","",s[2],s[3]])}if(t){this.tokens.splice(this.tokens.length+t,0,[")PARAM","",s[2],s[3]])}else{this.token(")PARAM","")}};n.interpolate=function(e,t,i){var r,s,o,a,u,c,h,f,p,d,g,y,v,b,w,k,L,A;r=[];s=i.charAt(0);o=0;a=-1;e=e.slice(t+i.length);u=[this.line,this.column],c=u[0],h=u[1];this.countLines(i);while(f=e.charAt(++a)){switch(f){case s:if(i!==e.slice(a,a+i.length)){continue}r.push(["S",this.countLines(e.slice(0,a)),c,h]);this.countLines(i);return r.size=o+a+i.length*2,r;case"#":p=e.charAt(a+1);d=p==="@"&&p||(m.lastIndex=a+1,m).exec(e)[1];if(!(d||p==="{")){continue}break;case"\\":++a;
|
||
|
// fallthrough
|
||
|
default:continue}if(a||k&&!g){g=r.push(["S",this.countLines(e.slice(0,a)),c,h]);u=[this.line,this.column],c=u[0],h=u[1]}if(d){y=d.length;if(d==="@"){d="this"}if(d==="this"){v="LITERAL"}else{d=l(d);try{Function("'use strict'; var "+d)}catch(E){b=E;this.carp("invalid variable interpolation '"+d+"'")}v="ID"}e=e.slice(w=a+1+y);r.push(["TOKENS",k=[[v,d,this.line,this.column]]])}else{L=(u=ne(n),u.inter=true,u.emender=this.emender,u);k=L.tokenize(e.slice(a+2),{line:this.line,column:this.column+2,raw:true});w=e.length-L.rest.length;this.countLines(e.slice(a,w));e=L.rest;while(((u=k[0])!=null?u[0]:void 8)==="NEWLINE"){k.shift()}if(k.length){k.unshift(["(","(",c,h]);k.push([")",")",this.line,this.column-1]);r.push(["TOKENS",k])}A=[this.line,this.column],c=A[0],h=A[1]}o+=w;a=-1}this.carp("missing `"+i+"`")};n.addInterpolated=function(e,t){var n,i,r,s,o,a,u,l,c,h,f;if(!e[1]){return this.strnum(t(this.string('"',e[0][1])))}n=this.tokens,i=this.last;r=!i.spaced&&i[1]==="%"?(--n.length,this.last=i=n[n.length-1],["[","]",[",",","]]):["(",")",["+-","+"]],s=r[0],o=r[1],a=r[2];u=this.adi();n.push([s,'"',i[2],i[3]]);for(l=0,c=e.length;l<c;++l){h=l;f=e[l];if(f[0]==="TOKENS"){n.push.apply(n,f[1])}else{if(h>1&&!f[1]){continue}n.push(["STRNUM",t(this.string('"',f[1])),f[2],f[3]])}n.push(a.concat(n[n.length-1][2],n[n.length-1][3]))}--n.length;this.token(o,"",u)};n.strnum=function(e){this.token("STRNUM",e,this.adi()||this.last[0]==="DOT")};n.regex=function(e,t){var n;try{RegExp(e)}catch(i){n=i;this.carp(n.message)}if(t==="$"){return this.strnum(this.string("'",a(e)))}return this.token("LITERAL","/"+(e||"(?:)")+"/"+this.validate(t))};n.adi=function(){if(this.last.spaced){return}if(!W(this.tokens)){return}return this.token("DOT",".")};n.dotcat=function(e){if(this.last[1]==="."||this.adi()){return this.last[1]+=e}};n.pair=function(e){var t,n;if(!(e===(t=(n=this.closes)[n.length-1])||")CALL"===t&&e===")")){if("DEDENT"!==t){this.carp("unmatched `"+e+"`")}this.dedent((n=this.dents)[n.length-1]);return this.pair(e)}this.unline();this.fclear();return this.closes.pop()};n.able=function(e){return!this.last.spaced&&W(this.tokens,null,e)};n.countLines=function(e){var t;if(!this.isAtPrefix){this.column+=e.length}while(t=1+e.indexOf("\n",t)){if(!this.isAtPrefix){this.column=0}this.column+=e.length-t;++this.line;this.isAtPrefix=false}this.charsCounted+=e.length;return e};n.forange=function(){var e,t,n;if(((e=(t=this.tokens)[t.length-2-((n=this.last[0])==="NEWLINE"||n==="INDENT")])!=null?e[0]:void 8)==="FOR"||this.last[0]==="FOR"){this.fset("for",false);this.fset("from",true);return true}else{return false}};n.validate=function(e){var t;if(t=e&&/(.).*\1/.exec(e)){this.carp("duplicate regex flag `"+t[1]+"`")}return e};n.fget=function(e){var t;return(t=this.flags[this.closes.length])!=null?t[e]:void 8};n.fset=function(e,t){var n,i;((n=this.flags)[i=this.closes.length]||(n[i]={}))[e]=t};n.fclear=function(){this.flags.splice(this.closes.length)};n.carp=function(e){F(e,this.line)};n.string=function(e,t){return i(e,t,this.line)};function F(e,t){throw SyntaxError(e+" on line "+-~t)}function W(e,t,n){var i,r;t==null&&(t=e.length);r=(i=e[t-1])[0];return r==="ID"||r==="]"||r==="?"||(n?i.callable||(r===")"||r===")CALL"||r==="BIOPBP")&&i[1]:r==="}"||r===")"||r===")CALL"||r==="STRNUM"||r==="LITERAL"||r==="WORDS")}i=function(e){return function(t,n,i){n=n.replace(e,function(e,n,r,s){if(e===t||e==="\\"){return"\\"+e}if(n){return"\\x"+(256+parseInt(n,8)).toString(16).slice(1)}if(r){F("malformed character escape sequence",i)}if(!s||t===s){return e}else{return s}});return t+n+t}}.call(this,/['"]|\\(?:([0-3]?[0-7]{2}|[1-7]|0(?=[89]))|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|([xu])|[\\0bfnrtv]|[^\n\S]|([\w\W]))?/g);function Y(e){var t,n,i;t=0/0;while(n=r.exec(e)){t<=(i=n[0].length-1)||(t=i)}return t}r=/\n(?!$)[^\n\S]*/gm;function z(e,t){if(t){return e.replace(z[t]||(z[t]=RegExp("\\n[^\\n\\S]{1,"+t+"}","g")),"\n")}else{return e}}s=function(e){return e.replace(/\n[^\n\S]*/g,"")};o=function(e){return e.replace(/\n/g,"\\n")};a=function(e){return e.replace(/\\/g,"\\\\")};u=function(e){return e.repl
|
||
|
// fallthrough
|
||
|
case!((r==="ID"||r==="STRNUM"||r==="LITERAL")&&","===((a=e[t+2])!=null?a[0]:void 8)):h(0,t+=2);++t;continue;case!((r==="("||r==="["||r==="{")&&","===((u=e[l=1+te(e,t+1)])!=null?u[0]:void 8)):h(0,l);++t;continue}ee(e,t+1,c,h)}function c(t,n){var r,s;r=t[0];s=i;if(i===r||i==="THEN"&&r==="SWITCH"){i=""}switch(r){case"NEWLINE":return t[1]!==";";case"DOT":case"?":case",":case"PIPE":case"BACKPIPE":return e[n-1].eol;case"ELSE":return s==="THEN";case"CATCH":return s==="TRY";case"FINALLY":return s==="TRY"||s==="CATCH"||s==="THEN";case"CASE":case"DEFAULT":return s==="CASE"||s==="THEN"}}function h(t,n){var i;i=e[n-1];e.splice(i[0]===","?n-1:n,0,(o[2]=i[2],o[3]=i[3],o))}}function X(e){var t,n,i,r,s,o,a,u,l,c,h;t=0;n=[];while(i=e[++t]){if(i[1]==="do"&&e[t+1][0]==="INDENT"){r=te(e,t+1);if(e[r+1][0]==="NEWLINE"&&((s=e[r+2])!=null?s[0]:void 8)==="WHILE"){i[0]="DO";e[r+2].done=true;e.splice(r+1,1)}else{(i=e[1+t])[0]="(";(o=e[r])[0]=")";i.doblock=true;e.splice(t,1)}}a=i[0];u=e[t-1];a==="["&&n.push(u[0]==="DOT");if(u[0]==="]"){if(n.pop()){u.index=true}else{continue}}if(!((l=u[0])==="FUNCTION"||l==="GENERATOR"||l==="LET"||l==="WHERE"||u.spaced&&W(e,t,true))){continue}if(i.doblock){i[0]="CALL(";o[0]=")CALL";continue}if(!f(i)){continue}if(a==="CREMENT"){if(i.spaced||!ie((l=e[t+1])!=null?l[0]:void 8,B)){continue}}c=h=false;e.splice(t++,0,["CALL(","",i[2],i[3]]);ee(e,t,p,d)}function f(e){var t;t=e[0];return ie(t,$)||!e.spaced&&(t==="+-"||t==="CLONE")}function p(t,n){var i,r,s;i=t[0];if(i==="POST_IF"||i==="PIPE"||i==="BACKPIPE"){return true}if(!c){if(t.alias&&((r=t[1])==="&&"||r==="||"||r==="xor")||(i==="TO"||i==="BY"||i==="IMPLEMENTS")){return true}}s=e[n-1];switch(i){case"NEWLINE":return s[0]!==",";case"DOT":case"?":return!c&&(s.spaced||s[0]==="DEDENT");case"SWITCH":h=true;
|
||
|
// fallthrough
|
||
|
case"IF":case"CLASS":case"FUNCTION":case"GENERATOR":case"LET":case"WITH":case"CATCH":c=true;break;case"CASE":if(h){c=true}else{return true}break;case"INDENT":if(c){return c=false}return!ie(s[0],U);case"WHILE":if(t.done){return false}
|
||
|
// fallthrough
|
||
|
case"FOR":c=true;return W(e,n)||s[0]==="CREMENT"||s[0]==="..."&&s.spaced}return false}function d(t,n){e.splice(n,0,[")CALL","",e[n-1][2],e[n-1][3]])}}function Z(e){var t,n,i,r,s,o,a,u,l,c,h;t=[];n=0;while(i=e[++n]){if(":"!==(r=i[0])){switch(false){case!ie(r,I):s=t.pop();break;case!ie(r,T):if(r==="INDENT"&&e[n-1][0]==="{"){r="{"}t.push([r,n])}continue}o=e[n-1][0]===")";a=o?s[1]:n-1;u=e[a-1];if(!((c=u[0])===":"||c==="ASSIGN"||c==="IMPORT"||((l=t[t.length-1])!=null?l[0]:void 8)!=="{")){continue}t.push(["{"]);h=!u.doblock&&((c=u[0])!=="NEWLINE"&&c!=="INDENT");while(((c=e[a-2])!=null?c[0]:void 8)==="COMMENT"){a-=2}e.splice(a,0,["{","{",e[a][2],e[a][3]]);ee(e,++n+1,f,p)}function f(t,n){var i,r,s,o;switch(i=t[0]){case",":break;case"NEWLINE":if(h){return true}break;case"DEDENT":return true;case"POST_IF":case"FOR":case"WHILE":return h;default:return false}s=(r=e[n+1])!=null?r[0]:void 8;return s!==(i===","?"NEWLINE":"COMMENT")&&":"!==((o=e[s==="("?1+te(e,n+1):n+2])!=null?o[0]:void 8)}function p(t,n){e.splice(n,0,["}","",t[2],t[3]])}}function Q(e){var t,n,r,s,o,a,u,l,c,f,p,d,g,m,y,v,b,w,k,L,A,E,C,S,R,N,_;t=0;while(r=e[++t]){switch(r[0]){case"STRNUM":if(~"-+".indexOf(s=r[1].charAt(0))){r[1]=r[1].slice(1);e.splice(t++,0,["+-",s,r[2],r[3]])}if(r.callable){continue}break;case"TO":case"TIL":if(!(e[t-1][0]==="["&&(e[t+2][0]==="]"&&((u=e[t+1][1].charAt(0))==="'"||u==='"'||+e[t+1][1]>=0)||e[t+2][0]==="BY"&&((o=e[t+3])!=null?o[0]:void 8)==="STRNUM"&&((a=e[t+4])!=null?a[0]:void 8)==="]"))){continue}if(e[t+2][0]==="BY"){e[t+2][0]="RANGE_BY"}r.op=r[1];n=0;
|
||
|
// fallthrough
|
||
|
case"RANGE":l=r[2];c=r[3];if(n!=null||e[t-1][0]==="["&&e[t+1][0]==="STRNUM"&&(e[t+2][0]==="]"&&((p=e[t+1][1].charAt(0))==="'"||p==='"'||+e[t+1][1]>=0)||e[t+2][0]==="RANGE_BY"&&((u=e[t+3])!=null?u[0]:void 8)==="STRNUM"&&((f=e[t+4])!=null?f[0]:void 8)==="]")){if(n==null){p=H(r[1],l),n=p[0],d=p[1]}p=H(e[t+1][1],l),g=p[0],m=p[1];if(g==null||d^m){F('bad "to" in range',l)}y=1;if(v=((p=e[t+2])!=null?p[0]:void 8)==="RANGE_BY"){if(!(y=+((b=e[t+3])!=null?b[1]:void 8))){F('bad "by" in range',e[t+2][2])}}else if(n>g){y=-1}w=[];k=d?h:String;L=T;if(r.op==="to"){for(A=n;y<0?A>=g:A<=g;A+=y){E=A;L()}}else{for(A=n;y<0?A>g:A<g;A+=y){E=A;L()}}w.pop()||F("empty range",l);e.splice.apply(e,[t,2+2*v].concat(j(w)));t+=w.length-1}else{r[0]="STRNUM";if(((C=e[t+2])!=null?C[0]:void 8)==="RANGE_BY"){e.splice(t+2,1,["BY","by",l,c])}e.splice(t+1,0,["TO",r.op,l,c])}n=null;break;case"WORDS":w=[["[","[",l=r[2],c=r[3]]];for(A=0,R=(S=r[1].match(/\S+/g)||"").length;A<R;++A){N=S[A];w.push(["STRNUM",i("'",N,l),l,c],[",",",",l,c])}e.splice.apply(e,[t,1].concat(j(w),[["]","]",l,c]]));t+=w.length;break;case"INDENT":if(_=e[t-1]){if(_[1]==="new"){e.splice(t++,0,["PARAM(","",r[2],r[3]],[")PARAM","",r[2],r[3]],["->","",r[2],r[3]])}else if((S=_[0])==="FUNCTION"||S==="GENERATOR"||S==="LET"){e.splice(t,0,["CALL(","",r[2],r[3]],[")CALL","",r[2],r[3]]);t+=2}}continue;case"LITERAL":case"}":break;case")":case")CALL":if(r[1]){continue}break;case"]":if(r.index){continue}break;case"CREMENT":if(!W(e,t)){continue}break;case"BIOP":if(!r.spaced&&((S=r[1])==="+"||S==="-")&&e[t+1][0]!==")"){e[t][0]="+-"}continue;default:continue}if(r.spaced&&ie(e[t+1][0],$)){e.splice(++t,0,[",",",",r[2],r[3]])}}function T(){if(65536<w.push(["STRNUM",k(E),l,c],[",",",",l,c])){F("range limit exceeded",l)}}}function ee(e,t,n,i){var r,s,o;r=0;for(;s=e[t];++t){if(!r&&n(s,t)){return i(s,t)}o=s[0];if(0>(r+=ie(o,T)||-ie(o,I))){return i(s,t)}}}function te(e,t){var n,i,r,s;n=1;i=x[r=e[t][0]];while(s=e[++t]){switch(s[0]){case r:++n;break;case i:if(!--n){return t}}}return-1}f=["true","false","null","this","void","super","return","throw","break","continue","if","else","for","while","switch","case","default","try","catch","finally","function","class","extends","implements","new","do","delete","typeof","in","instanceof","let","with","var","const","import","export","debugger","yield"];p=["enum","interface","package","private","protected","public","static"];d=f.concat(p);g=["xor","match","where"];m=/((?!\s)[a-z_$\xAA-\uFFDC](?:(?!\s)[\w$\xAA-\uFFDC]|-[a-z])*)([^\n\S]*:(?![:=]))?|/gi;y=/[-\/^]=|[%+:*]{1,2}=|\|>=|\.(?:[&\|\^]|<<|>>>?)\.=?|\.{1,3}|\^\^|\*?<(?:--?|~~?)!?|!?(?:--?|~~?)>>?\*?|([-+&|:])\1|%%|&|\([^\n\S]*\)|[!=]==?|!?\~=|@@?|<\[(?:[\s\S]*?\]>)?|<<<<?|<\||[<>]==|<<=|>>=|<<|>>|[<>]\??=?|\|>|\||=>|\*\*|\^|`|[^\s#]?/g;v=/[^\n\S]*(?:#.*)?/g;b=/(?:\s*#.*)*(?:\n([^\n\S]*))*/g;w=/'[^\\']*(?:\\[\s\S][^\\']*)*'|/g;k=/``[^\\`]*(?:\\[\s\S][^\\`]*)*``|/g;L=RegExp("\\\\(?:(\\S[^\\s,;)}\\]]*)|(?:"+v.source+"\\n?)*)","g");A=/0x[\dA-Fa-f][\dA-Fa-f_]*|(\d*)~([\dA-Za-z]\w*)|((\d[\d_]*)(\.\d[\d_]*)?(?:e[+-]?\d[\d_]*)?)[$\w]*|/g;E=/_+/g;C=/\/([^[\/\n\\]*(?:(?:\\.|\[[^\]\n\\]*(?:\\.[^\]\n\\]*)*\])[^[\/\n\\]*)*)\/([gimy]{1,4}|\$?)|/g;S=/\s+(?:#.*)?/g;R=/\n[^\n\S]*$/;N=/[^\n\S]*[^#\s]?/g;_=/[\x80-\uFFFF]/;T=["(","[","{","CALL(","PARAM(","INDENT"];I=[")","]","}",")CALL",")PARAM","DEDENT"];x=re(function(){var e,t,n,i={};for(e=0,n=(t=T).length;e<n;++e){O=e;M=t[e];i[M]=I[O]}return i}(),function(){var e,t,n,i={};for(e=0,n=(t=I).length;e<n;++e){O=e;P=t[e];i[P]=T[O]}return i}());B=["(","{","[","ID","STRNUM","LITERAL","LET","WITH","WORDS"];$=B.concat(["...","UNARY","YIELD","CREMENT","PARAM(","FUNCTION","GENERATOR","IF","SWITCH","TRY","CLASS","RANGE","LABEL","DECL","DO","BIOPBP"]);U=[",",":","->","ELSE","ASSIGN","IMPORT","UNARY","DEFAULT","TRY","FINALLY","HURL","DECL","DO","LET","FUNCTION","GENERATOR","..."];function ne(e){function t(){}t.prototype=e;return new t}function ie(e,t){var n=-1,i=t.length>>>0;while(++n<i)if(e===t[n])return true;return false}function re(e,t){var n={}.hasOwnProperty;for(var i in t)if(n.call(t,i))e[i]=t[i];return
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
t.exports=function(t){var o,a,u;o=e("fs");a=e("path");u=e("events");t.run=function(s,u,l){var c,h,f,p,d,g,m,y;if(u!=null){c=u.filename}h=l!=null?l:{},f=h.js,p=h.context;d=e.main;g=c?a.dirname(o.realpathSync(c=a.resolve(c))):c=".";d.paths=d.constructor._nodeModulePaths(g);d.filename=c;if(!f){s=t.compile(s,(h={},r(h,u),h.bare=true,h));if(m=s.code){s=m}}if(p){n.__runContext=p;s="return (function() {\n"+s+"\n}).call(global.__runContext);"}c+="(js)";try{return d._compile(s,c)}catch(v){y=v;throw i(y,s,c)}};s(t,u.EventEmitter.prototype);e.extensions[".ls"]=function(e,n){var r,s,a;r=o.readFileSync(n,"utf8");s=".json.ls"===n.substr(-8)?"module.exports = "+t.compile(r,{filename:n,json:true}):t.compile(r,{filename:n,bare:true,map:"embedded"}).code;try{return e._compile(s,n)}catch(u){a=u;throw i(a,s,n)}}};function i(e,t,n){var i,r,s,o,a,u,l,c,h,f,p,d,g,m;if(e!=null){i=e.stack}if(!i){return e}r=i.split("\n");if(!(r.length>1)){return e}for(s=0,o=r.length;s<o;++s){a=s;u=r[s];if(0>(l=u.indexOf("("+n+":"))){continue}c=(/:(\d+):/.exec(u.slice(l+n.length))||"")[1];if(!(c=+c)){continue}h=c+4;f=(""+h).length;p||(p=t.split("\n"));for(d=1>(g=c-4)?1:g;d<=h;++d){m=d;r[a]+="\n"+(" "+m).slice(-f)+""+"|+".charAt(m===c)+" "+[p[m-1]]}}return e.stack=r.join("\n"),e}function r(e,t){var n={}.hasOwnProperty;for(var i in t)if(n.call(t,i))e[i]=t[i];return e}function s(e,t){for(var n in t)e[n]=t[n];return e}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{events:10,fs:8,path:13}],5:[function(e,t,n){(function(i){/* parser generated by jison 0.4.18 */
|
||
|
/*
|
||
|
Returns a Parser object of the following structure:
|
||
|
|
||
|
Parser: {
|
||
|
yy: {}
|
||
|
}
|
||
|
|
||
|
Parser.prototype: {
|
||
|
yy: {},
|
||
|
trace: function(),
|
||
|
symbols_: {associative list: name ==> number},
|
||
|
terminals_: {associative list: number ==> name},
|
||
|
productions_: [...],
|
||
|
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
|
||
|
table: [...],
|
||
|
defaultActions: {...},
|
||
|
parseError: function(str, hash),
|
||
|
parse: function(input),
|
||
|
|
||
|
lexer: {
|
||
|
EOF: 1,
|
||
|
parseError: function(str, hash),
|
||
|
setInput: function(input),
|
||
|
input: function(),
|
||
|
unput: function(str),
|
||
|
more: function(),
|
||
|
less: function(n),
|
||
|
pastInput: function(),
|
||
|
upcomingInput: function(),
|
||
|
showPosition: function(),
|
||
|
test_match: function(regex_match_array, rule_index),
|
||
|
next: function(),
|
||
|
lex: function(),
|
||
|
begin: function(condition),
|
||
|
popState: function(),
|
||
|
_currentRules: function(),
|
||
|
topState: function(),
|
||
|
pushState: function(condition),
|
||
|
|
||
|
options: {
|
||
|
ranges: boolean (optional: true ==> token location info will include a .range[] member)
|
||
|
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
|
||
|
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
|
||
|
},
|
||
|
|
||
|
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
|
||
|
rules: [...],
|
||
|
conditions: {associative list: name ==> set},
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
token location info (@$, _$, etc.): {
|
||
|
first_line: n,
|
||
|
last_line: n,
|
||
|
first_column: n,
|
||
|
last_column: n,
|
||
|
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
|
||
|
}
|
||
|
|
||
|
|
||
|
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
|
||
|
text: (matched text)
|
||
|
token: (the produced terminal token, if any)
|
||
|
line: (yylineno)
|
||
|
}
|
||
|
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
|
||
|
loc: (yylloc)
|
||
|
expected: (string describing the set of expected tokens)
|
||
|
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
|
||
|
}
|
||
|
*/
|
||
|
var r=function(){var e=function(e,t,n,i){for(n=n||{},i=e.length;i--;n[e[i]]=t);return n},t=[2,60],n=[1,31],i=[1,34],r=[1,35],s=[1,36],o=[1,37],a=[1,38],u=[1,8],l=[1,15],c=[1,14],h=[1,39],f=[1,41],p=[1,29],d=[1,6],g=[1,10],m=[1,9],y=[1,11],v=[1,16],b=[1,17],w=[1,18],k=[1,19],L=[1,20],A=[1,21],E=[1,22],C=[1,23],S=[1,44],R=[1,24],N=[1,25],_=[1,26],T=[1,27],I=[1,28],x=[1,30],O=[1,43],M=[1,45],P=[1,20,25,47],B=[20,47],$=[2,64],U=[1,49],D=[1,50],j=[1,51],F=[1,52],W=[1,53],Y=[1,54],z=[1,55],G=[1,56],H=[1,57],J=[1,58],q=[1,59],K=[1,60],V=[1,61],X=[1,62],Z=[1,63],Q=[30,46,47,48],ee=[2,50],te=[1,68],ne=[1,67],ie=[1,12,19,20,22,24,25,26,30,33,34,35,46,47,48,58,59,62,63,64,65,66,67,68,69,70,71,72,79,81,82,102,105],re=[2,75],se=[1,77],oe=[1,78],ae=[1,73],ue=[1,79],le=[1,71],ce=[1,72],he=[1,74],fe=[1,75],pe=[1,83],de=[1,87],ge=[1,86],me=[1,84],ye=[1,95],ve=[1,109],be=[48,105],we=[2,201],ke=[1,113],Le=[2,1],Ae=[1,9,12,13,19,20,22,24,25,26,30,32,33,34,35,37,46,47,48,56,57,58,59,62,63,64,65,66,67,68,69,70,71,72,73,79,81,82,96,102,103,104,105],Ee=[2,2],Ce=[19,46,47,48],Se=[1,120],Re=[1,119],Ne=[22,46,47],_e=[2,156],Te=[1,130],Ie=[1,125],xe=[1,128],Oe=[1,129],Me=[25,47],Pe=[1,9,12,13,19,20,22,24,25,26,30,32,33,34,35,37,46,47,48,56,57,58,59,62,63,64,65,66,67,68,69,70,71,72,73,79,81,82,96,99,102,103,104,105],Be=[30,47,48],$e=[2,58],Ue=[1,169],De=[12,19,20,30,46,47,48],je=[2,55],Fe=[2,71],We=[12,46,47,48],Ye=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,58,59,62,63,64,66,67,68,70,71,72,79,81,82,102,105],ze=[20,46,47,48],Ge=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,79,81,82,102,105],He=[1,206],Je=[1,12,19,20,22,24,25,26,30,33,34,35,46,47,48,58,59,62,63,64,65,66,67,68,69,70,71,72,79,81,102,105],qe=[1,209],Ke=[46,48,82],Ve=[2,203],Xe=[1,215],Ze=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,71,72,79,81,82,102,105],Qe=[19,47,48],et=[1,227],tt=[20,22,46,47],nt=[9,13,20,22,32,33,37,46,47,56,57,58,59,62,63,64,65,66,67,68,69,70,71,72,73,79,96],it=[2,165],rt=[1,251],st=[19,20,22,47,48,81,102],ot=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,58,62,63,66,67,68,70,71,72,79,81,82,102,105],at=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,63,67,71,72,79,81,82,102,105],ut=[1,12,19,20,22,24,25,26,30,34,35,46,47,48,62,63,67,70,71,72,79,81,82,102,105],lt=[1,264],ct=[1,265],ht=[2,59],ft=[12,47,48],pt=[20,47,48],dt=[1,302],gt=[1,303],mt=[1,311],yt=[4,7,14,16,21,23,29,31,32,38,41,44,48,49,59,60,61,75,76,77,78,80,81,83,84,85,90,93,97,102],vt=[1,336],bt=[1,337],wt=[1,12,19,20,22,24,25,26,30,33,34,35,46,47,48,58,59,62,63,64,65,66,67,68,69,70,71,72,79,81,82,88,89,102,105],kt=[2,46],Lt=[1,369];var At={trace:function Ct(){},yy:{},symbols_:{error:2,Chain:3,ID:4,KeyLike:5,List:6,LITERAL:7,Index:8,"CALL(":9,ArgList:10,OptComma:11,")CALL":12,"?":13,LET:14,Block:15,"[":16,Expression:17,LoopHeads:18,"]":19,DEDENT:20,"{":21,"}":22,"(":23,BIOP:24,")":25,BIOPR:26,BIOPBP:27,BIOPP:28,"PARAM(":29,")PARAM":30,UNARY:31,CREMENT:32,BACKTICK:33,TO:34,BY:35,FROM:36,DOT:37,WITH:38,LoopHead:39,Else:40,STRNUM:41,Parenthetical:42,Properties:43,LABEL:44,Arg:45,",":46,NEWLINE:47,INDENT:48,"...":49,Lines:50,Line:51,"<-":52,COMMENT:53,REQUIRE:54,SplatChain:55,CLONEPORT:56,ASSIGN:57,IMPORT:58,"+-":59,CLONE:60,YIELD:61,COMPARE:62,LOGIC:63,MATH:64,POWER:65,SHIFT:66,BITWISE:67,CONCAT:68,COMPOSE:69,RELATION:70,PIPE:71,BACKPIPE:72,"!?":73,"->":74,FUNCTION:75,GENERATOR:76,ASYNC:77,IF:78,POST_IF:79,DO:80,WHILE:81,CASE:82,HURL:83,JUMP:84,SWITCH:85,Exprs:86,Cases:87,DEFAULT:88,ELSE:89,TRY:90,CATCH:91,FINALLY:92,CLASS:93,OptExtends:94,OptImplements:95,EXTENDS:96,DECL:97,KeyColon:98,":":99,Property:100,Body:101,FOR:102,IN:103,OF:104,IMPLEMENTS:105,Root:106,$accept:0,$end:1},terminals_:{2:"error",4:"ID",7:"LITERAL",9:"CALL(",12:")CALL",13:"?",14:"LET",16:"[",19:"]",20:"DEDENT",21:"{",22:"}",23:"(",24:"BIOP",25:")",26:"BIOPR",27:"BIOPBP",28:"BIOPP",29:"PARAM(",30:")PARAM",31:"UNARY",32:"CREMENT",33:"BACKTICK",34:"TO",35:"BY",36:"FROM",37:"DOT",38:"WITH",41:"STRNUM",44:"LABEL",46:",",47:"NEWLINE",48:"INDENT",49:"...",52:"<-",53:"COMMENT",54:"REQUIRE",56:"CLONEPORT",57:"ASSIGN",58:"IMPORT",59:"+-",60:"CLONE",61:"YIELD",62:"COM
|
||
|
var a=s.length-1;switch(r){case 1:this.$=i.L(o[a],o[a],i.Chain(i.L(o[a],o[a],i.Var(s[a]))));break;case 2:case 3:this.$=i.L(o[a],o[a],i.Chain(s[a]));break;case 4:this.$=i.L(o[a],o[a],i.Chain(i.L(o[a],o[a],i.Literal(s[a]))));break;case 5:this.$=i.L(o[a-1],o[a],s[a-1].add(s[a]));break;case 6:this.$=i.L(o[a-4],o[a],s[a-4].add(i.L(o[a-3],o[a],i.Call(s[a-2]))));break;case 7:this.$=i.L(o[a-1],o[a],i.Chain(i.L(o[a-1],o[a],i.Existence(s[a-1].unwrap()))));break;case 8:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-5],o[a-1],i.Call["let"](s[a-3],s[a]))));break;case 9:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-3],o[a],s[a-1][0].makeComprehension(s[a-2],s[a-1].slice(1)))));break;case 10:this.$=i.L(o[a-4],o[a],i.Chain(i.L(o[a-4],o[a],s[a-2][0].makeComprehension(s[a-3],s[a-2].slice(1)))));break;case 11:this.$=i.L(o[a-6],o[a],i.Chain(i.L(o[a-6],o[a],s[a-1][0].addObjComp().makeComprehension(i.L(o[a-4],o[a-4],i.Arr(s[a-4])),s[a-1].slice(1)))));break;case 12:case 18:case 20:this.$=i.L(o[a-2],o[a],i.Chain(i.L(o[a-1],o[a-1],i.Binary(s[a-1]))));break;case 13:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-2],o[a-2],i.Binary(s[a-2],void 8,s[a-1]))));break;case 14:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-1],o[a-1],i.Binary(s[a-1],s[a-2]))));break;case 15:this.$=i.L(o[a-2],o[a],i.Chain(i.L(o[a-1],o[a-1],"!"===s[a-1].charAt(0)?i.Binary(s[a-1].slice(1)).invertIt():i.Binary(s[a-1]))));break;case 16:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-2],o[a-2],"!"===s[a-2].charAt(0)?i.Binary(s[a-2].slice(1),void 8,s[a-1]).invertIt():i.Binary(s[a-2],void 8,s[a-1]))));break;case 17:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-1],o[a-1],"!"===s[a-1].charAt(0)?i.Binary(s[a-1].slice(1),s[a-2]).invertIt():i.Binary(s[a-1],s[a-2]))));break;case 19:this.$=i.L(o[a-6],o[a],i.Chain(i.L(o[a-5],o[a-5],i.Binary(s[a-5],void 8,s[a-3]))));break;case 21:this.$=i.L(o[a-6],o[a],i.Chain(i.L(o[a-1],o[a-1],i.Binary(s[a-1],s[a-4]))));break;case 22:case 23:this.$=i.L(o[a-2],o[a],i.Chain(i.L(o[a-1],o[a-1],i.Unary(s[a-1]))));break;case 24:this.$=i.L(o[a-4],o[a],i.Chain(s[a-2]));break;case 25:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-4],o[a-1],s[a-2].add(i.L(o[a-4],o[a-4],i.Call([s[a-4]]))))));break;case 26:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-3],o[a-3],i.Chain(i.Var("flip$"))).add(i.L(o[a-3],o[a-3],i.Call([s[a-3]])))).flipIt().add(i.L(o[a-1],o[a-1],i.Call([s[a-1]]))));break;case 27:this.$=i.L(o[a-4],o[a],i.Chain(i.L(o[a-3],o[a-1],new i.For({from:s[a-3],op:s[a-2],to:s[a-1],inComprehension:true}))));break;case 28:this.$=i.L(o[a-6],o[a],i.Chain(i.L(o[a-5],o[a-1],new i.For({from:s[a-5],op:s[a-4],to:s[a-3],step:s[a-1],inComprehension:true}))));break;case 29:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-4],o[a-1],new i.For({from:s[a-3],op:s[a-2],to:s[a-1],inComprehension:true}))));break;case 30:this.$=i.L(o[a-7],o[a],i.Chain(i.L(o[a-6],o[a-1],new i.For({from:s[a-5],op:s[a-4],to:s[a-3],step:s[a-1],inComprehension:true}))));break;case 31:this.$=i.L(o[a-3],o[a],i.Chain(i.L(o[a-2],o[a-1],new i.For({from:i.Chain(i.Literal(0)),op:s[a-2],to:s[a-1],inComprehension:true}))));break;case 32:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-4],o[a-1],new i.For({from:i.Chain(i.Literal(0)),op:s[a-4],to:s[a-3],step:s[a-1],inComprehension:true}))));break;case 33:this.$=i.L(o[a-8],o[a],i.Chain(i.L(o[a-8],o[a],new i.StepSlice({op:s[a-4],target:s[a-8],from:s[a-5],to:s[a-3],step:s[a-1]}))));break;case 34:this.$=i.L(o[a-7],o[a],i.Chain(i.L(o[a-7],o[a],new i.StepSlice({op:s[a-4],target:s[a-7],from:i.Literal(0),to:s[a-3],step:s[a-1]}))));break;case 35:this.$=i.L(o[a-6],o[a],i.Chain(i.L(o[a-6],o[a],i.Slice({type:s[a-2],target:s[a-6],from:s[a-3],to:s[a-1]}))));break;case 36:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-5],o[a],i.Slice({type:s[a-1],target:s[a-5],from:s[a-2]}))));break;case 37:this.$=i.L(o[a-5],o[a],i.Chain(i.L(o[a-5],o[a],i.Slice({type:s[a-2],target:s[a-5],to:s[a-1]}))));break;case 38:this.$=i.L(o[a-4],o[a],i.Chain(i.L(o[a-4],o[a],i.Slice({type:s[a-1],target:s[a-4]}))));break;case 39:this.$=i.L(o[a-2],o[a],i.Chain(i.L(o[a-2],o[a-1],i.Cascade(s[a-1],s[a],"with"))));break;case 40:this.$=i.L(o[a-2],o[a],i.Chain(s[a-2].addBody(s[a-1]).addElse(s[a])));break;case
|
||
|
65:z,69:q}),e(ot,[2,106],{33:U,59:j,64:Y,65:z,69:q}),e(at,[2,107],{33:U,58:D,59:j,62:F,64:Y,65:z,66:G,68:J,69:q,70:K}),e(ut,[2,108],{33:U,58:D,59:j,64:Y,65:z,66:G,68:J,69:q}),e([1,12,19,20,22,24,25,26,30,34,35,46,47,48,58,59,62,63,64,65,66,67,68,70,71,72,79,81,82,102,105],[2,109],{33:U,69:q}),e(ut,[2,110],{33:U,58:D,59:j,64:Y,65:z,66:G,68:J,69:q}),e(Ze,[2,111],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K}),e(Ge,[2,112],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K,71:V,72:X}),e(Ge,[2,120],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K,71:V,72:X}),{30:[1,263],47:lt,48:ct},e([12,19,20,30,47,48],ht,{3:12,55:13,5:32,6:33,39:40,42:42,17:66,45:266,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(De,[2,56],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K,71:V,72:X,79:Z}),e(ie,re,{8:76,9:se,13:oe,32:Fe,57:Fe,37:ue,56:le,73:he,96:fe}),e(Be,$e,{11:267,46:Ue}),e(ot,[2,72],{33:U,59:j,64:Y,65:z,69:q}),e(ie,[2,73]),e(Ge,[2,76],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K,71:V,72:X}),e(ze,ee,{3:12,55:13,5:32,6:33,39:40,42:42,45:65,17:66,10:268,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(Ze,[2,143],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K}),e(ft,$e,{11:269,46:Ue}),e(Ce,ee,{3:12,55:13,5:32,6:33,39:40,42:42,45:65,10:121,17:270,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,34:[1,271],38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(Ae,[2,43]),e(Ae,[2,44]),e(Ae,[2,45]),e(Ne,_e,{3:12,55:13,6:33,39:40,42:42,43:123,100:124,98:126,17:127,5:131,4:Te,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,48:Ie,49:xe,53:Oe,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(Me,t,{50:3,15:4,51:5,17:7,3:12,55:13,5:32,6:33,39:40,42:42,101:141,4:n,7:i,14:r,16:s,21:o,23:a,29:u,31:l,32:c,38:h,41:f,44:p,48:d,49:g,53:m,54:y,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(Ge,[2,77],{33:U,58:D,59:j,62:F,63:W,64:Y,65:z,66:G,67:H,68:J,69:q,70:K,71:V,72:X}),e(ie,[2,83],{8:76,9:se,13:oe,37:ue}),e(ie,[2,85],{8:76,9:se,13:oe,37:ue}),{3:272,4:n,5:32,6:33,7:i,14:r,16:s,21:o,23:a,38:h,39:40,41:f,42:42,81:S,102:O},e(Ye,[2,94],{33:U,65:z,69:q}),e(ze,ee,{3:12,55:13,5:32,6:33,39:40,42:42,45:65,17:66,10:273,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(pt,$e,{11:274,46:Ue}),e(ie,[2,86],{8:76,9:se,13:oe,37:ue}),{3:275,4:n,5:32,6:33,7:i,14:r,16:s,21:o,23:a,38:h,39:40,41:f,42:42,81:S,102:O},e(Ye,[2,95],{33:U,65:z,69:q}),e(ie,[2,87],{8:76,9:se,13:oe,37:ue}),{3:276,4:n,5:32,6:33,7:i,14:r,16:s,21:o,23:a,38:h,39:40,41:f,42:42,81:S,102:O},e(Ye,[2,96],{33:U,65:z,69:q}),e(ft,$e,{11:277,46:Ue}),e(ft,$e,{11:278,46:Ue}),e(We,ee,{3:12,55:13,5:32,6:33,39:40,42:42,45:65,17:66,10:279,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(We,ee,{3:12,55:13,5:32,6:33,39:40,42:42,45:65,17:66,10:280,4:n,7:i,14:r,16:s,21:o,23:a,29:te,31:l,32:c,38:h,41:f,44:p,49:ne,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O}),e(ie,it,{40:281,89:rt}),{3:12,4:n,5:32,6:33,7:i,14:r,16:s,17:282,21:o,23:a,29:te,31:l,32:c,38:h,39:40,41:f,42:42,44:p,49:ye,55:13,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O},e(pt,$e,{11:283,46:Ue}),e(Je,[2,128],{82:qe,88:[1,284],89:[1,285]}),{3:12,4:n,5:32,6:33,7:i,14:r,16:s,17:286,21:o,23:a,29:te,31:l,32:c,38:h,39:40,41:f,42:42,44:p,49:ye,55:13,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S,83:R,84:N,85:_,90:T,93:I,97:x,102:O},{15:287,48:d},{15:288,48:d},{3:12,4:n,5:32,6:33,7:i,14:r,16:s,17:108,21:o,23:a,29:te,31:l,32:c,38:h,39:40,41:f,42:42,44:p,49:ye,55:13,59:v,60:b,61:w,75:k,76:L,77:A,78:E,80:C,81:S
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
var i,r,s;i=e("path");r=function(e){var t;if(t=/^['"](.*)['"]$/.exec(e.trim())){return t[1]}else{return e}};s=function(e){return i.basename(r(e)).split(".")[0].replace(/-[a-z]/gi,function(e){return e.charAt(1).toUpperCase()})};t.exports={nameFromPath:s,stripString:r}},{path:13}],7:[function(e,t,n){"use strict";n.byteLength=c;n.toByteArray=f;n.fromByteArray=g;var i=[];var r=[];var s=typeof Uint8Array!=="undefined"?Uint8Array:Array;var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var a=0,u=o.length;a<u;++a){i[a]=o[a];r[o.charCodeAt(a)]=a}
|
||
|
// Support decoding URL-safe base64 strings, as Node.js does.
|
||
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
||
|
r["-".charCodeAt(0)]=62;r["_".charCodeAt(0)]=63;function l(e){var t=e.length;if(t%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}
|
||
|
// Trim off extra bytes after placeholder bytes are found
|
||
|
// See: https://github.com/beatgammit/base64-js/issues/42
|
||
|
var n=e.indexOf("=");if(n===-1)n=t;var i=n===t?0:4-n%4;return[n,i]}
|
||
|
// base64 is 4/3 + up to two characters of the original data
|
||
|
function c(e){var t=l(e);var n=t[0];var i=t[1];return(n+i)*3/4-i}function h(e,t,n){return(t+n)*3/4-n}function f(e){var t;var n=l(e);var i=n[0];var o=n[1];var a=new s(h(e,i,o));var u=0;
|
||
|
// if there are placeholders, only get up to the last complete 4 chars
|
||
|
var c=o>0?i-4:i;for(var f=0;f<c;f+=4){t=r[e.charCodeAt(f)]<<18|r[e.charCodeAt(f+1)]<<12|r[e.charCodeAt(f+2)]<<6|r[e.charCodeAt(f+3)];a[u++]=t>>16&255;a[u++]=t>>8&255;a[u++]=t&255}if(o===2){t=r[e.charCodeAt(f)]<<2|r[e.charCodeAt(f+1)]>>4;a[u++]=t&255}if(o===1){t=r[e.charCodeAt(f)]<<10|r[e.charCodeAt(f+1)]<<4|r[e.charCodeAt(f+2)]>>2;a[u++]=t>>8&255;a[u++]=t&255}return a}function p(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[e&63]}function d(e,t,n){var i;var r=[];for(var s=t;s<n;s+=3){i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255);r.push(p(i))}return r.join("")}function g(e){var t;var n=e.length;var r=n%3;// if we have 1 byte left, pad 2 bytes
|
||
|
var s=[];var o=16383;// must be multiple of 3
|
||
|
// go through the array every three bytes, we'll deal with trailing stuff later
|
||
|
for(var a=0,u=n-r;a<u;a+=o){s.push(d(e,a,a+o>u?u:a+o))}
|
||
|
// pad the end with zeros, but make sure to not forget the extra bytes
|
||
|
if(r===1){t=e[n-1];s.push(i[t>>2]+i[t<<4&63]+"==")}else if(r===2){t=(e[n-2]<<8)+e[n-1];s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")}return s.join("")}},{}],8:[function(e,t,n){},{}],9:[function(e,t,n){(function(t){/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
|
* @license MIT
|
||
|
*/
|
||
|
/* eslint-disable no-proto */
|
||
|
"use strict";var i=e("base64-js");var r=e("ieee754");var s=e("isarray");n.Buffer=l;n.SlowBuffer=b;n.INSPECT_MAX_BYTES=50;/**
|
||
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
||
|
* === true Use Uint8Array implementation (fastest)
|
||
|
* === false Use Object implementation (most compatible, even IE6)
|
||
|
*
|
||
|
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
|
||
|
* Opera 11.6+, iOS 4.2+.
|
||
|
*
|
||
|
* Due to various browser bugs, sometimes the Object implementation will be used even
|
||
|
* when the browser supports typed arrays.
|
||
|
*
|
||
|
* Note:
|
||
|
*
|
||
|
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
|
||
|
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
|
||
|
*
|
||
|
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
|
||
|
*
|
||
|
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
|
||
|
* incorrect length in some situations.
|
||
|
|
||
|
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
|
||
|
* get the Object implementation, which is slower but behaves correctly.
|
||
|
*/
|
||
|
l.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:o();/*
|
||
|
* Export kMaxLength after typed array support is determined.
|
||
|
*/
|
||
|
n.kMaxLength=a();function o(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};// typed array instances can be augmented
|
||
|
// chrome 9-10 lack `subarray`
|
||
|
return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(t){return false}}function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t){throw new RangeError("Invalid typed array length")}if(l.TYPED_ARRAY_SUPPORT){
|
||
|
// Return an augmented `Uint8Array` instance, for best performance
|
||
|
e=new Uint8Array(t);e.__proto__=l.prototype}else{
|
||
|
// Fallback: Return an object instance of the Buffer class
|
||
|
if(e===null){e=new l(t)}e.length=t}return e}/**
|
||
|
* The Buffer constructor returns instances of `Uint8Array` that have their
|
||
|
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
|
||
|
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
|
||
|
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
|
||
|
* returns a single octet.
|
||
|
*
|
||
|
* The `Uint8Array` prototype remains unmodified.
|
||
|
*/
|
||
|
function l(e,t,n){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l)){return new l(e,t,n)}
|
||
|
// Common case.
|
||
|
if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return p(this,e)}return c(this,e,t,n)}l.poolSize=8192;// not used by this implementation
|
||
|
// TODO: Legacy, not needed anymore. Remove in next major version.
|
||
|
l._augment=function(e){e.__proto__=l.prototype;return e};function c(e,t,n,i){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return m(e,t,n,i)}if(typeof t==="string"){return d(e,t,n)}return y(e,t)}/**
|
||
|
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
|
||
|
* if value is a number.
|
||
|
* Buffer.from(str[, encoding])
|
||
|
* Buffer.from(array)
|
||
|
* Buffer.from(buffer)
|
||
|
* Buffer.from(arrayBuffer[, byteOffset[, length]])
|
||
|
**/
|
||
|
l.from=function(e,t,n){return c(null,e,t,n)};if(l.TYPED_ARRAY_SUPPORT){l.prototype.__proto__=Uint8Array.prototype;l.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&l[Symbol.species]===l){
|
||
|
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
|
||
|
Object.defineProperty(l,Symbol.species,{value:null,configurable:true})}}function h(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function f(e,t,n,i){h(t);if(t<=0){return u(e,t)}if(n!==undefined){
|
||
|
// Only pay attention to encoding if it's a string. This
|
||
|
// prevents accidentally sending in a number that would
|
||
|
// be interpretted as a start offset.
|
||
|
return typeof i==="string"?u(e,t).fill(n,i):u(e,t).fill(n)}return u(e,t)}/**
|
||
|
* Creates a new filled Buffer instance.
|
||
|
* alloc(size[, fill[, encoding]])
|
||
|
**/
|
||
|
l.alloc=function(e,t,n){return f(null,e,t,n)};function p(e,t){h(t);e=u(e,t<0?0:v(t)|0);if(!l.TYPED_ARRAY_SUPPORT){for(var n=0;n<t;++n){e[n]=0}}return e}/**
|
||
|
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
|
||
|
* */
|
||
|
l.allocUnsafe=function(e){return p(null,e)};/**
|
||
|
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
|
||
|
*/
|
||
|
l.allocUnsafeSlow=function(e){return p(null,e)};function d(e,t,n){if(typeof n!=="string"||n===""){n="utf8"}if(!l.isEncoding(n)){throw new TypeError('"encoding" must be a valid string encoding')}var i=w(t,n)|0;e=u(e,i);var r=e.write(t,n);if(r!==i){
|
||
|
// Writing a hex string, for example, that contains invalid characters will
|
||
|
// cause everything after the first invalid character to be ignored. (e.g.
|
||
|
// 'abxxcd' will be treated as 'ab')
|
||
|
e=e.slice(0,r)}return e}function g(e,t){var n=t.length<0?0:v(t.length)|0;e=u(e,n);for(var i=0;i<n;i+=1){e[i]=t[i]&255}return e}function m(e,t,n,i){t.byteLength;// this throws if `array` is not a valid ArrayBuffer
|
||
|
if(n<0||t.byteLength<n){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<n+(i||0)){throw new RangeError("'length' is out of bounds")}if(n===undefined&&i===undefined){t=new Uint8Array(t)}else if(i===undefined){t=new Uint8Array(t,n)}else{t=new Uint8Array(t,n,i)}if(l.TYPED_ARRAY_SUPPORT){
|
||
|
// Return an augmented `Uint8Array` instance, for best performance
|
||
|
e=t;e.__proto__=l.prototype}else{
|
||
|
// Fallback: Return an object instance of the Buffer class
|
||
|
e=g(e,t)}return e}function y(e,t){if(l.isBuffer(t)){var n=v(t.length)|0;e=u(e,n);if(e.length===0){return e}t.copy(e,0,0,n);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||te(t.length)){return u(e,0)}return g(e,t)}if(t.type==="Buffer"&&s(t.data)){return g(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){
|
||
|
// Note: cannot use `length < kMaxLength()` here because that fails when
|
||
|
// length is NaN (which is otherwise coerced to zero.)
|
||
|
if(e>=a()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+a().toString(16)+" bytes")}return e|0}function b(e){if(+e!=e){// eslint-disable-line eqeqeq
|
||
|
e=0}return l.alloc(+e)}l.isBuffer=function ne(e){return!!(e!=null&&e._isBuffer)};l.compare=function ie(e,t){if(!l.isBuffer(e)||!l.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var n=e.length;var i=t.length;for(var r=0,s=Math.min(n,i);r<s;++r){if(e[r]!==t[r]){n=e[r];i=t[r];break}}if(n<i)return-1;if(i<n)return 1;return 0};l.isEncoding=function re(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};l.concat=function se(e,t){if(!s(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return l.alloc(0)}var n;if(t===undefined){t=0;for(n=0;n<e.length;++n){t+=e[n].length}}var i=l.allocUnsafe(t);var r=0;for(n=0;n<e.length;++n){var o=e[n];if(!l.isBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(i,r);r+=o.length}return i};function w(e,t){if(l.isBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var n=e.length;if(n===0)return 0;
|
||
|
// Use a for loop to avoid recursion
|
||
|
var i=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case undefined:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(i)return V(e).length;// assume utf8
|
||
|
t=(""+t).toLowerCase();i=true}}}l.byteLength=w;function k(e,t,n){var i=false;
|
||
|
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
|
||
|
// property of a typed array.
|
||
|
// This behaves neither like String nor Uint8Array in that we set start/end
|
||
|
// to their upper/lower bounds if the value passed is out of range.
|
||
|
// undefined is handled specially as per ECMA-262 6th Edition,
|
||
|
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
|
||
|
if(t===undefined||t<0){t=0}
|
||
|
// Return early if start > this.length. Done here to prevent potential uint32
|
||
|
// coercion fail below.
|
||
|
if(t>this.length){return""}if(n===undefined||n>this.length){n=this.length}if(n<=0){return""}
|
||
|
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
|
||
|
n>>>=0;t>>>=0;if(n<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return $(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return B(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}
|
||
|
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
|
||
|
// Buffer instances.
|
||
|
l.prototype._isBuffer=true;function L(e,t,n){var i=e[t];e[t]=e[n];e[n]=i}l.prototype.swap16=function oe(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var t=0;t<e;t+=2){L(this,t,t+1)}return this};l.prototype.swap32=function ae(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var t=0;t<e;t+=4){L(this,t,t+3);L(this,t+1,t+2)}return this};l.prototype.swap64=function ue(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var t=0;t<e;t+=8){L(this,t,t+7);L(this,t+1,t+6);L(this,t+2,t+5);L(this,t+3,t+4)}return this};l.prototype.toString=function le(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return x(this,0,e);return k.apply(this,arguments)};l.prototype.equals=function ce(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return l.compare(this,e)===0};l.prototype.inspect=function he(){var e="";var t=n.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return"<Buffer "+e+">"};l.prototype.compare=function fe(e,t,n,i,r){if(!l.isBuffer(e)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(n===undefined){n=e?e.length:0}if(i===undefined){i=0}if(r===undefined){r=this.length}if(t<0||n>e.length||i<0||r>this.length){throw new RangeError("out of range index")}if(i>=r&&t>=n){return 0}if(i>=r){return-1}if(t>=n){return 1}t>>>=0;n>>>=0;i>>>=0;r>>>=0;if(this===e)return 0;var s=r-i;var o=n-t;var a=Math.min(s,o);var u=this.slice(i,r);var c=e.slice(t,n);for(var h=0;h<a;++h){if(u[h]!==c[h]){s=u[h];o=c[h];break}}if(s<o)return-1;if(o<s)return 1;return 0};
|
||
|
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
|
||
|
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
|
||
|
//
|
||
|
// Arguments:
|
||
|
// - buffer - a Buffer to search
|
||
|
// - val - a string, Buffer, or number
|
||
|
// - byteOffset - an index into `buffer`; will be clamped to an int32
|
||
|
// - encoding - an optional encoding, relevant is val is a string
|
||
|
// - dir - true for indexOf, false for lastIndexOf
|
||
|
function A(e,t,n,i,r){
|
||
|
// Empty buffer means no match
|
||
|
if(e.length===0)return-1;
|
||
|
// Normalize byteOffset
|
||
|
if(typeof n==="string"){i=n;n=0}else if(n>2147483647){n=2147483647}else if(n<-2147483648){n=-2147483648}n=+n;// Coerce to Number.
|
||
|
if(isNaN(n)){
|
||
|
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
|
||
|
n=r?0:e.length-1}
|
||
|
// Normalize byteOffset: negative offsets start from the end of the buffer
|
||
|
if(n<0)n=e.length+n;if(n>=e.length){if(r)return-1;else n=e.length-1}else if(n<0){if(r)n=0;else return-1}
|
||
|
// Normalize val
|
||
|
if(typeof t==="string"){t=l.from(t,i)}
|
||
|
// Finally, search either indexOf (if dir is true) or lastIndexOf
|
||
|
if(l.isBuffer(t)){
|
||
|
// Special case: looking for empty string/buffer always fails
|
||
|
if(t.length===0){return-1}return E(e,t,n,i,r)}else if(typeof t==="number"){t=t&255;// Search for a byte value [0-255]
|
||
|
if(l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(r){return Uint8Array.prototype.indexOf.call(e,t,n)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,n)}}return E(e,[t],n,i,r)}throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,i,r){var s=1;var o=e.length;var a=t.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2){return-1}s=2;o/=2;a/=2;n/=2}}function u(e,t){if(s===1){return e[t]}else{return e.readUInt16BE(t*s)}}var l;if(r){var c=-1;for(l=n;l<o;l++){if(u(e,l)===u(t,c===-1?0:l-c)){if(c===-1)c=l;if(l-c+1===a)return c*s}else{if(c!==-1)l-=l-c;c=-1}}}else{if(n+a>o)n=o-a;for(l=n;l>=0;l--){var h=true;for(var f=0;f<a;f++){if(u(e,l+f)!==u(t,f)){h=false;break}}if(h)return l}}return-1}l.prototype.includes=function pe(e,t,n){return this.indexOf(e,t,n)!==-1};l.prototype.indexOf=function de(e,t,n){return A(this,e,t,n,true)};l.prototype.lastIndexOf=function ge(e,t,n){return A(this,e,t,n,false)};function C(e,t,n,i){n=Number(n)||0;var r=e.length-n;if(!i){i=r}else{i=Number(i);if(i>r){i=r}}
|
||
|
// must be an even number of digits
|
||
|
var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");if(i>s/2){i=s/2}for(var o=0;o<i;++o){var a=parseInt(t.substr(o*2,2),16);if(isNaN(a))return o;e[n+o]=a}return o}function S(e,t,n,i){return ee(V(t,e.length-n),e,n,i)}function R(e,t,n,i){return ee(X(t),e,n,i)}function N(e,t,n,i){return R(e,t,n,i)}function _(e,t,n,i){return ee(Q(t),e,n,i)}function T(e,t,n,i){return ee(Z(t,e.length-n),e,n,i)}l.prototype.write=function me(e,t,n,i){
|
||
|
// Buffer#write(string)
|
||
|
if(t===undefined){i="utf8";n=this.length;t=0}else if(n===undefined&&typeof t==="string"){i=t;n=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var r=this.length-t;if(n===undefined||n>r)n=r;if(e.length>0&&(n<0||t<0)||t>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return R(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":
|
||
|
// Warning: maxLength not taken into account in base64Write
|
||
|
return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};l.prototype.toJSON=function ye(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,n){if(t===0&&n===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,n))}}function x(e,t,n){n=Math.min(e.length,n);var i=[];var r=t;while(r<n){var s=e[r];var o=null;var a=s>239?4:s>223?3:s>191?2:1;if(r+a<=n){var u,l,c,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=e[r+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=e[r+1];l=e[r+2];if((u&192)===128&&(l&192)===128){h=(s&15)<<12|(u&63)<<6|l&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=e[r+1];l=e[r+2];c=e[r+3];if((u&192)===128&&(l&192)===128&&(c&192)===128){h=(s&15)<<18|(u&63)<<12|(l&63)<<6|c&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){
|
||
|
// we did not generate a valid codePoint so insert a
|
||
|
// replacement char (U+FFFD) and advance only 1 byte
|
||
|
o=65533;a=1}else if(o>65535){
|
||
|
// encode to utf16 (surrogate pair dance)
|
||
|
o-=65536;i.push(o>>>10&1023|55296);o=56320|o&1023}i.push(o);r+=a}return M(i)}
|
||
|
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
|
||
|
// the lowest limit is Chrome, with 0x10000 args.
|
||
|
// We go 1 magnitude less, for safety
|
||
|
var O=4096;function M(e){var t=e.length;if(t<=O){return String.fromCharCode.apply(String,e)}
|
||
|
// Decode in chunks to avoid "call stack size exceeded".
|
||
|
var n="";var i=0;while(i<t){n+=String.fromCharCode.apply(String,e.slice(i,i+=O))}return n}function P(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r){i+=String.fromCharCode(e[r]&127)}return i}function B(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r){i+=String.fromCharCode(e[r])}return i}function $(e,t,n){var i=e.length;if(!t||t<0)t=0;if(!n||n<0||n>i)n=i;var r="";for(var s=t;s<n;++s){r+=K(e[s])}return r}function U(e,t,n){var i=e.slice(t,n);var r="";for(var s=0;s<i.length;s+=2){r+=String.fromCharCode(i[s]+i[s+1]*256)}return r}l.prototype.slice=function ve(e,t){var n=this.length;e=~~e;t=t===undefined?n:~~t;if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(t<e)t=e;var i;if(l.TYPED_ARRAY_SUPPORT){i=this.subarray(e,t);i.__proto__=l.prototype}else{var r=t-e;i=new l(r,undefined);for(var s=0;s<r;++s){i[s]=this[s+e]}}return i};/*
|
||
|
* Need to make sure that buffer isn't trying to write out of bounds.
|
||
|
*/
|
||
|
function D(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUIntLE=function be(e,t,n){e=e|0;t=t|0;if(!n)D(e,t,this.length);var i=this[e];var r=1;var s=0;while(++s<t&&(r*=256)){i+=this[e+s]*r}return i};l.prototype.readUIntBE=function we(e,t,n){e=e|0;t=t|0;if(!n){D(e,t,this.length)}var i=this[e+--t];var r=1;while(t>0&&(r*=256)){i+=this[e+--t]*r}return i};l.prototype.readUInt8=function ke(e,t){if(!t)D(e,1,this.length);return this[e]};l.prototype.readUInt16LE=function Le(e,t){if(!t)D(e,2,this.length);return this[e]|this[e+1]<<8};l.prototype.readUInt16BE=function Ae(e,t){if(!t)D(e,2,this.length);return this[e]<<8|this[e+1]};l.prototype.readUInt32LE=function Ee(e,t){if(!t)D(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};l.prototype.readUInt32BE=function Ce(e,t){if(!t)D(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};l.prototype.readIntLE=function Se(e,t,n){e=e|0;t=t|0;if(!n)D(e,t,this.length);var i=this[e];var r=1;var s=0;while(++s<t&&(r*=256)){i+=this[e+s]*r}r*=128;if(i>=r)i-=Math.pow(2,8*t);return i};l.prototype.readIntBE=function Re(e,t,n){e=e|0;t=t|0;if(!n)D(e,t,this.length);var i=t;var r=1;var s=this[e+--i];while(i>0&&(r*=256)){s+=this[e+--i]*r}r*=128;if(s>=r)s-=Math.pow(2,8*t);return s};l.prototype.readInt8=function Ne(e,t){if(!t)D(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};l.prototype.readInt16LE=function _e(e,t){if(!t)D(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function Te(e,t){if(!t)D(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function Ie(e,t){if(!t)D(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};l.prototype.readInt32BE=function xe(e,t){if(!t)D(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};l.prototype.readFloatLE=function Oe(e,t){if(!t)D(e,4,this.length);return r.read(this,e,true,23,4)};l.prototype.readFloatBE=function Me(e,t){if(!t)D(e,4,this.length);return r.read(this,e,false,23,4)};l.prototype.readDoubleLE=function Pe(e,t){if(!t)D(e,8,this.length);return r.read(this,e,true,52,8)};l.prototype.readDoubleBE=function Be(e,t){if(!t)D(e,8,this.length);return r.read(this,e,false,52,8)};function j(e,t,n,i,r,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}l.prototype.writeUIntLE=function $e(e,t,n,i){e=+e;t=t|0;n=n|0;if(!i){var r=Math.pow(2,8*n)-1;j(this,e,t,n,r,0)}var s=1;var o=0;this[t]=e&255;while(++o<n&&(s*=256)){this[t+o]=e/s&255}return t+n};l.prototype.writeUIntBE=function Ue(e,t,n,i){e=+e;t=t|0;n=n|0;if(!i){var r=Math.pow(2,8*n)-1;j(this,e,t,n,r,0)}var s=n-1;var o=1;this[t+s]=e&255;while(--s>=0&&(o*=256)){this[t+s]=e/o&255}return t+n};l.prototype.writeUInt8=function De(e,t,n){e=+e;t=t|0;if(!n)j(this,e,t,1,255,0);if(!l.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function F(e,t,n,i){if(t<0)t=65535+t+1;for(var r=0,s=Math.min(e.length-n,2);r<s;++r){e[n+r]=(t&255<<8*(i?r:1-r))>>>(i?r:1-r)*8}}l.prototype.writeUInt16LE=function je(e,t,n){e=+e;t=t|0;if(!n)j(this,e,t,2,65535,0);if(l.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{F(this,e,t,true)}return t+2};l.prototype.writeUInt16BE=function Fe(e,t,n){e=+e;t=t|0;if(!n)j(this,e,t,2,65535,0);if(l.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{F(this,e,t,false)}return t+2};function W(e,t,n,i){if(t<0)t=4294967295+t+1;for(var r=0,s=Math.min(e.length-n,4);r<s;++r){e[n+r]=t>>>(i?r:3-r)*8&255}}l.prototype.writeUInt32LE=function We(e,t,n){e=+e;t=t|0;if(!n)j(this,e,t,4,4294967295,0);if(l.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{W(this,e,t,true)}return t+4};l.prototype.writeUInt32BE=function Ye(e,t,n){e=+e;t=t|0;if(!n)j(this,e,t,4,4294967295,0);if(l.TYPED_ARRAY_SUPPORT){th
|
||
|
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
|
||
|
l.prototype.copy=function tt(e,t,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<n)i=n;
|
||
|
// Copy 0 bytes; we're done
|
||
|
if(i===n)return 0;if(e.length===0||this.length===0)return 0;
|
||
|
// Fatal error conditions
|
||
|
if(t<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");
|
||
|
// Are we oob?
|
||
|
if(i>this.length)i=this.length;if(e.length-t<i-n){i=e.length-t+n}var r=i-n;var s;if(this===e&&n<t&&t<i){
|
||
|
// descending copy from end
|
||
|
for(s=r-1;s>=0;--s){e[s+t]=this[s+n]}}else if(r<1e3||!l.TYPED_ARRAY_SUPPORT){
|
||
|
// ascending copy from start
|
||
|
for(s=0;s<r;++s){e[s+t]=this[s+n]}}else{Uint8Array.prototype.set.call(e,this.subarray(n,n+r),t)}return r};
|
||
|
// Usage:
|
||
|
// buffer.fill(number[, offset[, end]])
|
||
|
// buffer.fill(buffer[, offset[, end]])
|
||
|
// buffer.fill(string[, offset[, end]][, encoding])
|
||
|
l.prototype.fill=function nt(e,t,n,i){
|
||
|
// Handle string cases:
|
||
|
if(typeof e==="string"){if(typeof t==="string"){i=t;t=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(e.length===1){var r=e.charCodeAt(0);if(r<256){e=r}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!l.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof e==="number"){e=e&255}
|
||
|
// Invalid ranges are not set to a default, so can range check early.
|
||
|
if(t<0||this.length<t||this.length<n){throw new RangeError("Out of range index")}if(n<=t){return this}t=t>>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var s;if(typeof e==="number"){for(s=t;s<n;++s){this[s]=e}}else{var o=l.isBuffer(e)?e:V(new l(e,i).toString());var a=o.length;for(s=0;s<n-t;++s){this[s+t]=o[s%a]}}return this};
|
||
|
// HELPER FUNCTIONS
|
||
|
// ================
|
||
|
var H=/[^+\/0-9A-Za-z-_]/g;function J(e){
|
||
|
// Node strips out invalid characters like \n and \t from the string, base64-js does not
|
||
|
e=q(e).replace(H,"");
|
||
|
// Node converts strings with length < 2 to ''
|
||
|
if(e.length<2)return"";
|
||
|
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
|
||
|
while(e.length%4!==0){e=e+"="}return e}function q(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function K(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function V(e,t){t=t||Infinity;var n;var i=e.length;var r=null;var s=[];for(var o=0;o<i;++o){n=e.charCodeAt(o);
|
||
|
// is surrogate component
|
||
|
if(n>55295&&n<57344){
|
||
|
// last char was a lead
|
||
|
if(!r){
|
||
|
// no lead yet
|
||
|
if(n>56319){
|
||
|
// unexpected trail
|
||
|
if((t-=3)>-1)s.push(239,191,189);continue}else if(o+1===i){
|
||
|
// unpaired lead
|
||
|
if((t-=3)>-1)s.push(239,191,189);continue}
|
||
|
// valid lead
|
||
|
r=n;continue}
|
||
|
// 2 leads in a row
|
||
|
if(n<56320){if((t-=3)>-1)s.push(239,191,189);r=n;continue}
|
||
|
// valid surrogate pair
|
||
|
n=(r-55296<<10|n-56320)+65536}else if(r){
|
||
|
// valid bmp char, but last char was a lead
|
||
|
if((t-=3)>-1)s.push(239,191,189)}r=null;
|
||
|
// encode utf8
|
||
|
if(n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else{throw new Error("Invalid code point")}}return s}function X(e){var t=[];for(var n=0;n<e.length;++n){
|
||
|
// Node's code seems to be doing this and not & 0x7F..
|
||
|
t.push(e.charCodeAt(n)&255)}return t}function Z(e,t){var n,i,r;var s=[];for(var o=0;o<e.length;++o){if((t-=2)<0)break;n=e.charCodeAt(o);i=n>>8;r=n%256;s.push(r);s.push(i)}return s}function Q(e){return i.toByteArray(J(e))}function ee(e,t,n,i){for(var r=0;r<i;++r){if(r+n>=t.length||r>=e.length)break;t[r+n]=e[r]}return r}function te(e){return e!==e}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":7,ieee754:11,isarray:12}],10:[function(e,t,n){
|
||
|
// Copyright Joyent, Inc. and other Node contributors.
|
||
|
//
|
||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
// copy of this software and associated documentation files (the
|
||
|
// "Software"), to deal in the Software without restriction, including
|
||
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||
|
// persons to whom the Software is furnished to do so, subject to the
|
||
|
// following conditions:
|
||
|
//
|
||
|
// The above copyright notice and this permission notice shall be included
|
||
|
// in all copies or substantial portions of the Software.
|
||
|
//
|
||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
|
function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;
|
||
|
// Backwards-compat with node 0.10.x
|
||
|
i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;
|
||
|
// By default EventEmitters will print a warning if more than 10 listeners are
|
||
|
// added to it. This is a useful default which helps finding memory leaks.
|
||
|
i.defaultMaxListeners=10;
|
||
|
// Obviously not all Emitters should be limited to 10. This function allows
|
||
|
// that to be increased. Set to zero for unlimited.
|
||
|
i.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,n,i,s,u,l;if(!this._events)this._events={};
|
||
|
// If there is no 'error' event listener then throw.
|
||
|
if(e==="error"){if(!this._events.error||o(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}else{
|
||
|
// At least give some kind of context to the user
|
||
|
var c=new Error('Uncaught, unspecified "error" event. ('+t+")");c.context=t;throw c}}}n=this._events[e];if(a(n))return false;if(r(n)){switch(arguments.length){
|
||
|
// fast cases
|
||
|
case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;
|
||
|
// slower
|
||
|
default:s=Array.prototype.slice.call(arguments,1);n.apply(this,s)}}else if(o(n)){s=Array.prototype.slice.call(arguments,1);l=n.slice();i=l.length;for(u=0;u<i;u++)l[u].apply(this,s)}return true};i.prototype.addListener=function(e,t){var n;if(!r(t))throw TypeError("listener must be a function");if(!this._events)this._events={};
|
||
|
// To avoid recursion in the case that type === "newListener"! Before
|
||
|
// adding it to the listeners, first emit "newListener".
|
||
|
if(this._events.newListener)this.emit("newListener",e,r(t.listener)?t.listener:t);if(!this._events[e])
|
||
|
// Optimize the case of one listener. Don't need the extra array object.
|
||
|
this._events[e]=t;else if(o(this._events[e]))
|
||
|
// If we've already got an array, just append.
|
||
|
this._events[e].push(t);else
|
||
|
// Adding the second element, need to change to array.
|
||
|
this._events[e]=[this._events[e],t];
|
||
|
// Check for listener leak
|
||
|
if(o(this._events[e])&&!this._events[e].warned){if(!a(this._maxListeners)){n=this._maxListeners}else{n=i.defaultMaxListeners}if(n&&n>0&&this._events[e].length>n){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){
|
||
|
// not supported in IE 10
|
||
|
console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=false;function i(){this.removeListener(e,i);if(!n){n=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};
|
||
|
// emits a 'removeListener' event iff the listener was removed
|
||
|
i.prototype.removeListener=function(e,t){var n,i,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e];s=n.length;i=-1;if(n===t||r(n.listener)&&n.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(o(n)){for(a=s;a-- >0;){if(n[a]===t||n[a].listener&&n[a].listener===t){i=a;break}}if(i<0)return this;if(n.length===1){n.length=0;delete this._events[e]}else{n.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;
|
||
|
// not listening for removeListener, no need to emit
|
||
|
if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}
|
||
|
// emit removeListener for all listeners on all events
|
||
|
if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}n=this._events[e];if(r(n)){this.removeListener(e,n)}else if(n){
|
||
|
// LIFO order
|
||
|
while(n.length)this.removeListener(e,n[n.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(r(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;else if(t)return t.length}return 0};i.listenerCount=function(e,t){return e.listenerCount(t)};function r(e){return typeof e==="function"}function s(e){return typeof e==="number"}function o(e){return typeof e==="object"&&e!==null}function a(e){return e===void 0}},{}],11:[function(e,t,n){n.read=function(e,t,n,i,r){var s,o;var a=r*8-i-1;var u=(1<<a)-1;var l=u>>1;var c=-7;var h=n?r-1:0;var f=n?-1:1;var p=e[t+h];h+=f;s=p&(1<<-c)-1;p>>=-c;c+=a;for(;c>0;s=s*256+e[t+h],h+=f,c-=8){}o=s&(1<<-c)-1;s>>=-c;c+=i;for(;c>0;o=o*256+e[t+h],h+=f,c-=8){}if(s===0){s=1-l}else if(s===u){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,i);s=s-l}return(p?-1:1)*o*Math.pow(2,s-i)};n.write=function(e,t,n,i,r,s){var o,a,u;var l=s*8-r-1;var c=(1<<l)-1;var h=c>>1;var f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=i?0:s-1;var d=i?1:-1;var g=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){a=isNaN(t)?1:0;o=c}else{o=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){t+=f/u}else{t+=f*Math.pow(2,1-h)}if(t*u>=2){o++;u/=2}if(o+h>=c){a=0;o=c}else if(o+h>=1){a=(t*u-1)*Math.pow(2,r);o=o+h}else{a=t*Math.pow(2,h-1)*Math.pow(2,r);o=0}}for(;r>=8;e[n+p]=a&255,p+=d,a/=256,r-=8){}o=o<<r|a;l+=r;for(;l>0;e[n+p]=o&255,p+=d,o/=256,l-=8){}e[n+p-d]|=g*128}},{}],12:[function(e,t,n){var i={}.toString;t.exports=Array.isArray||function(e){return i.call(e)=="[object Array]"}},{}],13:[function(e,t,n){(function(e){
|
||
|
// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
|
||
|
// backported and transplited with Babel, with backwards-compat fixes
|
||
|
// Copyright Joyent, Inc. and other Node contributors.
|
||
|
//
|
||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
// copy of this software and associated documentation files (the
|
||
|
// "Software"), to deal in the Software without restriction, including
|
||
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||
|
// persons to whom the Software is furnished to do so, subject to the
|
||
|
// following conditions:
|
||
|
//
|
||
|
// The above copyright notice and this permission notice shall be included
|
||
|
// in all copies or substantial portions of the Software.
|
||
|
//
|
||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
|
// resolves . and .. elements in a path array with directory names there
|
||
|
// must be no slashes, empty elements, or device names (c:\) in the array
|
||
|
// (so also no leading and trailing slashes - it does not distinguish
|
||
|
// relative and absolute paths)
|
||
|
function t(e,t){
|
||
|
// if the path tries to go above the root, `up` ends up > 0
|
||
|
var n=0;for(var i=e.length-1;i>=0;i--){var r=e[i];if(r==="."){e.splice(i,1)}else if(r===".."){e.splice(i,1);n++}else if(n){e.splice(i,1);n--}}
|
||
|
// if the path is allowed to go above the root, restore leading ..s
|
||
|
if(t){for(;n--;n){e.unshift("..")}}return e}
|
||
|
// path.resolve([from ...], to)
|
||
|
// posix version
|
||
|
n.resolve=function(){var n="",i=false;for(var s=arguments.length-1;s>=-1&&!i;s--){var o=s>=0?arguments[s]:e.cwd();
|
||
|
// Skip empty and invalid entries
|
||
|
if(typeof o!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!o){continue}n=o+"/"+n;i=o.charAt(0)==="/"}
|
||
|
// At this point the path should be resolved to a full absolute path, but
|
||
|
// handle relative paths to be safe (might happen when process.cwd() fails)
|
||
|
// Normalize the path
|
||
|
n=t(r(n.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+n||"."};
|
||
|
// path.normalize(path)
|
||
|
// posix version
|
||
|
n.normalize=function(e){var i=n.isAbsolute(e),o=s(e,-1)==="/";
|
||
|
// Normalize the path
|
||
|
e=t(r(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&o){e+="/"}return(i?"/":"")+e};
|
||
|
// posix version
|
||
|
n.isAbsolute=function(e){return e.charAt(0)==="/"};
|
||
|
// posix version
|
||
|
n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};
|
||
|
// path.relative(from, to)
|
||
|
// posix version
|
||
|
n.relative=function(e,t){e=n.resolve(e).substr(1);t=n.resolve(t).substr(1);function i(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var n=e.length-1;for(;n>=0;n--){if(e[n]!=="")break}if(t>n)return[];return e.slice(t,n-t+1)}var r=i(e.split("/"));var s=i(t.split("/"));var o=Math.min(r.length,s.length);var a=o;for(var u=0;u<o;u++){if(r[u]!==s[u]){a=u;break}}var l=[];for(var u=a;u<r.length;u++){l.push("..")}l=l.concat(s.slice(a));return l.join("/")};n.sep="/";n.delimiter=":";n.dirname=function(e){if(typeof e!=="string")e=e+"";if(e.length===0)return".";var t=e.charCodeAt(0);var n=t===47;var i=-1;var r=true;for(var s=e.length-1;s>=1;--s){t=e.charCodeAt(s);if(t===47){if(!r){i=s;break}}else{
|
||
|
// We saw the first non-path separator
|
||
|
r=false}}if(i===-1)return n?"/":".";if(n&&i===1){
|
||
|
// return '//';
|
||
|
// Backwards-compat fix:
|
||
|
return"/"}return e.slice(0,i)};function i(e){if(typeof e!=="string")e=e+"";var t=0;var n=-1;var i=true;var r;for(r=e.length-1;r>=0;--r){if(e.charCodeAt(r)===47){
|
||
|
// If we reached a path separator that was not part of a set of path
|
||
|
// separators at the end of the string, stop now
|
||
|
if(!i){t=r+1;break}}else if(n===-1){
|
||
|
// We saw the first non-path separator, mark this as the end of our
|
||
|
// path component
|
||
|
i=false;n=r+1}}if(n===-1)return"";return e.slice(t,n)}
|
||
|
// Uses a mixed approach for backwards-compatibility, as ext behavior changed
|
||
|
// in new Node.js versions, so only basename() above is backported here
|
||
|
n.basename=function(e,t){var n=i(e);if(t&&n.substr(-1*t.length)===t){n=n.substr(0,n.length-t.length)}return n};n.extname=function(e){if(typeof e!=="string")e=e+"";var t=-1;var n=0;var i=-1;var r=true;
|
||
|
// Track the state of characters (if any) we see before our first dot and
|
||
|
// after any path separator we find
|
||
|
var s=0;for(var o=e.length-1;o>=0;--o){var a=e.charCodeAt(o);if(a===47){
|
||
|
// If we reached a path separator that was not part of a set of path
|
||
|
// separators at the end of the string, stop now
|
||
|
if(!r){n=o+1;break}continue}if(i===-1){
|
||
|
// We saw the first non-path separator, mark this as the end of our
|
||
|
// extension
|
||
|
r=false;i=o+1}if(a===46){
|
||
|
// If this is our first dot, mark it as the start of our extension
|
||
|
if(t===-1)t=o;else if(s!==1)s=1}else if(t!==-1){
|
||
|
// We saw a non-dot and non-path separator before our dot, so we should
|
||
|
// have a good chance at having a non-empty extension
|
||
|
s=-1}}if(t===-1||i===-1||
|
||
|
// We saw a non-dot character immediately before the dot
|
||
|
s===0||
|
||
|
// The (right-most) trimmed path component is exactly '..'
|
||
|
s===1&&t===i-1&&t===n+1){return""}return e.slice(t,i)};function r(e,t){if(e.filter)return e.filter(t);var n=[];for(var i=0;i<e.length;i++){if(t(e[i],i,e))n.push(e[i])}return n}
|
||
|
// String.prototype.substr - negative index don't work in IE8
|
||
|
var s="ab".substr(-1)==="b"?function(e,t,n){return e.substr(t,n)}:function(e,t,n){if(t<0)t=e.length+t;return e.substr(t,n)}}).call(this,e("_process"))},{_process:20}],14:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l={}.toString;i=c(function(e,t){return e.apply(null,t)});r=function(e){return c(e)};s=c(function(e,t,n){return e(n,t)});o=function(e){return function(t){return function(){return e(t(t)).apply(null,arguments)}}(function(t){return function(){return e(t(t)).apply(null,arguments)}})};a=c(function(e,t,n,i){return e(t(n),t(i))});u=function(e){var t;t={};return function(){var n,i,r,s,o,a;i=[];for(r=0,s=arguments.length;r<s;++r){i.push(arguments[r])}n=i;o=function(){var e,t,i,r=[];for(e=0,i=(t=n).length;e<i;++e){a=t[e];r.push(a+l.call(a).slice(8,-1))}return r}().join("");return t[o]=o in t?t[o]:e.apply(null,n)}};t.exports={curry:r,flip:s,fix:o,apply:i,over:a,memoize:u};function c(e,t){var n,i=function(r){return e.length>1?function(){var s=r?r.concat():[];n=t?n||this:this;return s.push.apply(s,arguments)<e.length&&arguments.length?i.call(n,s):e.apply(n,s)}:e};return i()}},{}],15:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g,m,y,v,b,w,k,L,A,E,C,S,R,N,_,T,I,x,O,M,P,B,$,U,D,j,F,W,Y,z,G,H,J,q,K,V,X,Z,Q,ee,te,ne,ie,re,se,oe,ae,ue,le,ce,he,fe,pe,de,ge,me,ye,ve,be={}.toString;i=we(function(e,t){var n,i,r;for(n=0,i=t.length;n<i;++n){r=t[n];e(r)}return t});r=we(function(e,t){var n,i,r,s=[];for(n=0,i=t.length;n<i;++n){r=t[n];s.push(e(r))}return s});s=function(e){var t,n,i,r=[];for(t=0,n=e.length;t<n;++t){i=e[t];if(i){r.push(i)}}return r};o=we(function(e,t){var n,i,r,s=[];for(n=0,i=t.length;n<i;++n){r=t[n];if(e(r)){s.push(r)}}return s});a=we(function(e,t){var n,i,r,s=[];for(n=0,i=t.length;n<i;++n){r=t[n];if(!e(r)){s.push(r)}}return s});u=we(function(e,t){var n,i;n=ge(e,t);i=t.slice();if(n!=null){i.splice(n,1)}return i});l=we(function(e,t){var n,i,r,s,o;n=[];i=[];for(r=0,s=t.length;r<s;++r){o=t[r];(e(o)?n:i).push(o)}return[n,i]});c=we(function(e,t){var n,i,r;for(n=0,i=t.length;n<i;++n){r=t[n];if(e(r)){return r}}});h=f=function(e){return e[0]};p=function(e){if(!e.length){return}return e.slice(1)};d=function(e){return e[e.length-1]};g=function(e){if(!e.length){return}return e.slice(0,-1)};m=function(e){return!e.length};y=function(e){return e.concat().reverse()};v=function(e){var t,n,i,r;t=[];for(n=0,i=e.length;n<i;++n){r=e[n];if(!ke(r,t)){t.push(r)}}return t};b=we(function(e,t){var n,i,r,s,o,a=[];n=[];for(i=0,r=t.length;i<r;++i){s=t[i];o=e(s);if(ke(o,n)){continue}n.push(o);a.push(s)}return a});w=k=we(function(e,t,n){var i,r,s;for(i=0,r=n.length;i<r;++i){s=n[i];t=e(t,s)}return t});L=A=we(function(e,t){return w(e,t[0],t.slice(1))});E=we(function(e,t,n){var i,r;for(i=n.length-1;i>=0;--i){r=n[i];t=e(r,t)}return t});C=we(function(e,t){return E(e,t[t.length-1],t.slice(0,-1))});S=we(function(e,t){var n,i,r;n=[];i=t;while((r=e(i))!=null){n.push(r[0]);i=r[1]}return n});R=function(e){return[].concat.apply([],e)};N=we(function(e,t){var n;return[].concat.apply([],function(){var i,r,s,o=[];for(i=0,s=(r=t).length;i<s;++i){n=r[i];o.push(e(n))}return o}())});_=function(e){var t;return[].concat.apply([],function(){var n,i,r,s=[];for(n=0,r=(i=e).length;n<r;++n){t=i[n];if(be.call(t).slice(8,-1)==="Array"){s.push(_(t))}else{s.push(t)}}return s}())};T=function(e){var t,n,i,r,s,o,a,u,l,c;n=[];for(i=1,r=arguments.length;i<r;++i){n.push(arguments[i])}t=n;s=[];e:for(i=0,o=e.length;i<o;++i){a=e[i];for(u=0,l=t.length;u<l;++u){c=t[u];if(ke(a,c)){continue e}}s.push(a)}return s};I=function(e){var t,n,i,r,s,o,a,u,l,c;n=[];for(i=1,r=arguments.length;i<r;++i){n.push(arguments[i])}t=n;s=[];e:for(i=0,o=e.length;i<o;++i){a=e[i];for(u=0,l=t.length;u<l;++u){c=t[u];if(!ke(a,c)){continue e}}s.push(a)}return s};x=function(){var e,t,n,i,r,s,o,a,u,l;t=[];for(n=0,i=arguments.length;n<i;++n){t.push(arguments[n])}e=t;r=[];for(n=0,s=e.length;n<s;++n){o=e[n];for(a=0,u=o.length;a<u;++a){l=o[a];if(!ke(l,r)){r.push(l)}}}return r};O=we(function(e,t){var n,i,r,s,o;n={};for(i=0,r=t.length;i<r;++i){s=t[i];o=e(s);if(o in n){n[o]+=1}else{n[o]=1}}return n});M=we(function(e,t){var n,i,r,s,o;n={};for(i=0,r=t.length;i<r;++i){s=t[i];o=e(s);if(o in n){n[o].push(s)}else{n[o]=[s]}}return n});P=function(e){var t,n,i;for(t=0,n=e.length;t<n;++t){i=e[t];if(!i){return false}}return true};B=function(e){var t,n,i;for(t=0,n=e.length;t<n;++t){i=e[t];if(i){return true}}return false};$=we(function(e,t){var n,i,r;for(n=0,i=t.length;n<i;++n){r=t[n];if(e(r)){return true}}return false});U=we(function(e,t){var n,i,r;for(n=0,i=t.length;n<i;++n){r=t[n];if(!e(r)){return false}}return true});D=function(e){return e.concat().sort(function(e,t){if(e>t){return 1}else if(e<t){return-1}else{return 0}})};j=we(function(e,t){return t.concat().sort(e)});F=we(function(e,t){return t.concat().sort(function(t,n){if(e(t)>e(n)){return 1}else if(e(t)<e(n)){return-1}else{return 0}})});W=function(e){var t,n,i,r;t=0;for(n=0,i=e.length;n<i;++n){r=e[n];t+=r}return t};Y=function(e){var t,n,i,r;t=1;for(n=0,i=e.length;n<i;++n){r=e[n];t*=r}return t};z=G=function(e){var t,n,i,r;t=0;for(n=0,i=e.length;n<i;++n){r=e[n];t+=r}return t/e.length};H=function(e){var t,n,i,r,s;t=e[0];for(n=0,r=(i=e.slice(1)).length;n<r;++n){s=i[n];if(s>t){t=s}
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g,m,y,v,b,w,k,L,A,E,C,S,R,N,_,T,I,x,O,M;i=P(function(e,t){return e>t?e:t});r=P(function(e,t){return e<t?e:t});s=function(e){return-e};o=Math.abs;a=function(e){if(e<0){return-1}else if(e>0){return 1}else{return 0}};u=P(function(e,t){return~~(e/t)});l=P(function(e,t){return e%t});c=P(function(e,t){return Math.floor(e/t)});h=P(function(e,t){var n;return(e%(n=t)+n)%n});f=function(e){return 1/e};p=Math.PI;d=p*2;g=Math.exp;m=Math.sqrt;y=Math.log;v=P(function(e,t){return Math.pow(e,t)});b=Math.sin;w=Math.tan;k=Math.cos;L=Math.asin;A=Math.acos;E=Math.atan;C=P(function(e,t){return Math.atan2(e,t)});S=function(e){return~~e};R=Math.round;N=Math.ceil;_=Math.floor;T=function(e){return e!==e};I=function(e){return e%2===0};x=function(e){return e%2!==0};O=P(function(e,t){var n;e=Math.abs(e);t=Math.abs(t);while(t!==0){n=e%t;e=t;t=n}return e});M=P(function(e,t){return Math.abs(Math.floor(e/O(e,t)*t))});t.exports={max:i,min:r,negate:s,abs:o,signum:a,quot:u,rem:l,div:c,mod:h,recip:f,pi:p,tau:d,exp:g,sqrt:m,ln:y,pow:v,sin:b,tan:w,cos:k,acos:A,asin:L,atan:E,atan2:C,truncate:S,round:R,ceiling:N,floor:_,isItNaN:T,even:I,odd:x,gcd:O,lcm:M};function P(e,t){var n,i=function(r){return e.length>1?function(){var s=r?r.concat():[];n=t?n||this:this;return s.push.apply(s,arguments)<e.length&&arguments.length?i.call(n,s):e.apply(n,s)}:e};return i()}},{}],17:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g,m;i=function(e){var t,n,i=[];for(t in e){n=e[t];i.push(n)}return i};r=function(e){var t,n=[];for(t in e){n.push(t)}return n};s=function(e){var t,n,i,r={};for(t=0,n=e.length;t<n;++t){i=e[t];r[i[0]]=i[1]}return r};o=function(e){var t,n,i=[];for(t in e){n=e[t];i.push([t,n])}return i};a=y(function(e,t){var n,i,r,s,o={};for(n=0,i=e.length;n<i;++n){r=n;s=e[n];o[s]=t[r]}return o});u=function(e){var t,n,i,r;t=[];n=[];for(i in e){r=e[i];t.push(i);n.push(r)}return[t,n]};l=function(e){var t;for(t in e){return false}return true};c=y(function(e,t){var n,i;for(n in t){i=t[n];e(i)}return t});h=y(function(e,t){var n,i,r={};for(n in t){i=t[n];r[n]=e(i)}return r});f=function(e){var t,n,i={};for(t in e){n=e[t];if(n){i[t]=n}}return i};p=y(function(e,t){var n,i,r={};for(n in t){i=t[n];if(e(i)){r[n]=i}}return r});d=y(function(e,t){var n,i,r={};for(n in t){i=t[n];if(!e(i)){r[n]=i}}return r});g=y(function(e,t){var n,i,r,s;n={};i={};for(r in t){s=t[r];(e(s)?n:i)[r]=s}return[n,i]});m=y(function(e,t){var n,i;for(n in t){i=t[n];if(e(i)){return i}}});t.exports={values:i,keys:r,pairsToObj:s,objToPairs:o,listsToObj:a,objToLists:u,empty:l,each:c,map:h,filter:p,compact:f,reject:d,partition:g,find:m};function y(e,t){var n,i=function(r){return e.length>1?function(){var s=r?r.concat():[];n=t?n||this:this;return s.push.apply(s,arguments)<e.length&&arguments.length?i.call(n,s):e.apply(n,s)}:e};return i()}},{}],18:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l,c,h,f,p,d,g;i=m(function(e,t){return t.split(e)});r=m(function(e,t){return t.join(e)});s=function(e){if(!e.length){return[]}return e.split("\n")};o=function(e){return e.join("\n")};a=function(e){if(!e.length){return[]}return e.split(/[ ]+/)};u=function(e){return e.join(" ")};l=function(e){return e.split("")};c=function(e){return e.join("")};h=function(e){return e.split("").reverse().join("")};f=m(function(e,t){var n,i;n="";for(i=0;i<e;++i){n+=t}return n});p=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};d=function(e){return e.replace(/[-_]+(.)?/g,function(e,t){return(t!=null?t:"").toUpperCase()})};g=function(e){return e.replace(/([^-A-Z])([A-Z]+)/g,function(e,t,n){return t+"-"+(n.length>1?n:n.toLowerCase())}).replace(/^([A-Z]+)/,function(e,t){if(t.length>1){return t+"-"}else{return t.toLowerCase()}})};t.exports={split:i,join:r,lines:s,unlines:o,words:a,unwords:u,chars:l,unchars:c,reverse:h,repeat:f,capitalize:p,camelize:d,dasherize:g};function m(e,t){var n,i=function(r){return e.length>1?function(){var s=r?r.concat():[];n=t?n||this:this;return s.push.apply(s,arguments)<e.length&&arguments.length?i.call(n,s):e.apply(n,s)}:e};return i()}},{}],19:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.0
|
||
|
var i,r,s,o,a,u,l,c,h,f={}.toString;i=e("./Func.js");r=e("./List.js");s=e("./Obj.js");o=e("./Str.js");a=e("./Num.js");u=function(e){return e};l=p(function(e,t){return f.call(t).slice(8,-1)===e});c=p(function(e,t){var n,i=[];for(n=0;n<e;++n){i.push(t)}return i});o.empty=r.empty;o.slice=r.slice;o.take=r.take;o.drop=r.drop;o.splitAt=r.splitAt;o.takeWhile=r.takeWhile;o.dropWhile=r.dropWhile;o.span=r.span;o.breakStr=r.breakList;h={Func:i,List:r,Obj:s,Str:o,Num:a,id:u,isType:l,replicate:c};h.each=r.each;h.map=r.map;h.filter=r.filter;h.compact=r.compact;h.reject=r.reject;h.partition=r.partition;h.find=r.find;h.head=r.head;h.first=r.first;h.tail=r.tail;h.last=r.last;h.initial=r.initial;h.empty=r.empty;h.reverse=r.reverse;h.difference=r.difference;h.intersection=r.intersection;h.union=r.union;h.countBy=r.countBy;h.groupBy=r.groupBy;h.fold=r.fold;h.foldl=r.foldl;h.fold1=r.fold1;h.foldl1=r.foldl1;h.foldr=r.foldr;h.foldr1=r.foldr1;h.unfoldr=r.unfoldr;h.andList=r.andList;h.orList=r.orList;h.any=r.any;h.all=r.all;h.unique=r.unique;h.uniqueBy=r.uniqueBy;h.sort=r.sort;h.sortWith=r.sortWith;h.sortBy=r.sortBy;h.sum=r.sum;h.product=r.product;h.mean=r.mean;h.average=r.average;h.concat=r.concat;h.concatMap=r.concatMap;h.flatten=r.flatten;h.maximum=r.maximum;h.minimum=r.minimum;h.maximumBy=r.maximumBy;h.minimumBy=r.minimumBy;h.scan=r.scan;h.scanl=r.scanl;h.scan1=r.scan1;h.scanl1=r.scanl1;h.scanr=r.scanr;h.scanr1=r.scanr1;h.slice=r.slice;h.take=r.take;h.drop=r.drop;h.splitAt=r.splitAt;h.takeWhile=r.takeWhile;h.dropWhile=r.dropWhile;h.span=r.span;h.breakList=r.breakList;h.zip=r.zip;h.zipWith=r.zipWith;h.zipAll=r.zipAll;h.zipAllWith=r.zipAllWith;h.at=r.at;h.elemIndex=r.elemIndex;h.elemIndices=r.elemIndices;h.findIndex=r.findIndex;h.findIndices=r.findIndices;h.apply=i.apply;h.curry=i.curry;h.flip=i.flip;h.fix=i.fix;h.over=i.over;h.split=o.split;h.join=o.join;h.lines=o.lines;h.unlines=o.unlines;h.words=o.words;h.unwords=o.unwords;h.chars=o.chars;h.unchars=o.unchars;h.repeat=o.repeat;h.capitalize=o.capitalize;h.camelize=o.camelize;h.dasherize=o.dasherize;h.values=s.values;h.keys=s.keys;h.pairsToObj=s.pairsToObj;h.objToPairs=s.objToPairs;h.listsToObj=s.listsToObj;h.objToLists=s.objToLists;h.max=a.max;h.min=a.min;h.negate=a.negate;h.abs=a.abs;h.signum=a.signum;h.quot=a.quot;h.rem=a.rem;h.div=a.div;h.mod=a.mod;h.recip=a.recip;h.pi=a.pi;h.tau=a.tau;h.exp=a.exp;h.sqrt=a.sqrt;h.ln=a.ln;h.pow=a.pow;h.sin=a.sin;h.tan=a.tan;h.cos=a.cos;h.acos=a.acos;h.asin=a.asin;h.atan=a.atan;h.atan2=a.atan2;h.truncate=a.truncate;h.round=a.round;h.ceiling=a.ceiling;h.floor=a.floor;h.isItNaN=a.isItNaN;h.even=a.even;h.odd=a.odd;h.gcd=a.gcd;h.lcm=a.lcm;h.VERSION="1.2.1";t.exports=h;function p(e,t){var n,i=function(r){return e.length>1?function(){var s=r?r.concat():[];n=t?n||this:this;return s.push.apply(s,arguments)<e.length&&arguments.length?i.call(n,s):e.apply(n,s)}:e};return i()}},{"./Func.js":14,"./List.js":15,"./Num.js":16,"./Obj.js":17,"./Str.js":18}],20:[function(e,t,n){
|
||
|
// shim for using process in browser
|
||
|
var i=t.exports={};
|
||
|
// cached from whatever global is present so that test runners that stub it
|
||
|
// don't break things. But we need to wrap it in a try catch in case it is
|
||
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
||
|
// function because try/catches deoptimize in certain engines.
|
||
|
var r;var s;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){r=setTimeout}else{r=o}}catch(e){r=o}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=a}}catch(e){s=a}})();function u(e){if(r===setTimeout){
|
||
|
//normal enviroments in sane situations
|
||
|
return setTimeout(e,0)}
|
||
|
// if setTimeout wasn't available but was latter defined
|
||
|
if((r===o||!r)&&setTimeout){r=setTimeout;return setTimeout(e,0)}try{
|
||
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
|
return r(e,0)}catch(t){try{
|
||
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
|
return r.call(null,e,0)}catch(t){
|
||
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
||
|
return r.call(this,e,0)}}}function l(e){if(s===clearTimeout){
|
||
|
//normal enviroments in sane situations
|
||
|
return clearTimeout(e)}
|
||
|
// if clearTimeout wasn't available but was latter defined
|
||
|
if((s===a||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{
|
||
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
|
return s(e)}catch(t){try{
|
||
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
|
return s.call(null,e)}catch(t){
|
||
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
||
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
||
|
return s.call(this,e)}}}var c=[];var h=false;var f;var p=-1;function d(){if(!h||!f){return}h=false;if(f.length){c=f.concat(c)}else{p=-1}if(c.length){g()}}function g(){if(h){return}var e=u(d);h=true;var t=c.length;while(t){f=c;c=[];while(++p<t){if(f){f[p].run()}}p=-1;t=c.length}f=null;h=false;l(e)}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}c.push(new m(e,t));if(c.length===1&&!h){u(g)}};
|
||
|
// v8 likes predictible objects
|
||
|
function m(e,t){this.fun=e;this.array=t}m.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=true;i.env={};i.argv=[];i.version="";// empty string to avoid regexp issues
|
||
|
i.versions={};function y(){}i.on=y;i.addListener=y;i.once=y;i.off=y;i.removeListener=y;i.removeAllListeners=y;i.emit=y;i.prependListener=y;i.prependOnceListener=y;i.listeners=function(e){return[]};i.binding=function(e){throw new Error("process.binding is not supported")};i.cwd=function(){return"/"};i.chdir=function(e){throw new Error("process.chdir is not supported")};i.umask=function(){return 0}},{}],21:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i=e("./util");var r=Object.prototype.hasOwnProperty;var s=typeof Map!=="undefined";/**
|
||
|
* A data structure which is a combination of an array and a set. Adding a new
|
||
|
* member is O(1), testing for membership is O(1), and finding the index of an
|
||
|
* element is O(1). Removing elements from the set is not supported. Only
|
||
|
* strings are supported for membership.
|
||
|
*/
|
||
|
function o(){this._array=[];this._set=s?new Map:Object.create(null)}/**
|
||
|
* Static method for creating ArraySet instances from an existing array.
|
||
|
*/
|
||
|
o.fromArray=function a(e,t){var n=new o;for(var i=0,r=e.length;i<r;i++){n.add(e[i],t)}return n};/**
|
||
|
* Return how many unique items are in this ArraySet. If duplicates have been
|
||
|
* added, than those do not count towards the size.
|
||
|
*
|
||
|
* @returns Number
|
||
|
*/
|
||
|
o.prototype.size=function u(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length};/**
|
||
|
* Add the given string to this set.
|
||
|
*
|
||
|
* @param String aStr
|
||
|
*/
|
||
|
o.prototype.add=function l(e,t){var n=s?e:i.toSetString(e);var o=s?this.has(e):r.call(this._set,n);var a=this._array.length;if(!o||t){this._array.push(e)}if(!o){if(s){this._set.set(e,a)}else{this._set[n]=a}}};/**
|
||
|
* Is the given string a member of this set?
|
||
|
*
|
||
|
* @param String aStr
|
||
|
*/
|
||
|
o.prototype.has=function c(e){if(s){return this._set.has(e)}else{var t=i.toSetString(e);return r.call(this._set,t)}};/**
|
||
|
* What is the index of the given string in the array?
|
||
|
*
|
||
|
* @param String aStr
|
||
|
*/
|
||
|
o.prototype.indexOf=function h(e){if(s){var t=this._set.get(e);if(t>=0){return t}}else{var n=i.toSetString(e);if(r.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};/**
|
||
|
* What is the element at the given index?
|
||
|
*
|
||
|
* @param Number aIdx
|
||
|
*/
|
||
|
o.prototype.at=function f(e){if(e>=0&&e<this._array.length){return this._array[e]}throw new Error("No element indexed by "+e)};/**
|
||
|
* Returns the array representation of this set (which has the proper indices
|
||
|
* indicated by indexOf). Note that this is a copy of the internal array used
|
||
|
* for storing the members so that no one can mess with internal state.
|
||
|
*/
|
||
|
o.prototype.toArray=function p(){return this._array.slice()};n.ArraySet=o},{"./util":30}],22:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*
|
||
|
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
||
|
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
||
|
*
|
||
|
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
||
|
* Redistribution and use in source and binary forms, with or without
|
||
|
* modification, are permitted provided that the following conditions are
|
||
|
* met:
|
||
|
*
|
||
|
* * Redistributions of source code must retain the above copyright
|
||
|
* notice, this list of conditions and the following disclaimer.
|
||
|
* * Redistributions in binary form must reproduce the above
|
||
|
* copyright notice, this list of conditions and the following
|
||
|
* disclaimer in the documentation and/or other materials provided
|
||
|
* with the distribution.
|
||
|
* * Neither the name of Google Inc. nor the names of its
|
||
|
* contributors may be used to endorse or promote products derived
|
||
|
* from this software without specific prior written permission.
|
||
|
*
|
||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
var i=e("./base64");
|
||
|
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||
|
// length quantities we use in the source map spec, the first bit is the sign,
|
||
|
// the next four bits are the actual value, and the 6th bit is the
|
||
|
// continuation bit. The continuation bit tells us whether there are more
|
||
|
// digits in this value following this digit.
|
||
|
//
|
||
|
// Continuation
|
||
|
// | Sign
|
||
|
// | |
|
||
|
// V V
|
||
|
// 101011
|
||
|
var r=5;
|
||
|
// binary: 100000
|
||
|
var s=1<<r;
|
||
|
// binary: 011111
|
||
|
var o=s-1;
|
||
|
// binary: 100000
|
||
|
var a=s;/**
|
||
|
* Converts from a two-complement value to a value where the sign bit is
|
||
|
* placed in the least significant bit. For example, as decimals:
|
||
|
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||
|
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||
|
*/
|
||
|
function u(e){return e<0?(-e<<1)+1:(e<<1)+0}/**
|
||
|
* Converts to a two-complement value from a value where the sign bit is
|
||
|
* placed in the least significant bit. For example, as decimals:
|
||
|
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||
|
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||
|
*/
|
||
|
function l(e){var t=(e&1)===1;var n=e>>1;return t?-n:n}/**
|
||
|
* Returns the base 64 VLQ encoded value.
|
||
|
*/
|
||
|
n.encode=function c(e){var t="";var n;var s=u(e);do{n=s&o;s>>>=r;if(s>0){
|
||
|
// There are still more digits in this value, so we must make sure the
|
||
|
// continuation bit is marked.
|
||
|
n|=a}t+=i.encode(n)}while(s>0);return t};/**
|
||
|
* Decodes the next base 64 VLQ value from the given string and returns the
|
||
|
* value and the rest of the string via the out parameter.
|
||
|
*/
|
||
|
n.decode=function h(e,t,n){var s=e.length;var u=0;var c=0;var h,f;do{if(t>=s){throw new Error("Expected more digits in base 64 VLQ value.")}f=i.decode(e.charCodeAt(t++));if(f===-1){throw new Error("Invalid base64 digit: "+e.charAt(t-1))}h=!!(f&a);f&=o;u=u+(f<<c);c+=r}while(h);n.value=l(u);n.rest=t}},{"./base64":23}],23:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");/**
|
||
|
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
||
|
*/
|
||
|
n.encode=function(e){if(0<=e&&e<i.length){return i[e]}throw new TypeError("Must be between 0 and 63: "+e)};/**
|
||
|
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
||
|
* failure.
|
||
|
*/
|
||
|
n.decode=function(e){var t=65;// 'A'
|
||
|
var n=90;// 'Z'
|
||
|
var i=97;// 'a'
|
||
|
var r=122;// 'z'
|
||
|
var s=48;// '0'
|
||
|
var o=57;// '9'
|
||
|
var a=43;// '+'
|
||
|
var u=47;// '/'
|
||
|
var l=26;var c=52;
|
||
|
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||
|
if(t<=e&&e<=n){return e-t}
|
||
|
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
||
|
if(i<=e&&e<=r){return e-i+l}
|
||
|
// 52 - 61: 0123456789
|
||
|
if(s<=e&&e<=o){return e-s+c}
|
||
|
// 62: +
|
||
|
if(e==a){return 62}
|
||
|
// 63: /
|
||
|
if(e==u){return 63}
|
||
|
// Invalid base64 digit.
|
||
|
return-1}},{}],24:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
n.GREATEST_LOWER_BOUND=1;n.LEAST_UPPER_BOUND=2;/**
|
||
|
* Recursive implementation of binary search.
|
||
|
*
|
||
|
* @param aLow Indices here and lower do not contain the needle.
|
||
|
* @param aHigh Indices here and higher do not contain the needle.
|
||
|
* @param aNeedle The element being searched for.
|
||
|
* @param aHaystack The non-empty array being searched.
|
||
|
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
||
|
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||
|
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||
|
* closest element that is smaller than or greater than the one we are
|
||
|
* searching for, respectively, if the exact element cannot be found.
|
||
|
*/
|
||
|
function i(e,t,r,s,o,a){
|
||
|
// This function terminates when one of the following is true:
|
||
|
//
|
||
|
// 1. We find the exact element we are looking for.
|
||
|
//
|
||
|
// 2. We did not find the exact element, but we can return the index of
|
||
|
// the next-closest element.
|
||
|
//
|
||
|
// 3. We did not find the exact element, and there is no next-closest
|
||
|
// element than the one we are searching for, so we return -1.
|
||
|
var u=Math.floor((t-e)/2)+e;var l=o(r,s[u],true);if(l===0){
|
||
|
// Found the element we are looking for.
|
||
|
return u}else if(l>0){
|
||
|
// Our needle is greater than aHaystack[mid].
|
||
|
if(t-u>1){
|
||
|
// The element is in the upper half.
|
||
|
return i(u,t,r,s,o,a)}
|
||
|
// The exact needle element was not found in this haystack. Determine if
|
||
|
// we are in termination case (3) or (2) and return the appropriate thing.
|
||
|
if(a==n.LEAST_UPPER_BOUND){return t<s.length?t:-1}else{return u}}else{
|
||
|
// Our needle is less than aHaystack[mid].
|
||
|
if(u-e>1){
|
||
|
// The element is in the lower half.
|
||
|
return i(e,u,r,s,o,a)}
|
||
|
// we are in termination case (3) or (2) and return the appropriate thing.
|
||
|
if(a==n.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}/**
|
||
|
* This is an implementation of binary search which will always try and return
|
||
|
* the index of the closest element if there is no exact hit. This is because
|
||
|
* mappings between original and generated line/col pairs are single points,
|
||
|
* and there is an implicit region between each of them, so a miss just means
|
||
|
* that you aren't on the very start of a region.
|
||
|
*
|
||
|
* @param aNeedle The element you are looking for.
|
||
|
* @param aHaystack The array that is being searched.
|
||
|
* @param aCompare A function which takes the needle and an element in the
|
||
|
* array and returns -1, 0, or 1 depending on whether the needle is less
|
||
|
* than, equal to, or greater than the element, respectively.
|
||
|
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||
|
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||
|
* closest element that is smaller than or greater than the one we are
|
||
|
* searching for, respectively, if the exact element cannot be found.
|
||
|
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
||
|
*/
|
||
|
n.search=function r(e,t,s,o){if(t.length===0){return-1}var a=i(-1,t.length,e,t,s,o||n.GREATEST_LOWER_BOUND);if(a<0){return-1}
|
||
|
// We have found either the exact element, or the next-closest element than
|
||
|
// the one we are searching for. However, there may be more than one such
|
||
|
// element. Make sure we always return the smallest of these.
|
||
|
while(a-1>=0){if(s(t[a],t[a-1],true)!==0){break}--a}return a}},{}],25:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2014 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i=e("./util");/**
|
||
|
* Determine whether mappingB is after mappingA with respect to generated
|
||
|
* position.
|
||
|
*/
|
||
|
function r(e,t){
|
||
|
// Optimized for most common case
|
||
|
var n=e.generatedLine;var r=t.generatedLine;var s=e.generatedColumn;var o=t.generatedColumn;return r>n||r==n&&o>=s||i.compareByGeneratedPositionsInflated(e,t)<=0}/**
|
||
|
* A data structure to provide a sorted view of accumulated mappings in a
|
||
|
* performance conscious manner. It trades a neglibable overhead in general
|
||
|
* case for a large speedup in case of mappings being added in order.
|
||
|
*/
|
||
|
function s(){this._array=[];this._sorted=true;
|
||
|
// Serves as infimum
|
||
|
this._last={generatedLine:-1,generatedColumn:0}}/**
|
||
|
* Iterate through internal items. This method takes the same arguments that
|
||
|
* `Array.prototype.forEach` takes.
|
||
|
*
|
||
|
* NOTE: The order of the mappings is NOT guaranteed.
|
||
|
*/
|
||
|
s.prototype.unsortedForEach=function o(e,t){this._array.forEach(e,t)};/**
|
||
|
* Add the given source mapping.
|
||
|
*
|
||
|
* @param Object aMapping
|
||
|
*/
|
||
|
s.prototype.add=function a(e){if(r(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};/**
|
||
|
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||
|
* generated position.
|
||
|
*
|
||
|
* WARNING: This method returns internal data without copying, for
|
||
|
* performance. The return value must NOT be mutated, and should be treated as
|
||
|
* an immutable borrow. If you want to take ownership, you must make your own
|
||
|
* copy.
|
||
|
*/
|
||
|
s.prototype.toArray=function u(){if(!this._sorted){this._array.sort(i.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};n.MappingList=s},{"./util":30}],26:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
// It turns out that some (most?) JavaScript engines don't self-host
|
||
|
// `Array.prototype.sort`. This makes sense because C++ will likely remain
|
||
|
// faster than JS when doing raw CPU-intensive sorting. However, when using a
|
||
|
// custom comparator function, calling back and forth between the VM's C++ and
|
||
|
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
|
||
|
// worse generated code for the comparator function than would be optimal. In
|
||
|
// fact, when sorting with a comparator, these costs outweigh the benefits of
|
||
|
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
|
||
|
// a ~3500ms mean speed-up in `bench/bench.html`.
|
||
|
/**
|
||
|
* Swap the elements indexed by `x` and `y` in the array `ary`.
|
||
|
*
|
||
|
* @param {Array} ary
|
||
|
* The array.
|
||
|
* @param {Number} x
|
||
|
* The index of the first item.
|
||
|
* @param {Number} y
|
||
|
* The index of the second item.
|
||
|
*/
|
||
|
function i(e,t,n){var i=e[t];e[t]=e[n];e[n]=i}/**
|
||
|
* Returns a random integer within the range `low .. high` inclusive.
|
||
|
*
|
||
|
* @param {Number} low
|
||
|
* The lower bound on the range.
|
||
|
* @param {Number} high
|
||
|
* The upper bound on the range.
|
||
|
*/
|
||
|
function r(e,t){return Math.round(e+Math.random()*(t-e))}/**
|
||
|
* The Quick Sort algorithm.
|
||
|
*
|
||
|
* @param {Array} ary
|
||
|
* An array to sort.
|
||
|
* @param {function} comparator
|
||
|
* Function to use to compare two items.
|
||
|
* @param {Number} p
|
||
|
* Start index of the array
|
||
|
* @param {Number} r
|
||
|
* End index of the array
|
||
|
*/
|
||
|
function s(e,t,n,o){
|
||
|
// If our lower bound is less than our upper bound, we (1) partition the
|
||
|
// array into two pieces and (2) recurse on each half. If it is not, this is
|
||
|
// the empty array and our base case.
|
||
|
if(n<o){
|
||
|
// (1) Partitioning.
|
||
|
//
|
||
|
// The partitioning chooses a pivot between `p` and `r` and moves all
|
||
|
// elements that are less than or equal to the pivot to the before it, and
|
||
|
// all the elements that are greater than it after it. The effect is that
|
||
|
// once partition is done, the pivot is in the exact place it will be when
|
||
|
// the array is put in sorted order, and it will not need to be moved
|
||
|
// again. This runs in O(n) time.
|
||
|
// Always choose a random pivot so that an input array which is reverse
|
||
|
// sorted does not cause O(n^2) running time.
|
||
|
var a=r(n,o);var u=n-1;i(e,a,o);var l=e[o];
|
||
|
// Immediately after `j` is incremented in this loop, the following hold
|
||
|
// true:
|
||
|
//
|
||
|
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
|
||
|
//
|
||
|
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
|
||
|
for(var c=n;c<o;c++){if(t(e[c],l)<=0){u+=1;i(e,u,c)}}i(e,u+1,c);var h=u+1;
|
||
|
// (2) Recurse on each half.
|
||
|
s(e,t,n,h-1);s(e,t,h+1,o)}}/**
|
||
|
* Sort the given array in-place with the given comparator function.
|
||
|
*
|
||
|
* @param {Array} ary
|
||
|
* An array to sort.
|
||
|
* @param {function} comparator
|
||
|
* Function to use to compare two items.
|
||
|
*/
|
||
|
n.quickSort=function(e,t){s(e,t,0,e.length-1)}},{}],27:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i=e("./util");var r=e("./binary-search");var s=e("./array-set").ArraySet;var o=e("./base64-vlq");var a=e("./quick-sort").quickSort;function u(e,t){var n=e;if(typeof e==="string"){n=i.parseSourceMapInput(e)}return n.sections!=null?new h(n,t):new l(n,t)}u.fromSourceMap=function(e,t){return l.fromSourceMap(e,t)};/**
|
||
|
* The version of the source mapping spec that we are consuming.
|
||
|
*/
|
||
|
u.prototype._version=3;
|
||
|
// `__generatedMappings` and `__originalMappings` are arrays that hold the
|
||
|
// parsed mapping coordinates from the source map's "mappings" attribute. They
|
||
|
// are lazily instantiated, accessed via the `_generatedMappings` and
|
||
|
// `_originalMappings` getters respectively, and we only parse the mappings
|
||
|
// and create these arrays once queried for a source location. We jump through
|
||
|
// these hoops because there can be many thousands of mappings, and parsing
|
||
|
// them is expensive, so we only want to do it if we must.
|
||
|
//
|
||
|
// Each object in the arrays is of the form:
|
||
|
//
|
||
|
// {
|
||
|
// generatedLine: The line number in the generated code,
|
||
|
// generatedColumn: The column number in the generated code,
|
||
|
// source: The path to the original source file that generated this
|
||
|
// chunk of code,
|
||
|
// originalLine: The line number in the original source that
|
||
|
// corresponds to this chunk of generated code,
|
||
|
// originalColumn: The column number in the original source that
|
||
|
// corresponds to this chunk of generated code,
|
||
|
// name: The name of the original symbol which generated this chunk of
|
||
|
// code.
|
||
|
// }
|
||
|
//
|
||
|
// All properties except for `generatedLine` and `generatedColumn` can be
|
||
|
// `null`.
|
||
|
//
|
||
|
// `_generatedMappings` is ordered by the generated positions.
|
||
|
//
|
||
|
// `_originalMappings` is ordered by the original positions.
|
||
|
u.prototype.__generatedMappings=null;Object.defineProperty(u.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});u.prototype.__originalMappings=null;Object.defineProperty(u.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});u.prototype._charIsMappingSeparator=function f(e,t){var n=e.charAt(t);return n===";"||n===","};/**
|
||
|
* Parse the mappings in a string in to a data structure which we can easily
|
||
|
* query (the ordered arrays in the `this.__generatedMappings` and
|
||
|
* `this.__originalMappings` properties).
|
||
|
*/
|
||
|
u.prototype._parseMappings=function p(e,t){throw new Error("Subclasses must implement _parseMappings")};u.GENERATED_ORDER=1;u.ORIGINAL_ORDER=2;u.GREATEST_LOWER_BOUND=1;u.LEAST_UPPER_BOUND=2;/**
|
||
|
* Iterate over each mapping between an original source/line/column and a
|
||
|
* generated line/column in this source map.
|
||
|
*
|
||
|
* @param Function aCallback
|
||
|
* The function that is called with each mapping.
|
||
|
* @param Object aContext
|
||
|
* Optional. If specified, this object will be the value of `this` every
|
||
|
* time that `aCallback` is called.
|
||
|
* @param aOrder
|
||
|
* Either `SourceMapConsumer.GENERATED_ORDER` or
|
||
|
* `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
|
||
|
* iterate over the mappings sorted by the generated file's line/column
|
||
|
* order or the original's source/line/column order, respectively. Defaults to
|
||
|
* `SourceMapConsumer.GENERATED_ORDER`.
|
||
|
*/
|
||
|
u.prototype.eachMapping=function d(e,t,n){var r=t||null;var s=n||u.GENERATED_ORDER;var o;switch(s){case u.GENERATED_ORDER:o=this._generatedMappings;break;case u.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(e){var t=e.source===null?null:this._sources.at(e.source);t=i.computeSourceURL(a,t,this._sourceMapURL);return{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}},this).forEach(e,r)};/**
|
||
|
* Returns all generated line and column information for the original source,
|
||
|
* line, and column provided. If no column is provided, returns all mappings
|
||
|
* corresponding to a either the line we are searching for or the next
|
||
|
* closest line that has any mappings. Otherwise, returns all mappings
|
||
|
* corresponding to the given line and either the column we are searching for
|
||
|
* or the next closest column that has any offsets.
|
||
|
*
|
||
|
* The only argument is an object with the following properties:
|
||
|
*
|
||
|
* - source: The filename of the original source.
|
||
|
* - line: The line number in the original source. The line number is 1-based.
|
||
|
* - column: Optional. the column number in the original source.
|
||
|
* The column number is 0-based.
|
||
|
*
|
||
|
* and an array of objects is returned, each with the following properties:
|
||
|
*
|
||
|
* - line: The line number in the generated source, or null. The
|
||
|
* line number is 1-based.
|
||
|
* - column: The column number in the generated source, or null.
|
||
|
* The column number is 0-based.
|
||
|
*/
|
||
|
u.prototype.allGeneratedPositionsFor=function g(e){var t=i.getArg(e,"line");
|
||
|
// When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
|
||
|
// returns the index of the closest mapping less than the needle. By
|
||
|
// setting needle.originalColumn to 0, we thus find the last mapping for
|
||
|
// the given line, provided such a mapping exists.
|
||
|
var n={source:i.getArg(e,"source"),originalLine:t,originalColumn:i.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var s=[];var o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(o>=0){var a=this._originalMappings[o];if(e.column===undefined){var u=a.originalLine;
|
||
|
// Iterate until either we run out of mappings, or we run into
|
||
|
// a mapping for a different line than the one we found. Since
|
||
|
// mappings are sorted, this is guaranteed to find all mappings for
|
||
|
// the line we found.
|
||
|
while(a&&a.originalLine===u){s.push({line:i.getArg(a,"generatedLine",null),column:i.getArg(a,"generatedColumn",null),lastColumn:i.getArg(a,"lastGeneratedColumn",null)});a=this._originalMappings[++o]}}else{var l=a.originalColumn;
|
||
|
// Iterate until either we run out of mappings, or we run into
|
||
|
// a mapping for a different line than the one we were searching for.
|
||
|
// Since mappings are sorted, this is guaranteed to find all mappings for
|
||
|
// the line we are searching for.
|
||
|
while(a&&a.originalLine===t&&a.originalColumn==l){s.push({line:i.getArg(a,"generatedLine",null),column:i.getArg(a,"generatedColumn",null),lastColumn:i.getArg(a,"lastGeneratedColumn",null)});a=this._originalMappings[++o]}}}return s};n.SourceMapConsumer=u;/**
|
||
|
* A BasicSourceMapConsumer instance represents a parsed source map which we can
|
||
|
* query for information about the original file positions by giving it a file
|
||
|
* position in the generated source.
|
||
|
*
|
||
|
* The first parameter is the raw source map (either as a JSON string, or
|
||
|
* already parsed to an object). According to the spec, source maps have the
|
||
|
* following attributes:
|
||
|
*
|
||
|
* - version: Which version of the source map spec this map is following.
|
||
|
* - sources: An array of URLs to the original source files.
|
||
|
* - names: An array of identifiers which can be referrenced by individual mappings.
|
||
|
* - sourceRoot: Optional. The URL root from which all sources are relative.
|
||
|
* - sourcesContent: Optional. An array of contents of the original source files.
|
||
|
* - mappings: A string of base64 VLQs which contain the actual mappings.
|
||
|
* - file: Optional. The generated file this source map is associated with.
|
||
|
*
|
||
|
* Here is an example source map, taken from the source map spec[0]:
|
||
|
*
|
||
|
* {
|
||
|
* version : 3,
|
||
|
* file: "out.js",
|
||
|
* sourceRoot : "",
|
||
|
* sources: ["foo.js", "bar.js"],
|
||
|
* names: ["src", "maps", "are", "fun"],
|
||
|
* mappings: "AA,AB;;ABCDE;"
|
||
|
* }
|
||
|
*
|
||
|
* The second parameter, if given, is a string whose value is the URL
|
||
|
* at which the source map was found. This URL is used to compute the
|
||
|
* sources array.
|
||
|
*
|
||
|
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
|
||
|
*/
|
||
|
function l(e,t){var n=e;if(typeof e==="string"){n=i.parseSourceMapInput(e)}var r=i.getArg(n,"version");var o=i.getArg(n,"sources");
|
||
|
// Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
|
||
|
// requires the array) to play nice here.
|
||
|
var a=i.getArg(n,"names",[]);var u=i.getArg(n,"sourceRoot",null);var l=i.getArg(n,"sourcesContent",null);var c=i.getArg(n,"mappings");var h=i.getArg(n,"file",null);
|
||
|
// Once again, Sass deviates from the spec and supplies the version as a
|
||
|
// string rather than a number, so we use loose equality checking here.
|
||
|
if(r!=this._version){throw new Error("Unsupported version: "+r)}if(u){u=i.normalize(u)}o=o.map(String).map(i.normalize).map(function(e){return u&&i.isAbsolute(u)&&i.isAbsolute(e)?i.relative(u,e):e});
|
||
|
// Pass `true` below to allow duplicate names and sources. While source maps
|
||
|
// are intended to be compressed and deduplicated, the TypeScript compiler
|
||
|
// sometimes generates source maps with duplicates in them. See Github issue
|
||
|
// #72 and bugzil.la/889492.
|
||
|
this._names=s.fromArray(a.map(String),true);this._sources=s.fromArray(o,true);this._absoluteSources=this._sources.toArray().map(function(e){return i.computeSourceURL(u,e,t)});this.sourceRoot=u;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=t;this.file=h}l.prototype=Object.create(u.prototype);l.prototype.consumer=u;/**
|
||
|
* Utility function to find the index of a source. Returns -1 if not
|
||
|
* found.
|
||
|
*/
|
||
|
l.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null){t=i.relative(this.sourceRoot,t)}if(this._sources.has(t)){return this._sources.indexOf(t)}
|
||
|
// Maybe aSource is an absolute URL as returned by |sources|. In
|
||
|
// this case we can't simply undo the transform.
|
||
|
var n;for(n=0;n<this._absoluteSources.length;++n){if(this._absoluteSources[n]==e){return n}}return-1};/**
|
||
|
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
|
||
|
*
|
||
|
* @param SourceMapGenerator aSourceMap
|
||
|
* The source map that will be consumed.
|
||
|
* @param String aSourceMapURL
|
||
|
* The URL at which the source map can be found (optional)
|
||
|
* @returns BasicSourceMapConsumer
|
||
|
*/
|
||
|
l.fromSourceMap=function m(e,t){var n=Object.create(l.prototype);var r=n._names=s.fromArray(e._names.toArray(),true);var o=n._sources=s.fromArray(e._sources.toArray(),true);n.sourceRoot=e._sourceRoot;n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot);n.file=e._file;n._sourceMapURL=t;n._absoluteSources=n._sources.toArray().map(function(e){return i.computeSourceURL(n.sourceRoot,e,t)});
|
||
|
// Because we are modifying the entries (by converting string sources and
|
||
|
// names to indices into the sources and names ArraySets), we have to make
|
||
|
// a copy of the entry or else bad things happen. Shared mutable state
|
||
|
// strikes again! See github issue #191.
|
||
|
var u=e._mappings.toArray().slice();var h=n.__generatedMappings=[];var f=n.__originalMappings=[];for(var p=0,d=u.length;p<d;p++){var g=u[p];var m=new c;m.generatedLine=g.generatedLine;m.generatedColumn=g.generatedColumn;if(g.source){m.source=o.indexOf(g.source);m.originalLine=g.originalLine;m.originalColumn=g.originalColumn;if(g.name){m.name=r.indexOf(g.name)}f.push(m)}h.push(m)}a(n.__originalMappings,i.compareByOriginalPositions);return n};/**
|
||
|
* The version of the source mapping spec that we are consuming.
|
||
|
*/
|
||
|
l.prototype._version=3;/**
|
||
|
* The list of original sources.
|
||
|
*/
|
||
|
Object.defineProperty(l.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});/**
|
||
|
* Provide the JIT with a nice shape / hidden class.
|
||
|
*/
|
||
|
function c(){this.generatedLine=0;this.generatedColumn=0;this.source=null;this.originalLine=null;this.originalColumn=null;this.name=null}/**
|
||
|
* Parse the mappings in a string in to a data structure which we can easily
|
||
|
* query (the ordered arrays in the `this.__generatedMappings` and
|
||
|
* `this.__originalMappings` properties).
|
||
|
*/
|
||
|
l.prototype._parseMappings=function y(e,t){var n=1;var r=0;var s=0;var u=0;var l=0;var h=0;var f=e.length;var p=0;var d={};var g={};var m=[];var y=[];var v,b,w,k,L;while(p<f){if(e.charAt(p)===";"){n++;p++;r=0}else if(e.charAt(p)===","){p++}else{v=new c;v.generatedLine=n;
|
||
|
// Because each offset is encoded relative to the previous one,
|
||
|
// many segments often have the same encoding. We can exploit this
|
||
|
// fact by caching the parsed variable length fields of each segment,
|
||
|
// allowing us to avoid a second parse if we encounter the same
|
||
|
// segment again.
|
||
|
for(k=p;k<f;k++){if(this._charIsMappingSeparator(e,k)){break}}b=e.slice(p,k);w=d[b];if(w){p+=b.length}else{w=[];while(p<k){o.decode(e,p,g);L=g.value;p=g.rest;w.push(L)}if(w.length===2){throw new Error("Found a source, but no line and column")}if(w.length===3){throw new Error("Found a source and line, but no column")}d[b]=w}
|
||
|
// Generated column.
|
||
|
v.generatedColumn=r+w[0];r=v.generatedColumn;if(w.length>1){
|
||
|
// Original source.
|
||
|
v.source=l+w[1];l+=w[1];
|
||
|
// Original line.
|
||
|
v.originalLine=s+w[2];s=v.originalLine;
|
||
|
// Lines are stored 0-based
|
||
|
v.originalLine+=1;
|
||
|
// Original column.
|
||
|
v.originalColumn=u+w[3];u=v.originalColumn;if(w.length>4){
|
||
|
// Original name.
|
||
|
v.name=h+w[4];h+=w[4]}}y.push(v);if(typeof v.originalLine==="number"){m.push(v)}}}a(y,i.compareByGeneratedPositionsDeflated);this.__generatedMappings=y;a(m,i.compareByOriginalPositions);this.__originalMappings=m};/**
|
||
|
* Find the mapping that best matches the hypothetical "needle" mapping that
|
||
|
* we are searching for in the given "haystack" of mappings.
|
||
|
*/
|
||
|
l.prototype._findMapping=function v(e,t,n,i,s,o){
|
||
|
// To return the position we are searching for, we must first find the
|
||
|
// mapping for the given position and then return the opposite position it
|
||
|
// points to. Because the mappings are sorted, we can use binary search to
|
||
|
// find the best mapping.
|
||
|
if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[i]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[i])}return r.search(e,t,s,o)};/**
|
||
|
* Compute the last column for each generated mapping. The last column is
|
||
|
* inclusive.
|
||
|
*/
|
||
|
l.prototype.computeColumnSpans=function b(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];
|
||
|
// Mappings do not contain a field for the last generated columnt. We
|
||
|
// can come up with an optimistic estimate, however, by assuming that
|
||
|
// mappings are contiguous (i.e. given two consecutive mappings, the
|
||
|
// first mapping ends where the second one starts).
|
||
|
if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}
|
||
|
// The last mapping for each line spans the entire line.
|
||
|
t.lastGeneratedColumn=Infinity}};/**
|
||
|
* Returns the original source, line, and column information for the generated
|
||
|
* source's line and column positions provided. The only argument is an object
|
||
|
* with the following properties:
|
||
|
*
|
||
|
* - line: The line number in the generated source. The line number
|
||
|
* is 1-based.
|
||
|
* - column: The column number in the generated source. The column
|
||
|
* number is 0-based.
|
||
|
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
|
||
|
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||
|
* closest element that is smaller than or greater than the one we are
|
||
|
* searching for, respectively, if the exact element cannot be found.
|
||
|
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
|
||
|
*
|
||
|
* and an object is returned with the following properties:
|
||
|
*
|
||
|
* - source: The original source file, or null.
|
||
|
* - line: The line number in the original source, or null. The
|
||
|
* line number is 1-based.
|
||
|
* - column: The column number in the original source, or null. The
|
||
|
* column number is 0-based.
|
||
|
* - name: The original identifier, or null.
|
||
|
*/
|
||
|
l.prototype.originalPositionFor=function w(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")};var n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",i.compareByGeneratedPositionsDeflated,i.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===t.generatedLine){var s=i.getArg(r,"source",null);if(s!==null){s=this._sources.at(s);s=i.computeSourceURL(this.sourceRoot,s,this._sourceMapURL)}var o=i.getArg(r,"name",null);if(o!==null){o=this._names.at(o)}return{source:s,line:i.getArg(r,"originalLine",null),column:i.getArg(r,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};/**
|
||
|
* Return true if we have the source content for every source in the source
|
||
|
* map, false otherwise.
|
||
|
*/
|
||
|
l.prototype.hasContentsOfAllSources=function k(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null})};/**
|
||
|
* Returns the original source content. The only argument is the url of the
|
||
|
* original source file. Returns null if no original source content is
|
||
|
* available.
|
||
|
*/
|
||
|
l.prototype.sourceContentFor=function L(e,t){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var r=e;if(this.sourceRoot!=null){r=i.relative(this.sourceRoot,r)}var s;if(this.sourceRoot!=null&&(s=i.urlParse(this.sourceRoot))){
|
||
|
// XXX: file:// URIs and absolute paths lead to unexpected behavior for
|
||
|
// many users. We can help them out when they expect file:// URIs to
|
||
|
// behave like it would if they were running a local HTTP server. See
|
||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
|
||
|
var o=r.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o)){return this.sourcesContent[this._sources.indexOf(o)]}if((!s.path||s.path=="/")&&this._sources.has("/"+r)){return this.sourcesContent[this._sources.indexOf("/"+r)]}}
|
||
|
// This function is used recursively from
|
||
|
// IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
|
||
|
// don't want to throw if we can't find the source - we just want to
|
||
|
// return null, so we provide a flag to exit gracefully.
|
||
|
if(t){return null}else{throw new Error('"'+r+'" is not in the SourceMap.')}};/**
|
||
|
* Returns the generated line and column information for the original source,
|
||
|
* line, and column positions provided. The only argument is an object with
|
||
|
* the following properties:
|
||
|
*
|
||
|
* - source: The filename of the original source.
|
||
|
* - line: The line number in the original source. The line number
|
||
|
* is 1-based.
|
||
|
* - column: The column number in the original source. The column
|
||
|
* number is 0-based.
|
||
|
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
|
||
|
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||
|
* closest element that is smaller than or greater than the one we are
|
||
|
* searching for, respectively, if the exact element cannot be found.
|
||
|
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
|
||
|
*
|
||
|
* and an object is returned with the following properties:
|
||
|
*
|
||
|
* - line: The line number in the generated source, or null. The
|
||
|
* line number is 1-based.
|
||
|
* - column: The column number in the generated source, or null.
|
||
|
* The column number is 0-based.
|
||
|
*/
|
||
|
l.prototype.generatedPositionFor=function A(e){var t=i.getArg(e,"source");t=this._findSourceIndex(t);if(t<0){return{line:null,column:null,lastColumn:null}}var n={source:t,originalLine:i.getArg(e,"line"),originalColumn:i.getArg(e,"column")};var r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(r>=0){var s=this._originalMappings[r];if(s.source===n.source){return{line:i.getArg(s,"generatedLine",null),column:i.getArg(s,"generatedColumn",null),lastColumn:i.getArg(s,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};n.BasicSourceMapConsumer=l;/**
|
||
|
* An IndexedSourceMapConsumer instance represents a parsed source map which
|
||
|
* we can query for information. It differs from BasicSourceMapConsumer in
|
||
|
* that it takes "indexed" source maps (i.e. ones with a "sections" field) as
|
||
|
* input.
|
||
|
*
|
||
|
* The first parameter is a raw source map (either as a JSON string, or already
|
||
|
* parsed to an object). According to the spec for indexed source maps, they
|
||
|
* have the following attributes:
|
||
|
*
|
||
|
* - version: Which version of the source map spec this map is following.
|
||
|
* - file: Optional. The generated file this source map is associated with.
|
||
|
* - sections: A list of section definitions.
|
||
|
*
|
||
|
* Each value under the "sections" field has two fields:
|
||
|
* - offset: The offset into the original specified at which this section
|
||
|
* begins to apply, defined as an object with a "line" and "column"
|
||
|
* field.
|
||
|
* - map: A source map definition. This source map could also be indexed,
|
||
|
* but doesn't have to be.
|
||
|
*
|
||
|
* Instead of the "map" field, it's also possible to have a "url" field
|
||
|
* specifying a URL to retrieve a source map from, but that's currently
|
||
|
* unsupported.
|
||
|
*
|
||
|
* Here's an example source map, taken from the source map spec[0], but
|
||
|
* modified to omit a section which uses the "url" field.
|
||
|
*
|
||
|
* {
|
||
|
* version : 3,
|
||
|
* file: "app.js",
|
||
|
* sections: [{
|
||
|
* offset: {line:100, column:10},
|
||
|
* map: {
|
||
|
* version : 3,
|
||
|
* file: "section.js",
|
||
|
* sources: ["foo.js", "bar.js"],
|
||
|
* names: ["src", "maps", "are", "fun"],
|
||
|
* mappings: "AAAA,E;;ABCDE;"
|
||
|
* }
|
||
|
* }],
|
||
|
* }
|
||
|
*
|
||
|
* The second parameter, if given, is a string whose value is the URL
|
||
|
* at which the source map was found. This URL is used to compute the
|
||
|
* sources array.
|
||
|
*
|
||
|
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
|
||
|
*/
|
||
|
function h(e,t){var n=e;if(typeof e==="string"){n=i.parseSourceMapInput(e)}var r=i.getArg(n,"version");var o=i.getArg(n,"sections");if(r!=this._version){throw new Error("Unsupported version: "+r)}this._sources=new s;this._names=new s;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url){
|
||
|
// The url field will require support for asynchronicity.
|
||
|
// See https://github.com/mozilla/source-map/issues/16
|
||
|
throw new Error("Support for url field in sections not implemented.")}var n=i.getArg(e,"offset");var r=i.getArg(n,"line");var s=i.getArg(n,"column");if(r<a.line||r===a.line&&s<a.column){throw new Error("Section offsets must be ordered and non-overlapping.")}a=n;return{generatedOffset:{
|
||
|
// The offset fields are 0-based, but we use 1-based indices when
|
||
|
// encoding/decoding from VLQ.
|
||
|
generatedLine:r+1,generatedColumn:s+1},consumer:new u(i.getArg(e,"map"),t)}})}h.prototype=Object.create(u.prototype);h.prototype.constructor=u;/**
|
||
|
* The version of the source mapping spec that we are consuming.
|
||
|
*/
|
||
|
h.prototype._version=3;/**
|
||
|
* The list of original sources.
|
||
|
*/
|
||
|
Object.defineProperty(h.prototype,"sources",{get:function(){var e=[];for(var t=0;t<this._sections.length;t++){for(var n=0;n<this._sections[t].consumer.sources.length;n++){e.push(this._sections[t].consumer.sources[n])}}return e}});/**
|
||
|
* Returns the original source, line, and column information for the generated
|
||
|
* source's line and column positions provided. The only argument is an object
|
||
|
* with the following properties:
|
||
|
*
|
||
|
* - line: The line number in the generated source. The line number
|
||
|
* is 1-based.
|
||
|
* - column: The column number in the generated source. The column
|
||
|
* number is 0-based.
|
||
|
*
|
||
|
* and an object is returned with the following properties:
|
||
|
*
|
||
|
* - source: The original source file, or null.
|
||
|
* - line: The line number in the original source, or null. The
|
||
|
* line number is 1-based.
|
||
|
* - column: The column number in the original source, or null. The
|
||
|
* column number is 0-based.
|
||
|
* - name: The original identifier, or null.
|
||
|
*/
|
||
|
h.prototype.originalPositionFor=function E(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")};
|
||
|
// Find the section containing the generated position we're trying to map
|
||
|
// to an original position.
|
||
|
var n=r.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;if(n){return n}return e.generatedColumn-t.generatedOffset.generatedColumn});var s=this._sections[n];if(!s){return{source:null,line:null,column:null,name:null}}return s.consumer.originalPositionFor({line:t.generatedLine-(s.generatedOffset.generatedLine-1),column:t.generatedColumn-(s.generatedOffset.generatedLine===t.generatedLine?s.generatedOffset.generatedColumn-1:0),bias:e.bias})};/**
|
||
|
* Return true if we have the source content for every source in the source
|
||
|
* map, false otherwise.
|
||
|
*/
|
||
|
h.prototype.hasContentsOfAllSources=function C(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};/**
|
||
|
* Returns the original source content. The only argument is the url of the
|
||
|
* original source file. Returns null if no original source content is
|
||
|
* available.
|
||
|
*/
|
||
|
h.prototype.sourceContentFor=function S(e,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n];var r=i.consumer.sourceContentFor(e,true);if(r){return r}}if(t){return null}else{throw new Error('"'+e+'" is not in the SourceMap.')}};/**
|
||
|
* Returns the generated line and column information for the original source,
|
||
|
* line, and column positions provided. The only argument is an object with
|
||
|
* the following properties:
|
||
|
*
|
||
|
* - source: The filename of the original source.
|
||
|
* - line: The line number in the original source. The line number
|
||
|
* is 1-based.
|
||
|
* - column: The column number in the original source. The column
|
||
|
* number is 0-based.
|
||
|
*
|
||
|
* and an object is returned with the following properties:
|
||
|
*
|
||
|
* - line: The line number in the generated source, or null. The
|
||
|
* line number is 1-based.
|
||
|
* - column: The column number in the generated source, or null.
|
||
|
* The column number is 0-based.
|
||
|
*/
|
||
|
h.prototype.generatedPositionFor=function R(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];
|
||
|
// Only consider this section if the requested source is in the list of
|
||
|
// sources of the consumer.
|
||
|
if(n.consumer._findSourceIndex(i.getArg(e,"source"))===-1){continue}var r=n.consumer.generatedPositionFor(e);if(r){var s={line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)};return s}}return{line:null,column:null}};/**
|
||
|
* Parse the mappings in a string in to a data structure which we can easily
|
||
|
* query (the ordered arrays in the `this.__generatedMappings` and
|
||
|
* `this.__originalMappings` properties).
|
||
|
*/
|
||
|
h.prototype._parseMappings=function N(e,t){this.__generatedMappings=[];this.__originalMappings=[];for(var n=0;n<this._sections.length;n++){var r=this._sections[n];var s=r.consumer._generatedMappings;for(var o=0;o<s.length;o++){var u=s[o];var l=r.consumer._sources.at(u.source);l=i.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL);this._sources.add(l);l=this._sources.indexOf(l);var c=null;if(u.name){c=r.consumer._names.at(u.name);this._names.add(c);c=this._names.indexOf(c)}
|
||
|
// The mappings coming from the consumer for the section have
|
||
|
// generated positions relative to the start of the section, so we
|
||
|
// need to offset them to be relative to the start of the concatenated
|
||
|
// generated file.
|
||
|
var h={source:l,generatedLine:u.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(r.generatedOffset.generatedLine===u.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:c};this.__generatedMappings.push(h);if(typeof h.originalLine==="number"){this.__originalMappings.push(h)}}}a(this.__generatedMappings,i.compareByGeneratedPositionsDeflated);a(this.__originalMappings,i.compareByOriginalPositions)};n.IndexedSourceMapConsumer=h},{"./array-set":21,"./base64-vlq":22,"./binary-search":24,"./quick-sort":26,"./util":30}],28:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i=e("./base64-vlq");var r=e("./util");var s=e("./array-set").ArraySet;var o=e("./mapping-list").MappingList;/**
|
||
|
* An instance of the SourceMapGenerator represents a source map which is
|
||
|
* being built incrementally. You may pass an object with the following
|
||
|
* properties:
|
||
|
*
|
||
|
* - file: The filename of the generated source.
|
||
|
* - sourceRoot: A root for all relative URLs in this source map.
|
||
|
*/
|
||
|
function a(e){if(!e){e={}}this._file=r.getArg(e,"file",null);this._sourceRoot=r.getArg(e,"sourceRoot",null);this._skipValidation=r.getArg(e,"skipValidation",false);this._sources=new s;this._names=new s;this._mappings=new o;this._sourcesContents=null}a.prototype._version=3;/**
|
||
|
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||
|
*
|
||
|
* @param aSourceMapConsumer The SourceMap.
|
||
|
*/
|
||
|
a.fromSourceMap=function u(e){var t=e.sourceRoot;var n=new a({file:e.file,sourceRoot:t});e.eachMapping(function(e){var i={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){i.source=e.source;if(t!=null){i.source=r.relative(t,i.source)}i.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){i.name=e.name}}n.addMapping(i)});e.sources.forEach(function(i){var s=i;if(t!==null){s=r.relative(t,i)}if(!n._sources.has(s)){n._sources.add(s)}var o=e.sourceContentFor(i);if(o!=null){n.setSourceContent(i,o)}});return n};/**
|
||
|
* Add a single mapping from original source line and column to the generated
|
||
|
* source's line and column for this source map being created. The mapping
|
||
|
* object should have the following properties:
|
||
|
*
|
||
|
* - generated: An object with the generated line and column positions.
|
||
|
* - original: An object with the original line and column positions.
|
||
|
* - source: The original source file (relative to the sourceRoot).
|
||
|
* - name: An optional original token name for this mapping.
|
||
|
*/
|
||
|
a.prototype.addMapping=function l(e){var t=r.getArg(e,"generated");var n=r.getArg(e,"original",null);var i=r.getArg(e,"source",null);var s=r.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(t,n,i,s)}if(i!=null){i=String(i);if(!this._sources.has(i)){this._sources.add(i)}}if(s!=null){s=String(s);if(!this._names.has(s)){this._names.add(s)}}this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})};/**
|
||
|
* Set the source content for a source file.
|
||
|
*/
|
||
|
a.prototype.setSourceContent=function c(e,t){var n=e;if(this._sourceRoot!=null){n=r.relative(this._sourceRoot,n)}if(t!=null){
|
||
|
// Add the source content to the _sourcesContents map.
|
||
|
// Create a new _sourcesContents map if the property is null.
|
||
|
if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[r.toSetString(n)]=t}else if(this._sourcesContents){
|
||
|
// Remove the source file from the _sourcesContents map.
|
||
|
// If the _sourcesContents map is empty, set the property to null.
|
||
|
delete this._sourcesContents[r.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};/**
|
||
|
* Applies the mappings of a sub-source-map for a specific source file to the
|
||
|
* source map being generated. Each mapping to the supplied source file is
|
||
|
* rewritten using the supplied source map. Note: The resolution for the
|
||
|
* resulting mappings is the minimium of this map and the supplied map.
|
||
|
*
|
||
|
* @param aSourceMapConsumer The source map to be applied.
|
||
|
* @param aSourceFile Optional. The filename of the source file.
|
||
|
* If omitted, SourceMapConsumer's file property will be used.
|
||
|
* @param aSourceMapPath Optional. The dirname of the path to the source map
|
||
|
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||
|
* This parameter is needed when the two source maps aren't in the same
|
||
|
* directory, and the source map to be applied contains relative source
|
||
|
* paths. If so, those relative source paths need to be rewritten
|
||
|
* relative to the SourceMapGenerator.
|
||
|
*/
|
||
|
a.prototype.applySourceMap=function h(e,t,n){var i=t;
|
||
|
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
||
|
if(t==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}i=e.file}var o=this._sourceRoot;
|
||
|
// Make "sourceFile" relative if an absolute Url is passed.
|
||
|
if(o!=null){i=r.relative(o,i)}
|
||
|
// Applying the SourceMap can add and remove items from the sources and
|
||
|
// the names array.
|
||
|
var a=new s;var u=new s;
|
||
|
// Find mappings for the "sourceFile"
|
||
|
this._mappings.unsortedForEach(function(t){if(t.source===i&&t.originalLine!=null){
|
||
|
// Check if it can be mapped by the source map, then update the mapping.
|
||
|
var s=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});if(s.source!=null){
|
||
|
// Copy mapping
|
||
|
t.source=s.source;if(n!=null){t.source=r.join(n,t.source)}if(o!=null){t.source=r.relative(o,t.source)}t.originalLine=s.line;t.originalColumn=s.column;if(s.name!=null){t.name=s.name}}}var l=t.source;if(l!=null&&!a.has(l)){a.add(l)}var c=t.name;if(c!=null&&!u.has(c)){u.add(c)}},this);this._sources=a;this._names=u;
|
||
|
// Copy sourcesContents of applied map.
|
||
|
e.sources.forEach(function(t){var i=e.sourceContentFor(t);if(i!=null){if(n!=null){t=r.join(n,t)}if(o!=null){t=r.relative(o,t)}this.setSourceContent(t,i)}},this)};/**
|
||
|
* A mapping can have one of the three levels of data:
|
||
|
*
|
||
|
* 1. Just the generated position.
|
||
|
* 2. The Generated position, original position, and original source.
|
||
|
* 3. Generated and original position, original source, as well as a name
|
||
|
* token.
|
||
|
*
|
||
|
* To maintain consistency, we validate that any new mapping being added falls
|
||
|
* in to one of these categories.
|
||
|
*/
|
||
|
a.prototype._validateMapping=function f(e,t,n,i){
|
||
|
// When aOriginal is truthy but has empty values for .line and .column,
|
||
|
// it is most likely a programmer error. In this case we throw a very
|
||
|
// specific error message to try to guide them the right way.
|
||
|
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
||
|
if(t&&typeof t.line!=="number"&&typeof t.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!i){
|
||
|
// Case 1.
|
||
|
return}else if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n){
|
||
|
// Cases 2 and 3.
|
||
|
return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}))}};/**
|
||
|
* Serialize the accumulated mappings in to the stream of base 64 VLQs
|
||
|
* specified by the source map format.
|
||
|
*/
|
||
|
a.prototype._serializeMappings=function p(){var e=0;var t=1;var n=0;var s=0;var o=0;var a=0;var u="";var l;var c;var h;var f;var p=this._mappings.toArray();for(var d=0,g=p.length;d<g;d++){c=p[d];l="";if(c.generatedLine!==t){e=0;while(c.generatedLine!==t){l+=";";t++}}else{if(d>0){if(!r.compareByGeneratedPositionsInflated(c,p[d-1])){continue}l+=","}}l+=i.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=i.encode(f-a);a=f;
|
||
|
// lines are stored 0-based in SourceMap spec version 3
|
||
|
l+=i.encode(c.originalLine-1-s);s=c.originalLine-1;l+=i.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){h=this._names.indexOf(c.name);l+=i.encode(h-o);o=h}}u+=l}return u};a.prototype._generateSourcesContent=function d(e,t){return e.map(function(e){if(!this._sourcesContents){return null}if(t!=null){e=r.relative(t,e)}var n=r.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};/**
|
||
|
* Externalize the source map.
|
||
|
*/
|
||
|
a.prototype.toJSON=function g(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};/**
|
||
|
* Render the source map being generated to a string.
|
||
|
*/
|
||
|
a.prototype.toString=function m(){return JSON.stringify(this.toJSON())};n.SourceMapGenerator=a},{"./array-set":21,"./base64-vlq":22,"./mapping-list":25,"./util":30}],29:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
var i=e("./source-map-generator").SourceMapGenerator;var r=e("./util");
|
||
|
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||
|
// operating systems these days (capturing the result).
|
||
|
var s=/(\r?\n)/;
|
||
|
// Newline character code for charCodeAt() comparisons
|
||
|
var o=10;
|
||
|
// Private symbol for identifying `SourceNode`s when multiple versions of
|
||
|
// the source-map library are loaded. This MUST NOT CHANGE across
|
||
|
// versions!
|
||
|
var a="$$$isSourceNode$$$";/**
|
||
|
* SourceNodes provide a way to abstract over interpolating/concatenating
|
||
|
* snippets of generated JavaScript source code while maintaining the line and
|
||
|
* column information associated with the original source code.
|
||
|
*
|
||
|
* @param aLine The original line number.
|
||
|
* @param aColumn The original column number.
|
||
|
* @param aSource The original source's filename.
|
||
|
* @param aChunks Optional. An array of strings which are snippets of
|
||
|
* generated JS, or other SourceNodes.
|
||
|
* @param aName The original identifier.
|
||
|
*/
|
||
|
function u(e,t,n,i,r){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=t==null?null:t;this.source=n==null?null:n;this.name=r==null?null:r;this[a]=true;if(i!=null)this.add(i)}/**
|
||
|
* Creates a SourceNode from generated code and a SourceMapConsumer.
|
||
|
*
|
||
|
* @param aGeneratedCode The generated code
|
||
|
* @param aSourceMapConsumer The SourceMap for the generated code
|
||
|
* @param aRelativePath Optional. The path that relative sources in the
|
||
|
* SourceMapConsumer should be relative to.
|
||
|
*/
|
||
|
u.fromStringWithSourceMap=function l(e,t,n){
|
||
|
// The SourceNode we want to fill with the generated code
|
||
|
// and the SourceMap
|
||
|
var i=new u;
|
||
|
// All even indices of this array are one line of the generated code,
|
||
|
// while all odd indices are the newlines between two adjacent lines
|
||
|
// (since `REGEX_NEWLINE` captures its match).
|
||
|
// Processed fragments are accessed by calling `shiftNextLine`.
|
||
|
var o=e.split(s);var a=0;var l=function(){var e=n();
|
||
|
// The last line of a file might not have a newline.
|
||
|
var t=n()||"";return e+t;function n(){return a<o.length?o[a++]:undefined}};
|
||
|
// We need to remember the position of "remainingLines"
|
||
|
var c=1,h=0;
|
||
|
// The generate SourceNodes we need a code range.
|
||
|
// To extract it current and last mapping is used.
|
||
|
// Here we store the last mapping.
|
||
|
var f=null;t.eachMapping(function(e){if(f!==null){
|
||
|
// We add the code from "lastMapping" to "mapping":
|
||
|
// First check if there is a new line in between.
|
||
|
if(c<e.generatedLine){
|
||
|
// Associate first line with "lastMapping"
|
||
|
p(f,l());c++;h=0}else{
|
||
|
// There is no new line in between.
|
||
|
// Associate the code between "lastGeneratedColumn" and
|
||
|
// "mapping.generatedColumn" with "lastMapping"
|
||
|
var t=o[a]||"";var n=t.substr(0,e.generatedColumn-h);o[a]=t.substr(e.generatedColumn-h);h=e.generatedColumn;p(f,n);
|
||
|
// No more remaining code, continue
|
||
|
f=e;return}}
|
||
|
// We add the generated code until the first mapping
|
||
|
// to the SourceNode without any mapping.
|
||
|
// Each line is added as separate string.
|
||
|
while(c<e.generatedLine){i.add(l());c++}if(h<e.generatedColumn){var t=o[a]||"";i.add(t.substr(0,e.generatedColumn));o[a]=t.substr(e.generatedColumn);h=e.generatedColumn}f=e},this);
|
||
|
// We have processed all mappings.
|
||
|
if(a<o.length){if(f){
|
||
|
// Associate the remaining code in the current line with "lastMapping"
|
||
|
p(f,l())}
|
||
|
// and add the remaining lines without any mapping
|
||
|
i.add(o.splice(a).join(""))}
|
||
|
// Copy sourcesContent into SourceNode
|
||
|
t.sources.forEach(function(e){var s=t.sourceContentFor(e);if(s!=null){if(n!=null){e=r.join(n,e)}i.setSourceContent(e,s)}});return i;function p(e,t){if(e===null||e.source===undefined){i.add(t)}else{var s=n?r.join(n,e.source):e.source;i.add(new u(e.originalLine,e.originalColumn,s,t,e.name))}}};/**
|
||
|
* Add a chunk of generated JS to this source node.
|
||
|
*
|
||
|
* @param aChunk A string snippet of generated JS code, another instance of
|
||
|
* SourceNode, or an array where each member is one of those things.
|
||
|
*/
|
||
|
u.prototype.add=function c(e){if(Array.isArray(e)){e.forEach(function(e){this.add(e)},this)}else if(e[a]||typeof e==="string"){if(e){this.children.push(e)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};/**
|
||
|
* Add a chunk of generated JS to the beginning of this source node.
|
||
|
*
|
||
|
* @param aChunk A string snippet of generated JS code, another instance of
|
||
|
* SourceNode, or an array where each member is one of those things.
|
||
|
*/
|
||
|
u.prototype.prepend=function h(e){if(Array.isArray(e)){for(var t=e.length-1;t>=0;t--){this.prepend(e[t])}}else if(e[a]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};/**
|
||
|
* Walk over the tree of JS snippets in this node and its children. The
|
||
|
* walking function is called once for each snippet of JS and is passed that
|
||
|
* snippet and the its original associated source's line/column location.
|
||
|
*
|
||
|
* @param aFn The traversal function.
|
||
|
*/
|
||
|
u.prototype.walk=function f(e){var t;for(var n=0,i=this.children.length;n<i;n++){t=this.children[n];if(t[a]){t.walk(e)}else{if(t!==""){e(t,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};/**
|
||
|
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
|
||
|
* each of `this.children`.
|
||
|
*
|
||
|
* @param aSep The separator.
|
||
|
*/
|
||
|
u.prototype.join=function p(e){var t;var n;var i=this.children.length;if(i>0){t=[];for(n=0;n<i-1;n++){t.push(this.children[n]);t.push(e)}t.push(this.children[n]);this.children=t}return this};/**
|
||
|
* Call String.prototype.replace on the very right-most source snippet. Useful
|
||
|
* for trimming whitespace from the end of a source node, etc.
|
||
|
*
|
||
|
* @param aPattern The pattern to replace.
|
||
|
* @param aReplacement The thing to replace the pattern with.
|
||
|
*/
|
||
|
u.prototype.replaceRight=function d(e,t){var n=this.children[this.children.length-1];if(n[a]){n.replaceRight(e,t)}else if(typeof n==="string"){this.children[this.children.length-1]=n.replace(e,t)}else{this.children.push("".replace(e,t))}return this};/**
|
||
|
* Set the source content for a source file. This will be added to the SourceMapGenerator
|
||
|
* in the sourcesContent field.
|
||
|
*
|
||
|
* @param aSourceFile The filename of the source file
|
||
|
* @param aSourceContent The content of the source file
|
||
|
*/
|
||
|
u.prototype.setSourceContent=function g(e,t){this.sourceContents[r.toSetString(e)]=t};/**
|
||
|
* Walk over the tree of SourceNodes. The walking function is called for each
|
||
|
* source file content and is passed the filename and source content.
|
||
|
*
|
||
|
* @param aFn The traversal function.
|
||
|
*/
|
||
|
u.prototype.walkSourceContents=function m(e){for(var t=0,n=this.children.length;t<n;t++){if(this.children[t][a]){this.children[t].walkSourceContents(e)}}var i=Object.keys(this.sourceContents);for(var t=0,n=i.length;t<n;t++){e(r.fromSetString(i[t]),this.sourceContents[i[t]])}};/**
|
||
|
* Return the string representation of this source node. Walks over the tree
|
||
|
* and concatenates all the various snippets together to one string.
|
||
|
*/
|
||
|
u.prototype.toString=function y(){var e="";this.walk(function(t){e+=t});return e};/**
|
||
|
* Returns the string representation of this source node along with a source
|
||
|
* map.
|
||
|
*/
|
||
|
u.prototype.toStringWithSourceMap=function v(e){var t={code:"",line:1,column:0};var n=new i(e);var r=false;var s=null;var a=null;var u=null;var l=null;this.walk(function(e,i){t.code+=e;if(i.source!==null&&i.line!==null&&i.column!==null){if(s!==i.source||a!==i.line||u!==i.column||l!==i.name){n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})}s=i.source;a=i.line;u=i.column;l=i.name;r=true}else if(r){n.addMapping({generated:{line:t.line,column:t.column}});s=null;r=false}for(var c=0,h=e.length;c<h;c++){if(e.charCodeAt(c)===o){t.line++;t.column=0;
|
||
|
// Mappings end at eol
|
||
|
if(c+1===h){s=null;r=false}else if(r){n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})}}else{t.column++}}});this.walkSourceContents(function(e,t){n.setSourceContent(e,t)});return{code:t.code,map:n}};n.SourceNode=u},{"./source-map-generator":28,"./util":30}],30:[function(e,t,n){/* -*- Mode: js; js-indent-level: 2; -*- */
|
||
|
/*
|
||
|
* Copyright 2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
/**
|
||
|
* This is a helper function for getting values from parameter/options
|
||
|
* objects.
|
||
|
*
|
||
|
* @param args The object we are extracting values from
|
||
|
* @param name The name of the property we are getting.
|
||
|
* @param defaultValue An optional value to return if the property is missing
|
||
|
* from the object. If this is not specified and the property is missing, an
|
||
|
* error will be thrown.
|
||
|
*/
|
||
|
function i(e,t,n){if(t in e){return e[t]}else if(arguments.length===3){return n}else{throw new Error('"'+t+'" is a required argument.')}}n.getArg=i;var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var s=/^data:.+\,.+$/;function o(e){var t=e.match(r);if(!t){return null}return{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}}n.urlParse=o;function a(e){var t="";if(e.scheme){t+=e.scheme+":"}t+="//";if(e.auth){t+=e.auth+"@"}if(e.host){t+=e.host}if(e.port){t+=":"+e.port}if(e.path){t+=e.path}return t}n.urlGenerate=a;/**
|
||
|
* Normalizes a path, or the path portion of a URL:
|
||
|
*
|
||
|
* - Replaces consecutive slashes with one slash.
|
||
|
* - Removes unnecessary '.' parts.
|
||
|
* - Removes unnecessary '<dir>/..' parts.
|
||
|
*
|
||
|
* Based on code in the Node.js 'path' core module.
|
||
|
*
|
||
|
* @param aPath The path or url to normalize.
|
||
|
*/
|
||
|
function u(e){var t=e;var i=o(e);if(i){if(!i.path){return e}t=i.path}var r=n.isAbsolute(t);var s=t.split(/\/+/);for(var u,l=0,c=s.length-1;c>=0;c--){u=s[c];if(u==="."){s.splice(c,1)}else if(u===".."){l++}else if(l>0){if(u===""){
|
||
|
// The first part is blank if the path is absolute. Trying to go
|
||
|
// above the root is a no-op. Therefore we can remove all '..' parts
|
||
|
// directly after the root.
|
||
|
s.splice(c+1,l);l=0}else{s.splice(c,2);l--}}}t=s.join("/");if(t===""){t=r?"/":"."}if(i){i.path=t;return a(i)}return t}n.normalize=u;/**
|
||
|
* Joins two paths/URLs.
|
||
|
*
|
||
|
* @param aRoot The root path or URL.
|
||
|
* @param aPath The path or URL to be joined with the root.
|
||
|
*
|
||
|
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
||
|
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
||
|
* first.
|
||
|
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
||
|
* is updated with the result and aRoot is returned. Otherwise the result
|
||
|
* is returned.
|
||
|
* - If aPath is absolute, the result is aPath.
|
||
|
* - Otherwise the two paths are joined with a slash.
|
||
|
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
||
|
*/
|
||
|
function l(e,t){if(e===""){e="."}if(t===""){t="."}var n=o(t);var i=o(e);if(i){e=i.path||"/"}
|
||
|
// `join(foo, '//www.example.org')`
|
||
|
if(n&&!n.scheme){if(i){n.scheme=i.scheme}return a(n)}if(n||t.match(s)){return t}
|
||
|
// `join('http://', 'www.example.com')`
|
||
|
if(i&&!i.host&&!i.path){i.host=t;return a(i)}var r=t.charAt(0)==="/"?t:u(e.replace(/\/+$/,"")+"/"+t);if(i){i.path=r;return a(i)}return r}n.join=l;n.isAbsolute=function(e){return e.charAt(0)==="/"||r.test(e)};/**
|
||
|
* Make a path relative to a URL or another path.
|
||
|
*
|
||
|
* @param aRoot The root path or URL.
|
||
|
* @param aPath The path or URL to be made relative to aRoot.
|
||
|
*/
|
||
|
function c(e,t){if(e===""){e="."}e=e.replace(/\/$/,"");
|
||
|
// It is possible for the path to be above the root. In this case, simply
|
||
|
// checking whether the root is a prefix of the path won't work. Instead, we
|
||
|
// need to remove components from the root one by one, until either we find
|
||
|
// a prefix that fits, or we run out of components to remove.
|
||
|
var n=0;while(t.indexOf(e+"/")!==0){var i=e.lastIndexOf("/");if(i<0){return t}
|
||
|
// If the only part of the root that is left is the scheme (i.e. http://,
|
||
|
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
||
|
// have exhausted all components, so the path is not relative to the root.
|
||
|
e=e.slice(0,i);if(e.match(/^([^\/]+:\/)?\/*$/)){return t}++n}
|
||
|
// Make sure we add a "../" for each component we removed from the root.
|
||
|
return Array(n+1).join("../")+t.substr(e.length+1)}n.relative=c;var h=function(){var e=Object.create(null);return!("__proto__"in e)}();function f(e){return e}/**
|
||
|
* Because behavior goes wacky when you set `__proto__` on objects, we
|
||
|
* have to prefix all the strings in our set with an arbitrary character.
|
||
|
*
|
||
|
* See https://github.com/mozilla/source-map/pull/31 and
|
||
|
* https://github.com/mozilla/source-map/issues/30
|
||
|
*
|
||
|
* @param String aStr
|
||
|
*/
|
||
|
function p(e){if(g(e)){return"$"+e}return e}n.toSetString=h?f:p;function d(e){if(g(e)){return e.slice(1)}return e}n.fromSetString=h?f:d;function g(e){if(!e){return false}var t=e.length;if(t<9){return false}if(e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95){return false}for(var n=t-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}/**
|
||
|
* Comparator between two mappings where the original positions are compared.
|
||
|
*
|
||
|
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||
|
* mappings with the same original source/line/column, but different generated
|
||
|
* line and column the same. Useful when searching for a mapping with a
|
||
|
* stubbed out mapping.
|
||
|
*/
|
||
|
function m(e,t,n){var i=v(e.source,t.source);if(i!==0){return i}i=e.originalLine-t.originalLine;if(i!==0){return i}i=e.originalColumn-t.originalColumn;if(i!==0||n){return i}i=e.generatedColumn-t.generatedColumn;if(i!==0){return i}i=e.generatedLine-t.generatedLine;if(i!==0){return i}return v(e.name,t.name)}n.compareByOriginalPositions=m;/**
|
||
|
* Comparator between two mappings with deflated source and name indices where
|
||
|
* the generated positions are compared.
|
||
|
*
|
||
|
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||
|
* mappings with the same generated line and column, but different
|
||
|
* source/name/original line and column the same. Useful when searching for a
|
||
|
* mapping with a stubbed out mapping.
|
||
|
*/
|
||
|
function y(e,t,n){var i=e.generatedLine-t.generatedLine;if(i!==0){return i}i=e.generatedColumn-t.generatedColumn;if(i!==0||n){return i}i=v(e.source,t.source);if(i!==0){return i}i=e.originalLine-t.originalLine;if(i!==0){return i}i=e.originalColumn-t.originalColumn;if(i!==0){return i}return v(e.name,t.name)}n.compareByGeneratedPositionsDeflated=y;function v(e,t){if(e===t){return 0}if(e===null){return 1}if(t===null){return-1}if(e>t){return 1}return-1}/**
|
||
|
* Comparator between two mappings with inflated source and name strings where
|
||
|
* the generated positions are compared.
|
||
|
*/
|
||
|
function b(e,t){var n=e.generatedLine-t.generatedLine;if(n!==0){return n}n=e.generatedColumn-t.generatedColumn;if(n!==0){return n}n=v(e.source,t.source);if(n!==0){return n}n=e.originalLine-t.originalLine;if(n!==0){return n}n=e.originalColumn-t.originalColumn;if(n!==0){return n}return v(e.name,t.name)}n.compareByGeneratedPositionsInflated=b;/**
|
||
|
* Strip any JSON XSSI avoidance prefix from the string (as documented
|
||
|
* in the source maps specification), and then parse the string as
|
||
|
* JSON.
|
||
|
*/
|
||
|
function w(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}n.parseSourceMapInput=w;/**
|
||
|
* Compute the URL of a source given the the source root, the source's
|
||
|
* URL, and the source map's URL.
|
||
|
*/
|
||
|
function k(e,t,n){t=t||"";if(e){
|
||
|
// This follows what Chrome does.
|
||
|
if(e[e.length-1]!=="/"&&t[0]!=="/"){e+="/"}
|
||
|
// The spec says:
|
||
|
// Line 4: An optional source root, useful for relocating source
|
||
|
// files on a server or removing repeated values in the
|
||
|
// “sources” entry. This value is prepended to the individual
|
||
|
// entries in the “source” field.
|
||
|
t=e+t}
|
||
|
// Historically, SourceMapConsumer did not take the sourceMapURL as
|
||
|
// a parameter. This mode is still somewhat supported, which is why
|
||
|
// this code block is conditional. However, it's preferable to pass
|
||
|
// the source map URL to SourceMapConsumer, so that this function
|
||
|
// can implement the source URL resolution algorithm as outlined in
|
||
|
// the spec. This block is basically the equivalent of:
|
||
|
// new URL(sourceURL, sourceMapURL).toString()
|
||
|
// ... except it avoids using URL, which wasn't available in the
|
||
|
// older releases of node still supported by this library.
|
||
|
//
|
||
|
// The spec says:
|
||
|
// If the sources are not absolute URLs after prepending of the
|
||
|
// “sourceRoot”, the sources are resolved relative to the
|
||
|
// SourceMap (like resolving script src in a html document).
|
||
|
if(n){var i=o(n);if(!i){throw new Error("sourceMapURL could not be parsed")}if(i.path){
|
||
|
// Strip the last path component, but keep the "/".
|
||
|
var r=i.path.lastIndexOf("/");if(r>=0){i.path=i.path.substring(0,r+1)}}t=l(a(i),t)}return u(t)}n.computeSourceURL=k},{}],31:[function(e,t,n){/*
|
||
|
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||
|
* Licensed under the New BSD license. See LICENSE.txt or:
|
||
|
* http://opensource.org/licenses/BSD-3-Clause
|
||
|
*/
|
||
|
n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator;n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer;n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":27,"./lib/source-map-generator":28,"./lib/source-node":29}],livescript:[function(e,t,n){
|
||
|
// Generated by LiveScript 1.6.1
|
||
|
var i;i=e("./index");i.stab=function(e,t,n){var r;try{i.run(e,{filename:n,map:"embedded"})}catch(s){r=s}if(typeof t=="function"){t(r)}};i.load=function(e,t){var n;n=new XMLHttpRequest;n.open("GET",e,true);if("overrideMimeType"in n){n.overrideMimeType("text/plain")}n.onreadystatechange=function(){var r;if(n.readyState===4){if((r=n.status)===200||r===0){i.stab(n.responseText,t,e)}else{if(typeof t=="function"){t(Error(e+": "+n.status+" "+n.statusText))}}}};n.send(null);return n};i.go=function(){var e,t,n,r,s,o,a;e=/^(?:text\/|application\/)?ls$/i;t=function(e){e&&setTimeout(function(){throw e})};for(n=0,s=(r=document.getElementsByTagName("script")).length;n<s;++n){o=r[n];if(e.test(o.type)){if(a=o.src){i.load(a,t)}else{i.stab(o.innerHTML,t,o.id)}}}};t.exports=i},{"./index":2}]},{},[]);
|